-
Notifications
You must be signed in to change notification settings - Fork 845
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
Servlet instrumentation overwrites setStatus that was set manually earlier #2929
Comments
There's probably some other areas that are using this similar pattern of setting to UNSET explicitly instead of skipping the method
Other examples if you look for Line 36 in 0b0516b
Discussion around:
|
As I am going to submit a PR to spec soon to implement open-telemetry/opentelemetry-specification#1584 (comment), I can also submit a proposal that SDK should ignore |
Describe the bug
See Slack thread here. I have some custom instrumentation that is trying to call
span.setStatus(error)
on a span generated by servlet instrumentation - this works correctly. However, the servlet instrumentation ends up overwriting this status withUNSET
here due toHttpStatusConverter
returning unset for >= 100 && < 400 HTTP status codes. In the Slack thread it's mentioned the instrumentation should only ever set ERROR. Note my HTTP request actually does return a 200 (non-error) but this is the nature of the RPC protocol I'm instrumenting that it returns 200 with an error status in the response body instead of HTTP status code.Steps to reproduce
Add an instrumentation that modifies the span that the servlet is going to operate on, calling
setStatus(error)
.What did you expect to see?
The span should be reported with status=error
What did you see instead?
The span was reported with status=unset
What version are you using?
1.1.0
Environment
OpenJDK 1.8
The text was updated successfully, but these errors were encountered: