8000 Add comments for args and kwargs · au79stein/sentry-python@fa72f4b · GitHub
[go: up one dir, main page]

Skip to content

Commit fa72f4b

Browse files
antonpirkerszokeasaurusrex
authored andcommitted
Add comments for args and kwargs
1 parent 467bde9 commit fa72f4b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sentry_sdk/integrations/celery/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ def apply_async(*args, **kwargs):
168168
# type: (*Any, **Any) -> Any
169169
task = args[0]
170170

171+
from pprint import pprint
172+
173+
print("######### args (producer) #############")
174+
pprint(args)
175+
print("######### kwargs (producer) #############")
176+
pprint(kwargs)
177+
# TODO: this is the producer side. here we can add data from args/kwargs to the span.
178+
171179
# Do not create a span when the task is a Celery Beat task
172180
# (Because we do not have a transaction in that case)
173181
span_mgr = (
@@ -272,6 +280,15 @@ def _wrap_tracer(task, f):
272280
def _inner(*args, **kwargs):
273281
# type: (*Any, **Any) -> Any
274282
with isolation_scope() as scope:
283+
from pprint import pprint
284+
285+
print("######### args (consumer) #############")
286+
pprint(args)
287+
print("######### kwargs (consumer) #############")
288+
pprint(kwargs)
289+
# TODO: this is where the consumer picks up the task and processes it.
290+
# in the args you find a lot of information about the task that can be added to the transaction
291+
275292
scope._name = "celery"
276293
scope.clear_breadcrumbs()
277294
scope.add_event_processor(_make_event_processor(task, *args, **kwargs))

0 commit comments

Comments
 (0)
0