Skip to content

Commit 2a12715

Browse files
committed
reformat
1 parent a7d7af6 commit 2a12715

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

sentry_sdk/integrations/celery/__init__.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,13 @@ def _inner(*args: "Any", **kwargs: "Any") -> "Any":
418418
try:
419419
span: "Union[Span, StreamedSpan]"
420420
if span_streaming:
421-
span = sentry_sdk.traces.start_span(name=task.name)
422-
span.set_attribute("sentry.op", OP.QUEUE_PROCESS)
423-
span.set_attribute("sentry.origin", CeleryIntegration.origin)
421+
span = sentry_sdk.traces.start_span(
422+
name=task.name,
423+
attributes={
424+
"sentry.op": OP.QUEUE_PROCESS,
425+
"sentry.origin": CeleryIntegration.origin,
426+
},
427+
)
424428
else:
425429
span = sentry_sdk.start_span(
426430
op=OP.QUEUE_PROCESS,
@@ -565,9 +569,13 @@ def sentry_publish(self: "Producer", *args: "Any", **kwargs: "Any") -> "Any":
565569
span: "Union[StreamedSpan, Span, None]" = None
566570
if span_streaming:
567571
if sentry_sdk.get_current_span() is not None:
568-
span = sentry_sdk.traces.start_span(name=task_name)
569-
span.set_attribute("sentry.op", OP.QUEUE_PUBLISH)
570-
span.set_attribute("sentry.origin", CeleryIntegration.origin)
572+
span = sentry_sdk.traces.start_span(
573+
name=task_name,
574+
attributes={
575+
"sentry.op": OP.QUEUE_PUBLISH,
576+
"sentry.origin": CeleryIntegration.origin,
577+
},
578+
)
571579
else:
572580
span = sentry_sdk.start_span(
573581
op=OP.QUEUE_PUBLISH,

0 commit comments

Comments
 (0)