Skip to content

Honor the Vert.x TracingPolicy in the OpenTelemetry VertxTracer#55414

Open
Develop-KIM wants to merge 1 commit into
quarkusio:mainfrom
Develop-KIM:fix/25417-tracing-policy-propagate
Open

Honor the Vert.x TracingPolicy in the OpenTelemetry VertxTracer#55414
Develop-KIM wants to merge 1 commit into
quarkusio:mainfrom
Develop-KIM:fix/25417-tracing-policy-propagate

Conversation

@Develop-KIM

Copy link
Copy Markdown

Closes #25417

What

The OpenTelemetry VertxTracer implementations only honored TracingPolicy.IGNORE; every other policy created a span. So 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. An event bus message sent outside of a trace produced spurious root PRODUCER/CONSUMER spans, which is the noise reported in #25417.

Change

InstrumenterVertxTracer now honors PROPAGATE the same way the upstream Vert.x OpenTelemetryTracer does — 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.

ALWAYS and IGNORE are unchanged.

Verification

With no active trace, an event bus message sent with the default PROPAGATE policy produced four spans before the change and none after; an ALWAYS message is still traced (PRODUCER + CONSUMER).

  • InstrumenterVertxTracerTest (runtime, unit) covers the sendRequest/receiveRequest policy decision.
  • VertxEventBusTracingPolicyTest (deployment) asserts a PROPAGATE message sent with no active trace is not traced while an ALWAYS message is.

This was written with the help of Claude (AI); I've reviewed and validated the change and can walk through every line.

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>
@quarkus-bot

quarkus-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

/cc @brunobat (opentelemetry), @jamezp (opentelemetry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenTelemetry: Respect provided TracingPolicy in VertxTracer implementations

1 participant