Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
span_id: expect.any(String),
status: 'ok',
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
trace_id: traceId,
origin: 'auto.http.otel.http',
Expand All @@ -91,7 +91,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
span_id: expect.any(String),
status: 'ok',
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
trace_id: traceId,
origin: 'auto.http.otel.http',
Expand Down Expand Up @@ -161,7 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
span_id: expect.any(String),
status: 'ok',
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
trace_id: traceId,
origin: 'auto.http.otel.http',
Expand All @@ -184,7 +184,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
span_id: expect.any(String),
status: 'ok',
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
trace_id: traceId,
origin: 'auto.http.otel.http',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
span_id: expect.any(String),
status: 'ok',
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
trace_id: expect.any(String),
origin: 'auto.http.otel.http',
Expand Down Expand Up @@ -85,7 +85,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
},
],
tags: {
'http.status_code': 200,
'http.status_code': '200',
},
transaction: 'GET /test-transaction',
type: 'transaction',
Expand Down
5 changes: 2 additions & 3 deletions packages/opentelemetry/src/spanExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ function getTags(span: ReadableSpan): Record<string, string> {
const tags: Record<string, string> = {};

if (attributes[SemanticAttributes.HTTP_STATUS_CODE]) {
const statusCode = attributes[SemanticAttributes.HTTP_STATUS_CODE] as string;

tags['http.status_code'] = statusCode;
const statusCode = attributes[SemanticAttributes.HTTP_STATUS_CODE] as string | number;
tags['http.status_code'] = `${statusCode}`;
}

return tags;
Expand Down