Skip to content

Commit

Permalink
Don't set Span.Status for 4xx http status codes for SERVER spans (ope…
Browse files Browse the repository at this point in the history
…n-telemetry#1998)

* Don't set Span.Status for 4xx http status codes for SERVER spans
  • Loading branch information
iNikem authored Oct 12, 2021
1 parent e1eca74 commit d6e8971
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ release.
- BREAKING: Remove db.cassandra.keyspace and db.hbase.namespace, and clarify db.name
([#1973](https://github.com/open-telemetry/opentelemetry-specification/pull/1973))

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

### Compatibility

### OpenTelemetry Protocol
Expand Down
7 changes: 5 additions & 2 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ default span name.
the response body; or 3xx codes with max redirects exceeded), in which case status
MUST be set to `Error`.

For HTTP status codes in the 4xx and 5xx ranges, as well as any other code the client
failed to interpret, status MUST be set to `Error`.
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`.

For HTTP status codes in the 5xx range, as well as any other code the client
failed to interpret, span status MUST be set to `Error`.

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

Expand Down

0 comments on commit d6e8971

Please sign in to comment.