You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-09-16 09:26:25 +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:
@@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user