- Notifications
You must be signed in to change notification settings - Fork 789
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
Currently, the celery task that is executing gets the context from the headers, and attaches it to the new span:
Lines 173 to 180 in e3ba54b
token = context_api.attach(tracectx) if tracectx is not None else None | |
logger.debug("prerun signal start task_id=%s", task_id) | |
operation_name = f"{_TASK_RUN}/{task.name}" | |
span = self._tracer.start_span( | |
operation_name, context=tracectx, kind=trace.SpanKind.CONSUMER | |
) |
I don't think this is the correct behavior. It should actually be a span link - according to the docs:
Links exist so that you can associate one span with one or more spans, implying a causal relationship. For example, let’s say we have a distributed system where some operations are tracked by a trace.
Which is exactly this case.
When a web framework triggers a celery task, it shouldn't be on the same trace. It's already a new one... But they are linked through the span link.
Would you like to implement a fix?
Yes
samuelcolvin, hramezani and ChristopherGS
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working