opentracing-contrib / java-web-servlet-filter

OpenTracing Java Web Servlet Filter Instrumentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Span is not tagged with error if exception is handled by spring boot controller advice

ash1425 opened this issue · comments

I have a spring boot service with @ControllerAdvice and @ExceptionHandler. These mechanism swallow the exception and it never reaches the TracerFilter and span is not tagged as error.

Can we also check the status code and decide if the Span should be tagged as error in OnResponse of the default decorator.

These mechanism swallow the exception and it never reaches the TracerFilter and span is not tagged as error.

Isn't that expected? The exception hanler catches business exceptions and returns "ok" response. In this case it's more appropriate to instrument exception handler to tag spans with an exception.

@pavolloffay yes, you are right. I agree that this should be handled in Spring library instead of this generic servlet library.
I will create issue in respective spring library and will close this issue here.
Thanks.