From d6e8971dcb0e71ccc01201458162f6711d8bc850 Mon Sep 17 00:00:00 2001 From: Nikita Salnikov-Tarnovski Date: Tue, 12 Oct 2021 14:03:23 +0300 Subject: [PATCH] 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 --- CHANGELOG.md | 3 +++ specification/trace/semantic_conventions/http.md | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81aaba4eadc..774dd8ee067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 82f7696f78a..b5050a783e8 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -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`.