You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +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:
@@ -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
|
- Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the
|
||||||
`go.opentelemetry.io/contrib/propagators/` module. (#1191)
|
`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
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -224,10 +224,6 @@ func HTTPAttributesFromHTTPStatusCode(code int) []label.KeyValue {
|
|||||||
attrs := []label.KeyValue{
|
attrs := []label.KeyValue{
|
||||||
HTTPStatusCodeKey.Int(code),
|
HTTPStatusCodeKey.Int(code),
|
||||||
}
|
}
|
||||||
text := http.StatusText(code)
|
|
||||||
if text != "" {
|
|
||||||
attrs = append(attrs, HTTPStatusTextKey.String(text))
|
|
||||||
}
|
|
||||||
return attrs
|
return attrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -682,7 +682,6 @@ func TestHTTPServerAttributesFromHTTPRequest(t *testing.T) {
|
|||||||
func TestHTTPAttributesFromHTTPStatusCode(t *testing.T) {
|
func TestHTTPAttributesFromHTTPStatusCode(t *testing.T) {
|
||||||
expected := []label.KeyValue{
|
expected := []label.KeyValue{
|
||||||
label.Int("http.status_code", 404),
|
label.Int("http.status_code", 404),
|
||||||
label.String("http.status_text", "Not Found"),
|
|
||||||
}
|
}
|
||||||
got := HTTPAttributesFromHTTPStatusCode(http.StatusNotFound)
|
got := HTTPAttributesFromHTTPStatusCode(http.StatusNotFound)
|
||||||
assertElementsMatch(t, expected, got, "with valid HTTP status code")
|
assertElementsMatch(t, expected, got, "with valid HTTP status code")
|
||||||
|
|||||||
@@ -94,9 +94,6 @@ const (
|
|||||||
// HTTP response status code.
|
// HTTP response status code.
|
||||||
HTTPStatusCodeKey = label.Key("http.status_code")
|
HTTPStatusCodeKey = label.Key("http.status_code")
|
||||||
|
|
||||||
// HTTP reason phrase.
|
|
||||||
HTTPStatusTextKey = label.Key("http.status_text")
|
|
||||||
|
|
||||||
// Kind of HTTP protocol used.
|
// Kind of HTTP protocol used.
|
||||||
HTTPFlavorKey = label.Key("http.flavor")
|
HTTPFlavorKey = label.Key("http.flavor")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user