Skip to content

Commit 639c744

Browse files
authored
Don't set Span.Status for 4xx http status codes for SERVER spans (#1998)
* Don't set Span.Status for 4xx http status codes for SERVER spans
1 parent 442e088 commit 639c744

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ release.
2727
- BREAKING: Remove db.cassandra.keyspace and db.hbase.namespace, and clarify db.name
2828
([#1973](https://github.com/open-telemetry/opentelemetry-specification/pull/1973))
2929

30+
- Don't set Span.Status for 4xx http status codes for SERVER spans.
31+
([#1998](https://github.com/open-telemetry/opentelemetry-specification/pull/1998))
32+
3033
### Compatibility
3134

3235
### OpenTelemetry Protocol

specification/trace/semantic_conventions/http.md

Lines changed: 5 additions & 2 deletions
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)