Skip to content

Sentry trace propagation issue with scheduled celery tasks #4545

Open
@sentrivana

Description

@sentrivana

From Slack:

It seems that setting the sentry-propagate-traces header to allow scheduled celery tasks to be their own trace (in Sentry, Python) doesn't actually work. Here's the apply_async where the header is provided; the actual tasks clearly share a trace with their whole task tree; here's an error from one of the tasks.. you can see in the stack trace vars we've got trace id headers in there. I can provide additional examples of a trace id being shared between tasks scheduled this way, if that's useful. There's a lot of overriding and runtime patching happening, so it's easy to imagine that being subtly broken at some point, but I haven't seen anything obvious yet. The impact here is that relevant tasks for my team are too large to view in the Tracing UI, which really makes diagnosing our active performance problems harder.

https://github.com/getsentry/sentry/blob/e09c9ed8a00672179d7cd186377c71a081ed9a2a/src/sentry/rules/processing/buffer_processing.py

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions