opentracing-contrib / java-jaxrs

OpenTracing Java JAX-RS instrumentation
Apache License 2.0
37 stars 33 forks source link

Exception handling in ServerTracingFilter #144

Open Kanikakhetawat opened 3 years ago

Kanikakhetawat commented 3 years ago

Hi, We are in the process of integrating opentracing with brave and for this we have integrated with ServerTracingDynamicFeature for starting the span for calls made to a resource.

Our intent is that tracing should not impact the normal request flow. To accomplish this, we would want to ignore/log any exceptions encountered in the filter while starting/closing a span. Since as of now, no explicit exception handling is done in the filter, our proposal is to provide a functionality so that clients can provide the ways in which they want to handle the exceptions. Example: client A can say "ignoreException" as true, client B can specify this as false (or specify a function to be called in case of exception). In this way, client A can ignore all span related errors and client B can have the intended action performed during an exception scenario.

Please evaluate the requirement and let me know if this could be implemented.