quarkusio/quarkus

OpenTelemetry: Respect provided TracingPolicy in VertxTracer implementations

Open

#25417 opened on May 6, 2022

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Java (12,967 stars) (2,464 forks)batch import
area/tracinggood first issuekind/enhancement

Description

Description

When using the quarkus-opentelemetry extension, there currently seems to be no direct way to switch off certain kinds of instrumentation. For example, the Vert.x event bus instrumentation might produce traces that are not needed in certain applications and just produce noise there.

Reading the Vert.x OpenTelemetry documentation, the assumption would be, that the solution here is to just set the TracingPolicy.IGNORE policy on the Vert.x event bus DeliveryOptions.

But this doesn't work with the Quarkus VertxTracer implementations. There, the TracingPolicy parameter is getting ignored (in contrast to the Vert.x OpenTelemetryTracer implementation).

Another example would be HTTP server/client instrumention, where also the TracingPolicy can be set in the client/server options. Being able to use TracingPolicy.IGNORE there would for example make it easier to migrate applications already having a (manual) HTTP request instrumentation. (Letting the HttpInstrumenterVertxTracer traces be discarded by means of a custom Sampler implementation looks like an inferior workaround.)

Implementation ideas

Skip request processing in the Quarkus VertxTracer implementations for requests with TracingPolicy.IGNORE (as done in the Vert.x OpenTelemetryTracer).

Contributor guide