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

Celery beat exclude option #2130

Merged
merged 9 commits into from
May 22, 2023

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented May 22, 2023

Adds a exclude_beat_tasks option to CeleryIntegration where users can exclude Celery Beat tasks from being auto-instrumented.

Fixes #2119

Documentation PR: getsentry/sentry-docs#6995

@antonpirker
Copy link
Member Author

antonpirker commented May 22, 2023

I extracted a new function (match_regex_list) from how the matching of trace_propagation_targets works right now to reuse the behavior.

One possible foot gun:
In trace_propagation_targets we do sub-string matches (as described in the documentation: https://docs.sentry.io/platforms/python/configuration/options/#trace-propagation-targets)

This could lead to unintended matches if you have two tasks task-a and task-a-b and you set exclude_beat_tasks=["task-a"] it will exclude task-a and task-a-b.

Not the best developer experience, but it is the behavior we have no in trace_propagation_targets.

@antonpirker
Copy link
Member Author

Changed to always match the full task names.

@antonpirker antonpirker marked this pull request as ready for review May 22, 2023 13:11
@antonpirker antonpirker requested review from sentrivana and sl0thentr0py and removed request for sentrivana May 22, 2023 14:21
@antonpirker antonpirker enabled auto-merge (squash) May 22, 2023 14:34
@antonpirker antonpirker merged commit 1d9effe into master May 22, 2023
241 checks passed
@antonpirker antonpirker deleted the antonpirker/2119-celery-beat-exclude-option branch May 22, 2023 15:01
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.

Exclude Celery Beat tasks from auto-instrumenting
2 participants