Closed malafeev closed 4 years ago
please assign issue to me
I see two options:
Add tracemulti
which means b3
, b3single
, tracecontext
:
PROPAGATORS=tracemulti
Or another format:
PROPAGATORS=tracemulti:b3,b3single,tracecontext
It means user can specify propagators to use in multi propagator.
cc @carlosalberto
To make sure I understand, what's the difference between these in the proposal?
PROPAGATORS=tracemulti:b3,b3single,tracecontext
and
PROPAGATORS=b3,b3single,tracecontext
@anuraaga as I understand @carlosalberto propose explicitly specify tracemulti
keyword.
@carlosalberto please tell us, why have you done this? :)
PROPAGATORS=tracemulti:b3,b3single,tracecontext
This one extracts a single SpanContext
at most.
PROPAGATORS=b3,b3single,tracecontext
This one extracts many SpanContext
, if such formats are found in the carrier.
Also, for the tracemulti
we can add additional logic, such as extract many formats, and only inject the first (or last) format (say, TraceContext).
PROPAGATORS=tracemulti:b3,b3single,tracecontext
This one extracts a single
SpanContext
at most.PROPAGATORS=b3,b3single,tracecontext
This one extracts many
SpanContext
, if such formats are found in the carrier.
Wow, I think that will be confusing for end users. Do we really need such separation?
The plan is to actually discourage the users from using the first case, by exposing the second case ;)
Observe that in general only a Propagator per signal should be specified, and the tracing case is a specific, given that are many formats around (and thus we may need to support a few or all of them).
The plan is to actually discourage the users from using the first case, by exposing the second case ;)
Are you sure you got the order right here?
Extracting many SpanContext
does not make sense. You can have only 1 remote parent span. Can we just have PROPAGATORS=b3,b3single,tracecontext
format and specify which one wins? It seems to me as the least surprising thing to do. And we are not GA yet, so it is Ok to change behaviour.
Wow, I think that will be confusing for end users. Do we really need such separation?
I'm already confused, what does it mean to "extracts many SpanContext"? There can only ever be one SpanContext
which corresponds to the new currentSpan
. Is it just about multiple headers would overwrite each other? That doesn't seem so bad, is the concern performance?
such as extract many formats, and only inject the first (or last) format
This sounds like it would be easier to configure as two flags, EXTRACTORS
and INJECTORS
. Creating a magic flag with such specific behavior that a user needs to dig into docs to fully understand seems too complicated to me.
@carlosalberto I think what you are saying here contradicts javadoc of https://github.com/open-telemetry/opentelemetry-java/blob/master/extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/TraceMultiPropagator.java. I mean, PROPAGATORS=b3,b3single,tracecontext
format should work exactly as that javadoc says. I don't see any need for multiple formats here.
If PROPAGATORS
contains one value, corresponding propagator will be used. If it contains multiple values, then TraceMultiPropagator
will be used with already nicely defined semantic.
Hey hey. Will clarify a few things:
By doing:
OTEL_PROPAGATORS=jaeger,b3,tracecontext
You effectively get multiple formats support - but if the carrier contains the three formats, it means SpanContext
will be extracted three times. So this is a correct and valid scenario, but it's wasting cycles.
OTEL_PROPAGATORS=multi-trace:jaeger,b3,tracecontext
In this case, we create a MultiTracePropagator
with these 3 formats, and extraction will stop/return when the first SpanContext
is successfully extracted.
If PROPAGATORS contains one value, corresponding propagator will be used. If it contains multiple values, then TraceMultiPropagator will be used with already nicely defined semantic.
@malafeev had already told me about this possibility. I personally don't like it so much, but if you prefer it, let's go with it ;) But you would need extra logic/fun to detect which propagator is a trace one, as propagators will be used by other signals:
OTEL_PROPAGATORS=correlationcontext,jaeger,b3,tracecontext,custompropagationsignal
But you would need extra logic/fun to detect which propagator is a trace one, as propagators will be used by other signals
How does the original propose make this easier?
Hey @carlosalberto, does it make sense for the OTEL_PROPAGATORS
env var be defined at the spec level? e.g. https://github.com/open-telemetry/opentelemetry-specification/issues/572
@trask Actually yes, let's work on this proposal there.
I suggest we go with @iNikem's suggestion above, at least for now, so we can unblock this needed feature:
If
PROPAGATORS
contains one value, corresponding propagator will be used. If it contains multiple values, thenTraceMultiPropagator
will be used with already nicely defined semantic.
In auto-instrumentation at least, the PROPAGATORS
configuration only supports a fixed set of known propagators, so I don't think we have the issue of detecting propagators for other signals, e.g. custompropagationsignal
.
opentelemtry 0.6 comes with TraceMultiPropagator
current PropagatorsInitializer supports only 'tracecontext' or 'b3'.