The Celery integration adds support for the Celery Task Queue System.

Just add CeleryIntegration() to your integrations list:

import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration


Additionally, the Sentry Python SDK will set the transaction on the event to the task name, and it will improve the grouping for global Celery errors such as timeouts.

The integration will automatically report errors from all celery jobs.

Generally, make sure that the call to init is loaded on worker startup, and not only in the module where your tasks are defined. Otherwise, the initialization happens too late and events might end up not being reported.

You can edit this page on GitHub.