10000 feat: Capture spans for Celery's apply_async · getsentry/sentry-python@bb4c1ad · GitHub
[go: up one dir, main page]

Skip to content

Commit bb4c1ad

Browse files
committed
feat: Capture spans for Celery's apply_async
1 parent 54a4556 commit bb4c1ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/integrations/celery.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ def apply_async(*args, **kwargs):
7777
headers[key] = value
7878
if headers is not None:
7979
kwargs["headers"] = headers
80-
return f(*args, **kwargs)
80+
81+
from sentry_sdk import Hub
82+
with hub.span(op="celery", description=task.name):
83+
return f(*args, **kwargs)
84+
else:
85+
return f(*args, **kwargs)
8186

8287
return apply_async
8388

0 commit comments

Comments
 (0)
0