Honor the Vert.x TracingPolicy in the OpenTelemetry VertxTracer#55414
Open
Develop-KIM wants to merge 1 commit into
Open
Honor the Vert.x TracingPolicy in the OpenTelemetry VertxTracer#55414Develop-KIM wants to merge 1 commit into
Develop-KIM wants to merge 1 commit into
Conversation
The VertxTracer implementations only skipped span creation for TracingPolicy.IGNORE and created a span for any other policy. As a result PROPAGATE - the default policy for the Vert.x event bus and HTTP client - created a span even when there was no active trace to propagate, so an event bus message sent outside of a trace produced spurious root spans. Honor PROPAGATE like the upstream Vert.x OpenTelemetryTracer does: only start a span when there is a parent to continue - taken from the active context on sendRequest, and from the active context or the incoming headers on receiveRequest. ALWAYS and IGNORE are unchanged. Fixes quarkusio#25417 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Develop-KIM <kimdonghwan913@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #25417
What
The OpenTelemetry
VertxTracerimplementations only honoredTracingPolicy.IGNORE; every other policy created a span. SoPROPAGATE— the default policy for the Vert.x event bus and HTTP client — created a span even when there was no active trace to propagate. An event bus message sent outside of a trace produced spurious root PRODUCER/CONSUMER spans, which is the noise reported in #25417.Change
InstrumenterVertxTracernow honorsPROPAGATEthe same way the upstream Vert.xOpenTelemetryTracerdoes — only start a span when there is a parent to continue:sendRequest(client/producer): trace only when the active context already holds a span. An outgoing request has no incoming headers, so the active context is enough.receiveRequest(server/consumer): trace only when a parent is present in the active context or can be extracted from the incoming headers, so a distributed trace propagated through the message headers is still continued.ALWAYSandIGNOREare unchanged.Verification
With no active trace, an event bus message sent with the default
PROPAGATEpolicy produced four spans before the change and none after; anALWAYSmessage is still traced (PRODUCER + CONSUMER).InstrumenterVertxTracerTest(runtime, unit) covers thesendRequest/receiveRequestpolicy decision.VertxEventBusTracingPolicyTest(deployment) asserts aPROPAGATEmessage sent with no active trace is not traced while anALWAYSmessage is.This was written with the help of Claude (AI); I've reviewed and validated the change and can walk through every line.