From 93c48e1ec0e65a308bf4efc7f005e7e757ad8a8d Mon Sep 17 00:00:00 2001 From: Nikita Salnikov-Tarnovski Date: Tue, 5 Oct 2021 14:41:42 +0300 Subject: [PATCH 1/3] Don't set Span.Status for 4xx http status codes for SERVER spans --- specification/trace/semantic_conventions/http.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 82f7696f78a..3bfa87f27d7 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` otherwise. + +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`. From 8a1a83172856f933fd9947004d0145895bda866d Mon Sep 17 00:00:00 2001 From: Nikita Salnikov-Tarnovski Date: Wed, 6 Oct 2021 16:04:11 +0300 Subject: [PATCH 2/3] Update specification/trace/semantic_conventions/http.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Neumüller --- specification/trace/semantic_conventions/http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 3bfa87f27d7..b5050a783e8 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -47,7 +47,7 @@ the response body; or 3xx codes with max redirects exceeded), in which case stat 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` otherwise. +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`. From 936a1dacf836417ac0867fa264a5dde02057e0f7 Mon Sep 17 00:00:00 2001 From: Nikita Salnikov-Tarnovski Date: Thu, 7 Oct 2021 09:07:50 +0300 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f1a762b1f..f14a1d35f05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ release. ### Semantic Conventions +- 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