Skip to content

Commit 5161633

Browse files
authored
Don't set Span.Status for 4xx http status codes for SERVER spans (open-telemetry#1998)
* Don't set Span.Status for 4xx http status codes for SERVER spans
1 parent d42afab commit 5161633

File tree

1 file changed

+5
-2
lines changed
  • specification/trace/semantic_conventions

1 file changed

+5
-2
lines changed

specification/trace/semantic_conventions/http.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ default span name.
4646
the response body; or 3xx codes with max redirects exceeded), in which case status
4747
MUST be set to `Error`.
4848

49-
For HTTP status codes in the 4xx and 5xx ranges, as well as any other code the client
50-
failed to interpret, status MUST be set to `Error`.
49+
For HTTP status codes in the 4xx range span status MUST be left unset in case of `SpanKind.SERVER`
50+
and MUST be set to `Error` in case of `SpanKind.CLIENT`.
51+
52+
For HTTP status codes in the 5xx range, as well as any other code the client
53+
failed to interpret, span status MUST be set to `Error`.
5154

5255
Don't set the span status description if the reason can be inferred from `http.status_code`.
5356

0 commit comments

Comments
 (0)