-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spans are marked as error though the exceptions are handled by @ControllerAdvice #6377
Comments
Hey @MALPI , |
Let me see if I can create something in the next days. |
Thanks! |
|
But throwing an exception not always necessarily means that there is a technical failure?
I'll try that as a workaround. @mateuszrzeszutek I would say the PoC isn't required anymore. |
@mateuszrzeszutek @laurit this is an interesting topic. it's not entirely clear to me that we should capture exceptions when there is a non-remote parent span. |
I agree with @trask that it is unexpected that a span is marked as erroneous just because there is thrown an exception. |
Yes, I agree. Sorry for misleading you, I concentrated on the
I think that the current behavior makes perfect sense, as the default strategy. From the |
In general this would work, yes. But actually I do think that the semantics are a bit different here. I would consider a span erroneous due to a technical failure which usually is caused by a dependency. Whereas one could use exceptions as well to indicate business failures, that definitely shouldn't be treated as an error. |
We have no way to tell whether the exception represents an actual error or not. Given the choice between current behaviour and ignoring exceptions I'd go with what we currently have. The |
oh ya, I understand what you want now. seems very related to this discussion: open-telemetry/opentelemetry-specification#1008 |
Also related: #431 |
Just thought a bit more, even with |
I'm not sure how many configuration options we want to add to @zeitlinger @jack-berg this could be a good use case for a convenience API somewhere in between |
To avoid surprises, users should be able to rely on Apart from that, open-telemetry/opentelemetry-java-contrib#759 is planning to allow you to customize the error setting behavior as well. |
Hey @trask @trask is there some estimation on when open-telemetry/opentelemetry-java-contrib#759 could be released? |
it was planned for the current release 2 days ago - but missed. |
as mentioned above, I don't think this can be detected automatically but can be resolved by calling |
Describe the bug
I have a service that uses
@ControllerAdvice
by Spring Boot in order to handle exceptions globally and return the expectedProblem
response.When the request is processed like
processor.processRequest(request) throws Exception
theprocessRequest
method might throw an exception so that theExceptionHandler
is taking care of returning the required response.processRequest
it annotated with@WithSpan
as we set custom attributes there. When an Exception is thrown, the Span is marked aserror: true
, though it shouldn't as theExceptionHandler
is setting status code 400 in the response.What did you expect to see?
I would have expected to see a regular span with
error: false
.What did you see instead?
span with
error: true
.What version are you using?
v1.15.0-alpha
The text was updated successfully, but these errors were encountered: