Skip to content

Commit

Permalink
fix(node-experimental): Ensure http.status_code is always a string
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jan 15, 2024
1 parent f17bc54 commit 771d681
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 771d681

Please sign in to comment.