Skip to content

Commit def50d9

Browse files
fix: Clarify when Celery integration should be initialized (#3711)
* fix: Clarify when Celery integration should be initialized Fix #3697 * Update src/platforms/python/guides/celery/index.mdx Co-authored-by: Isabel <[email protected]> Co-authored-by: Isabel <[email protected]>
1 parent 993adad commit def50d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/platforms/python/guides/celery/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ The integration will automatically report errors from all celery jobs.
2626

2727
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.
2828

29+
There are many valid ways to do this like, for example, using a signal like [`worker_process_init`](https://docs.celeryproject.org/en/stable/userguide/signals.html#worker-process-init), or by initializing the SDK in the configuration file loaded with Celery's `--config` parameter.
30+
31+
To verify if your SDK is initialized on worker start, you can pass `debug=True` to see extra output when the SDK is initialized. If the output appears during worker startup and not only after a task has started, then it's working properly.
32+
2933
<Alert level="info" title="Note on distributed tracing">
3034

3135
Sentry uses custom message headers for distributed tracing. Since Celery version 4.0, for [message protocol of version 1](https://docs.celeryproject.org/en/stable/internals/protocol.html#version-1), this functionality is broken and Celery fails to propagate custom headers to the worker. Protocol version 2, which is default since Celery version 4.0, is not affected.

0 commit comments

Comments
 (0)