diff --git a/ddtrace/opentelemetry/span.go b/ddtrace/opentelemetry/span.go index 40b8f7064b..148285dbda 100644 --- a/ddtrace/opentelemetry/span.go +++ b/ddtrace/opentelemetry/span.go @@ -213,7 +213,7 @@ func toReservedAttributes(k string, v attribute.Value) (string, interface{}) { } return ext.EventSampleRate, rate case "http.response.status_code": - return "http.status_code", v.AsString() + return "http.status_code", strconv.FormatInt(v.AsInt64(), 10) default: return k, v.AsInterface() } diff --git a/ddtrace/opentelemetry/span_test.go b/ddtrace/opentelemetry/span_test.go index e9c85c26c3..5fe258d0d9 100644 --- a/ddtrace/opentelemetry/span_test.go +++ b/ddtrace/opentelemetry/span_test.go @@ -725,7 +725,7 @@ func TestRemapWithMultipleSetAttributes(t *testing.T) { sp.SetAttributes(attribute.String("service.name", "new.service.name")) sp.SetAttributes(attribute.String("span.type", "new.span.type")) sp.SetAttributes(attribute.String("analytics.event", "true")) - sp.SetAttributes(attribute.String("http.response.status_code", "200")) + sp.SetAttributes(attribute.Int("http.response.status_code", 200)) sp.End() tracer.Flush()