opentracing-contrib / java-jaxrs

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

Enhance TracingInterceptor to decorate Span when exception occurs #147

Open rafaelbey opened 3 years ago

rafaelbey commented 3 years ago

Currently, the TracingInterceptor just add the error tag whenever an exception occurs.

I will like to be able to decorate the Span with other details about the exception, like the exception message. This will help our users find errors specially when exceptions are thrown while streaming data, where the response is just an incomplete stream, and have little detail on the underlying cause.

One idea I can think is to enhance the InterceptorSpanDecorator to have two new methods: decorateReadException and decorateWriteException, and call these when an error is catch. I will submit a PR with this idea shortly to better visualize it.

rafaelbey commented 3 years ago

Any feedback and direction will be welcome.