From 35fb22cff02f36d7372ea2d7fca459b430f1a7e2 Mon Sep 17 00:00:00 2001 From: Cole Date: Tue, 22 Sep 2020 13:32:56 -0500 Subject: [PATCH] Remove http status text --- CHANGELOG.md | 2 +- semconv/http.go | 4 ---- semconv/http_test.go | 1 - semconv/trace.go | 3 --- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4deef4055bf..a89202be4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the `go.opentelemetry.io/contrib/propagators/` module. (#1191) - +- Remove semantic convention for HTTP status text. ### Fixed - Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) diff --git a/semconv/http.go b/semconv/http.go index 1ffe550111f..b2b0ff74661 100644 --- a/semconv/http.go +++ b/semconv/http.go @@ -224,10 +224,6 @@ func HTTPAttributesFromHTTPStatusCode(code int) []label.KeyValue { attrs := []label.KeyValue{ HTTPStatusCodeKey.Int(code), } - text := http.StatusText(code) - if text != "" { - attrs = append(attrs, HTTPStatusTextKey.String(text)) - } return attrs } diff --git a/semconv/http_test.go b/semconv/http_test.go index a5943272b79..713c6c39068 100644 --- a/semconv/http_test.go +++ b/semconv/http_test.go @@ -682,7 +682,6 @@ func TestHTTPServerAttributesFromHTTPRequest(t *testing.T) { func TestHTTPAttributesFromHTTPStatusCode(t *testing.T) { expected := []label.KeyValue{ label.Int("http.status_code", 404), - label.String("http.status_text", "Not Found"), } got := HTTPAttributesFromHTTPStatusCode(http.StatusNotFound) assertElementsMatch(t, expected, got, "with valid HTTP status code") diff --git a/semconv/trace.go b/semconv/trace.go index 46330e32b18..c16efa21dd5 100644 --- a/semconv/trace.go +++ b/semconv/trace.go @@ -94,9 +94,6 @@ const ( // HTTP response status code. HTTPStatusCodeKey = label.Key("http.status_code") - // HTTP reason phrase. - HTTPStatusTextKey = label.Key("http.status_text") - // Kind of HTTP protocol used. HTTPFlavorKey = label.Key("http.flavor")