HTTP 400 status code should not set span status to error on servers - #2789
Conversation
|
|
Codecov Report
@@ Coverage Diff @@
## main #2789 +/- ##
==========================================
+ Coverage 93.11% 93.41% +0.29%
==========================================
Files 152 162 +10
Lines 4912 5559 +647
Branches 1044 1175 +131
==========================================
+ Hits 4574 5193 +619
- Misses 338 366 +28
|
|
I remember some conversations with specification a while ago that in http clients no http status should cause the span to be an error because the request itself was actually successful. An error would imply some sort of connection failure or crash or similar. Have you looked into the spec to see if there is any guidance on this? |
See the quoted section in the pr. It says client spans that get a 400 response should set the span status to error |
|
OK that works for me. Looks like you have some lint fixes but otherwise I don't have any major objection to the change. |
according to the spec 400-499 should be left UNSET in case of server span kind specifically > For HTTP status codes in the 4xx range > span status MUST be left unset in case > of SpanKind.SERVER and MUST be set to > Error in case of SpanKind.CLIENT.
3aaa560 to
045ab69
Compare
|
@nordfjord CI has failed. Would you mind giving it a fix? |
Thanks for the reminder 🤦. Yes I think it's fixed now. |
dyladan
left a comment
There was a problem hiding this comment.
LGTM % minor readability suggestion
Which problem is this PR solving?
according to the spec 400-499 should be left UNSET in case of server span kind
specifically
See the relevant spec section here: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#status
Short description of the changes
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: