Skip to content
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

Restore original behavior by always creating a span #3005

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

antonpirker
Copy link
Member

In the original implementation of celery trace propagation we had code to only create a span for the task if it was NOT started by Celery Beat (because there is no transaction created in the beat process, so also not span should be created).

See this code: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/celery.py#L187-L200

Turns out this has never worked and task_started_from_beat has always been False meaning a span was ALWAYS created.

(This did never break anything or caused any troube. When looking into a transaction less future this is also absolutely fine.)

So this PR restores now the original behavior by always creating a span.

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Why did the check never work in the first place, do we know?

@antonpirker antonpirker merged commit 17715c0 into sentry-sdk-2.0 Apr 23, 2024
111 checks passed
@antonpirker antonpirker deleted the antonpirker/fix-celery-task-propagation branch April 23, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants