opentracing-contrib / java-web-servlet-filter

OpenTracing Java Web Servlet Filter Instrumentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to skip tracing for certain URL patterns

pavolloffay opened this issue · comments

This should be helpful for use cases like: checking application health on openshift, disable favicon, swagger docs..

I am thinking about implementation, I'm wondering whether setting sampling.priority=0 on newly started server span would be the cleanest solution here.

cc @bhs @yurishkuro @adriancole

@pavolloffay IMO it would make more sense to just omit the Span entirely... of course this is a judgement call, but if the goal is to ignore something it would be better in my mind to skip the cost of allocating Spans just to discard them shortly thereafter.

I agree with @bhs: instrumentation policy is different than sampling policy. Simpler to not instrument always uninteresting paths (by affecting which paths the trace filter applies to). If that's not possible or practical, then move to sampling policy

Thanks, I was curious what opinion do you have on this.

I asked because this will require to pass something in servlet attributes to let know higher layers (spring MVC, jaxrs) know that request is not traced. Which is not so clean but would perform better.

At the moment this filter is reused by spring-web. I plan to use it also in jax-rs to trace unauthenticated/no URL mapping requests etc..

in spring-web yes, I run into various issues and this seemed as the best for spring-web. In jax-rs preferred solution would be to create a new span I guess.