Skip to content

Celery app.send_task() doesn't propagate trace #2372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
divaltor opened this issue Sep 14, 2023 · 3 comments · Fixed by #2377
Closed

Celery app.send_task() doesn't propagate trace #2372

divaltor opened this issue Sep 14, 2023 · 3 comments · Fixed by #2377
Assignees
Labels
Integration: Celery Triaged Has been looked at recently during old issue triage

Comments

@divaltor
Copy link
Contributor

How do you use Sentry?

Self-hosted/on-premise

Version

1.30.0

Steps to Reproduce

I execute tasks via app.send_task(<task_name>, kwarsg={...}) (where app is Celery() instance) because it's simpler for me and my case (I have a lot of circular errors if use tasks directly) and it seems that Sentry doesn't wrap this method hence there is no attached trace for tasks

Expected Result

I see every trace starting from front-end -> back-end -> queue tasks

Actual Result

image

@antonpirker
Copy link
Member

antonpirker commented Sep 15, 2023

Hey @divaltor !
Thanks for writting in.
In deed, we do not propagate traces when using send_task() right now. We need to update the Celery integration for supporting this. I put in our internal backlog (but this will take some time because we have a lot of things on our plates right now)

@Dogrtt
Copy link

Dogrtt commented Jan 21, 2024

Hi guys,
any update on this topic?
I have FastAPI based service and separate Celery service. FastAPI knows only task names and required args, it doesn't have access to Celery task src, so I just can't apply_async them. Elastic-APM provides possibility to use specific header to bind traces, do you have something similar in Sentry?
Of course, it would be awesome to get everything ready-2-go out from the box, without headers manipulations, but for now it would be just fine.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 21, 2024
@sentrivana
Copy link
Contributor

Hey @Dogrtt, @divaltor submitted a PR to make this work so this could soon be part of the out of the box SDK experience -- in the meantime, you could try forwarding the sentry-trace and baggage headers to the task.

@antonpirker antonpirker removed this from the Celery Update milestone Jun 20, 2024
@sentrivana sentrivana added the Triaged Has been looked at recently during old issue triage label Jul 1, 2024
@szokeasaurusrex szokeasaurusrex self-assigned this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration: Celery Triaged Has been looked at recently during old issue triage
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants