Skip to content

Commit 771d681

Browse files
committed
fix(node-experimental): Ensure http.status_code is always a string
1 parent f17bc54 commit 771d681

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/opentelemetry/src/spanExporter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,8 @@ function getTags(span: ReadableSpan): Record<string, string> {
280280
const tags: Record<string, string> = {};
281281

282282
if (attributes[SemanticAttributes.HTTP_STATUS_CODE]) {
283-
const statusCode = attributes[SemanticAttributes.HTTP_STATUS_CODE] as string;
284-
285-
tags['http.status_code'] = statusCode;
283+
const statusCode = attributes[SemanticAttributes.HTTP_STATUS_CODE] as string | number;
284+
tags['http.status_code'] = `${statusCode}`;
286285
}
287286

288287
return tags;

0 commit comments

Comments
 (0)