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
The Helidon OpenTelemetryTracer#spanBuilder implementation of our neutral Tracer interface always sets the parent of the new span builder to the currently-active span (if there is one).
How can developers create a root OTel span (with no parent)?
Answer
OpenTelemetry's SpanBuilder type exposes the setNoParent() method which does exactly what you expect...it clears out any current parent setting for the span builder.
So developers using the Helidon tracing API can do the following _if they know they are using the Helidon OpenTelemetry implementation of the Helidon tracing API:
The example code works only if the Helidon OpenTelemetry implementation is in use. The unwrap will fail (in fact it will probably not even compile) if you are using a different Helidon tracer provider.
The text was updated successfully, but these errors were encountered:
tjquinno
changed the title
OpenTelemetryTracer#spanBuilder always sets parent to active span; should this be left to the developer?OpenTelemetryTracer#spanBuilder always sets parent to active span; should this be left to the developer? (probably yes)
May 20, 2024
tjquinno
changed the title
OpenTelemetryTracer#spanBuilder always sets parent to active span; should this be left to the developer? (probably yes)OpenTelemetryTracer#spanBuilder always sets parent to active span; how can developers create a root span (with no parent)?
May 24, 2024
Environment Details
Problem Description
The Helidon
OpenTelemetryTracer#spanBuilder
implementation of our neutralTracer
interface always sets the parent of the new span builder to the currently-active span (if there is one).How can developers create a root OTel span (with no parent)?
Answer
OpenTelemetry's
SpanBuilder
type exposes thesetNoParent()
method which does exactly what you expect...it clears out any current parent setting for the span builder.So developers using the Helidon tracing API can do the following _if they know they are using the Helidon OpenTelemetry implementation of the Helidon tracing API:
The example code works only if the Helidon OpenTelemetry implementation is in use. The
unwrap
will fail (in fact it will probably not even compile) if you are using a different Helidon tracer provider.The text was updated successfully, but these errors were encountered: