java-spring-jaeger icon indicating copy to clipboard operation
java-spring-jaeger copied to clipboard

Jaeger Span is not marked as an error when exception is handled by ControllerAdvice

Open dawidskiba opened this issue 5 years ago • 0 comments

Requirement - what kind of business use case are you trying to solve?

Technology stack used in my project:

  • spring boot 2.2.3
  • io.opentracing.contrib:opentracing-spring-jaeger-web-starter:2.0.3
  • spring-boot-starter-webflux

I've spotted that exceptions that are caught by ExceptionHandlers in ControllerAdvice make Jaeger spans look like there was no error at all.

Problem - what in Jaeger blocks you from solving the requirement?

Despite that exception is caught and transformed into ResponseEntity with some custom error object in ControllerAdvice, Jaeger span should be processed (marked) as an error.

Proposal - what do you suggest to solve the problem or improve the existing situation?

The workaround that I applied is that I injected WebFluxSpanDecorator.StandardTags into my ControllerAdvice and decorate spans manually.

Any open questions to address

Is this behavior made by design? If yes, is there a better way to handle this situation than described in my workaround proposal?

dawidskiba avatar Feb 07 '20 09:02 dawidskiba