You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an instrumented function (fn handler) in which we call OpenTelemetrySpanExt::set_parent.
Previously, we used something like this:
let context = Context::default();let context = TraceContextPropagator::new().extract_with_context(&context,&carrier);Span::current().set_parent(context);
With v0.20 this creates two traces because all spans created after setting the context will get a different traceId than the
span created for handler.
The example of set_parent uses TextMapPropagator::extract(&carrier). extract just calls Context::currenty() and then calls extract_with_context. If we change our code to use something equivalent:
let context = Span::current().context();let context = TraceContextPropagator::new().extract_with_context(&context,&carrier);Span::current().set_parent(context);
we miss a common root span according to Jaeger.
Note that the root span is entered at the time of calling Span::current().context().
If this is some error at our side, it should be better documented for set_parent. If not, and the PR is also not the cause, I assume we hit a regression in opentelemetry.
We are willing to create a PR once we know which path should be taken.
The text was updated successfully, but these errors were encountered:
I read the description of #45 more thoroughly, and it seems this is a duplicate of #45. Feel free to close this or the other one (depending on which one you think contains more context to fix this)
Bug Report
We see a regression after updating to v0.20 regarding remote context and how
traceIds
are propagated to children.Version
tracing v0.1.37
tracing-futures v0.2.5
tracing-subscriber v0.3.17
tracing-core v0.1.31
tracing-log v0.1.3
tracing-attributes v0.1.26
tracing-serde v0.1.3
tracing-opentelemetry v0.20.0
Platform
Description
We have an instrumented function (
fn handler
) in which we callOpenTelemetrySpanExt::set_parent
.Previously, we used something like this:
With v0.20 this creates two traces because all spans created after setting the context will get a different
traceId
than thespan created for
handler
.The example of
set_parent
usesTextMapPropagator::extract(&carrier)
.extract
just callsContext::currenty()
and then callsextract_with_context
. If we change our code to use something equivalent:we miss a common root span according to Jaeger.
Note that the root span is entered at the time of calling
Span::current().context()
.I think the regression was caused by #26.
If this is some error at our side, it should be better documented for
set_parent
. If not, and the PR is also not the cause, I assume we hit a regression in opentelemetry.We are willing to create a PR once we know which path should be taken.
The text was updated successfully, but these errors were encountered: