Celery Integration
Configure Celery settings for optimal integration with Kanchi.
Kanchi monitors your Celery tasks by connecting to your broker and result backend. Most Celery configurations work out of the box, but some settings can improve your monitoring experience.
Task argument size limits
Celery truncates task arguments and keyword arguments at 1024 characters by default when storing task representations. If you're working with large payloads — like passing JSON blobs or file contents as task arguments — you'll see ... in Kanchi's task detail view instead of the full data.
This is a Celery limitation, not a Kanchi one. The good news: it's configurable.
Increasing the limits
Override Celery's defaults on your app instance:
from celery import Celery
app = Celery('your_app')
# Increase representation limits (default: 1024)
app.amqp.argsrepr_maxsize = 10000
app.amqp.kwargsrepr_maxsize = 10000Performance consideration: Larger limits mean more data stored in your broker and database. If you're passing multi-megabyte arguments, consider storing them elsewhere (S3, Redis, etc.) and passing references instead.
When to adjust these values:
- Task detail pages show truncated arguments (
...) - You need full argument inspection for debugging
- Your tasks legitimately require large payloads
Reference: See Celery's argsrepr_maxsize documentation for more details.
Pickle serialization (opt-in)
Celery pickle payloads stay blocked by default because unpickling can run arbitrary code. Only turn this on in trusted environments where you control every producer.
Pickle acceptance is for trusted networks only. If an untrusted publisher can send messages, keep this disabled.
What changed
- The monitor can now accept
application/x-python-serializepayloads when explicitly enabled. - When enabled, startup logs include a warning so the risk is visible.
Enable it
-
Set
ENABLE_PICKLE_SERIALIZATION=truein your environment (Compose, Kubernetes, or local env vars). -
Keep your workers pickle-aware, e.g.:
accept_content = ['json', 'pickle'] task_serializer = 'pickle' -
Restart Kanchi so the Celery client reloads its configuration.
-
Verify data flow. Logs will note that pickle deserialization is active.
Prefer JSON whenever possible; flip on pickle only when you need interoperability with trusted producers.