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:
parent
038f505d12
commit
5dd2962202
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user