Make root span trace IDs unique#505
Make root span trace IDs unique#505c24t wants to merge 2 commits intocensus-instrumentation:masterfrom
Conversation
| else: | ||
| execution_context.set_current_span(None) | ||
| self.span_context.trace_id = generate_trace_id() | ||
| self.trace_id = self.span_context.trace_id |
There was a problem hiding this comment.
tracer.trace_id is unused, and I don't know why it's included on the tracer. Removing it is a problem for another PR.
|
@c24t, what's the story with this PR? |
I hadn't merged it because it was breaking a system test that was asserting the wrong behavior. Still TODO.
This PR deals with siblings spans having the same trace ID when the parent trace ID is null, #539 changes the grpc client interceptor so that it uses the current tracer to set trace IDs instead of the tracer that was current at the time the interceptor was created. Both problems affect the @nikhaldi does that match your understanding? |
|
I see what you mean, thanks. I don't have enough background about how people use the API to judge if the case of a null parent trace id is valid. My reading of the code tracking down my issues was that the API requires a new tracer to be created for every individual trace. But if that's not case this PR seems reasonable. |
This PR fixes a longstanding bug: that all spans generated by a given
ContextTracershare the same trace ID regardless of the context. This meant sequential root spans were reported as siblings in the same trace instead of each belonging to its own trace.Fixes #182 and #366. See #182 (comment) for more detail.
cc @tab1293, @sduskis.