Exclude URLs from Tracing
See original GitHub issueIs your feature request related to a problem? Please describe. As already mentioned here https://github.com/open-telemetry/opentelemetry-specification/issues/173 I’d like to be able to exclude or sample a list of URLs / URL-Patterns from instrumentation. In my case particularly to avoid generating many events from health- and liveness-checks.
Describe the solution you’d like
I opened the issue https://github.com/open-telemetry/opentelemetry-java/issues/1552 to discuss if / how tracing might be disabled from instrumentation.
To my knowledge there currently is no API / SDK method to disable tracing centrally on the context.
If I understood correctly a (maybe temporary) solution might be to create a non-recording / invalid span in the HTTP instrumentation, which due to the ParentOrElse-Sampler, would lead to ignoring child spans as well, if the request matches a URL pattern.
Any hint to where this would be architecturally appropriately implemented is highly appreciated.
Maybe in the HttpServerTracer?
Describe alternatives you’ve considered
We already attempted to use the otel.trace.classes.exclude but only succeeded in completely disabling WebMvc instrumentation.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:34
- Comments:34 (23 by maintainers)
Top Related StackOverflow Question
Been trying auto instrumentation in a container lately, and was slightly annoyed myself with tracing of health check. Then a customer trying it out independently had the same feedback - it’s exactly the kind of input we’re hoping for in trials 😃 So I may actually mark this required for GA, the UX is impacted a lot with having no control of tracing by URL pattern.
This is has come up a number of times for our customers as well, so I’ve updated our otel java agent example to package an extension which uses the rule based to drop requests to spring boot actuator endpoints. Maybe seeing concrete sample code will clear up any confusion.