Use Helidon tracer, span builder, span types instead of OTel ones so we can trigger span listeners #8778
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves #8774
Resolves #8370
The Helidon MP telemetry handling of the
@WithSpan
annotation used the OTel types (tracer, span, and span builder). This made sense initially because@WithSpan
is an OpenTelemetry annotation.Similarly, our container and client filters for setting the correct span context used the OTel types.
But recently we added support for span listeners, and the listeners are invoked from the Helidon wrappers around the various tracing implementations. Because the code that handled
@WithSpan
and the two filters all used the OTel types directly instead of the Helidon wrappers the listeners were not invoked for spans created due to@WithSpan
or the filters.The main changes in this PR:
WithSpanInterceptor
now uses the Helidon tracing types.HelidonTelemetryContainerFilter
andHelidonTelemetryClientFilter
now use the Helidon tracing types. As part of this change, the filters add the Helidon types to the request contexts so the backside filter method (invoked after the request has been processed) can obtain them and work with them. ([4.x] Should MP OpenTelemetry support add Helidon span, span context, and scope instances to request context? #8370)Testing changes:
@WithSpan
.SpanBuilder#setNoParent
method works as a way to create a root span.Documentation
This is a bug fix and has no doc impact.