Skip to content

Commit f808802

Browse files
committed
This is a separate option that can be given to apply_async and needs to stay
1 parent 7376e5a commit f808802

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry_sdk/integrations/celery/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ def apply_async(*args, **kwargs):
254254
return f(*args, **kwargs)
255255

256256
kwarg_headers = kwargs.get("headers") or {}
257+
propagate_traces = kwarg_headers.pop("sentry-propagate-traces", True)
258+
259+
if not propagate_traces:
260+
return f(*args, **kwargs)
257261

258262
if isinstance(args[0], Task):
259263
task_name = args[0].name # type: str

0 commit comments

Comments
 (0)