Exclude URLs from Tracing

See original GitHub issue

Is 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.

/CC @gabrielthunig @spaletta

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:34
  • Comments:34 (23 by maintainers)

github_iconTop GitHub Comments

13reactions
anuraagacommented, Sep 16, 2020

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.

8reactions
jack-bergcommented, Oct 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to exclude urls(health check traces) in opentelemetry
I am trying to integrate opentelemetry in spring boot with Automatic instrumentation, it's generating health check urls. How to exclude ...
Read more >
Ignoring Unwanted Resources in APM - Datadog Docs
The ignore resources option allows resources to be excluded if the global root span of the trace matches certain criteria. See Exclude resources...
Read more >
Cloud Trace filters | Google Cloud
You use trace filters to select a set of traces from Cloud Trace. ... matches traces when the root span label /http/url is...
Read more >
Browser data in distributed tracing | New Relic Documentation
(If you exclude them, no headers will be sent.) For more information, see our documentation about W3C trace context headers. To enable distributed...
Read more >
Micronaut Tracing
It may be useful to exclude health-checks and other HTTP requests to your service. ... tracing: zipkin: enabled: true http: urls: - https://foo:9411 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found