1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-03 14:52:56 +02:00

Remove semantic convention for http status text (#1194)

* Remove http status text

* Updated changelog

* More descriptive changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Cole Packingham 2020-09-23 13:52:44 -05:00 committed by GitHub
parent 038f505d12
commit 5dd2962202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 8 deletions

View File

@ -52,6 +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 the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194)
### Fixed

View File

@ -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
}

View File

@ -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")

View File

@ -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")