Skip to content

Commit

Permalink
fix(opentelemetry-instrumentation-celery): attach context only if it …
Browse files Browse the repository at this point in the history
…is not None
  • Loading branch information
malcolmrebughini committed Jul 30, 2024
1 parent 3eda7ba commit 71b2e5c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _trace_prerun(self, *args, **kwargs):
self.update_task_duration_time(task_id)
request = task.request
tracectx = extract(request, getter=celery_getter) or None
token = context_api.attach(tracectx)
token = context_api.attach(tracectx) if tracectx is not None else None

logger.debug("prerun signal start task_id=%s", task_id)

Expand Down

0 comments on commit 71b2e5c

Please sign in to comment.