Skip to content

Commit e171581

Browse files
author
Anuraag Agrawal
authored
Remove translation to HTTP status from OC status. (#2978)
1 parent 101b75e commit e171581

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

exporter/awsxrayexporter/translator/http.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/aws/aws-sdk-go/aws"
2121
"go.opentelemetry.io/collector/consumer/pdata"
2222
semconventions "go.opentelemetry.io/collector/translator/conventions"
23-
tracetranslator "go.opentelemetry.io/collector/translator/trace"
2423

2524
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
2625
)
@@ -119,11 +118,6 @@ func makeHTTP(span pdata.Span) (map[string]string, *awsxray.HTTPData) {
119118
}
120119
}
121120

122-
if info.Response.Status == nil {
123-
// TODO(anuraaga): Replace with direct translator of StatusCode without casting to int
124-
info.Response.Status = aws.Int64(int64(tracetranslator.HTTPStatusCodeFromOCStatus(int32(span.Status().Code()))))
125-
}
126-
127121
info.Response.ContentLength = aws.Int64(extractResponseSizeFromEvents(span))
128122

129123
return filtered, &info

exporter/awsxrayexporter/translator/http_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -245,25 +245,6 @@ func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) {
245245
assert.True(t, strings.Contains(jsonStr, "http://kb234.example.com:8080/users/junit"))
246246
}
247247

248-
func TestHttpStatusFromSpanStatus(t *testing.T) {
249-
attributes := make(map[string]interface{})
250-
attributes[semconventions.AttributeHTTPMethod] = "GET"
251-
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
252-
span := constructHTTPClientSpan(attributes)
253-
254-
filtered, httpData := makeHTTP(span)
255-
256-
assert.NotNil(t, httpData)
257-
assert.NotNil(t, filtered)
258-
w := testWriters.borrow()
259-
if err := w.Encode(httpData); err != nil {
260-
assert.Fail(t, "invalid json")
261-
}
262-
jsonStr := w.String()
263-
testWriters.release(w)
264-
assert.True(t, strings.Contains(jsonStr, "200"))
265-
}
266-
267248
func TestSpanWithNotEnoughHTTPRequestURLAttributes(t *testing.T) {
268249
attributes := make(map[string]interface{})
269250
attributes[semconventions.AttributeHTTPMethod] = "GET"

0 commit comments

Comments
 (0)