Skip to content

Commit 298b3a4

Browse files
committed
Treat missing streamed-span attributes as empty in OTel backfill
1 parent cf51cd6 commit 298b3a4

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

packages/opentelemetry/src/utils/backfillStreamedSpanData.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ import { inferSpanData } from './parseSpanDescription';
2020
* on the same attributes, so re-running it here is a no-op for already-inferred fields.
2121
*/
2222
export function backfillStreamedSpanDataFromOtel(spanJSON: StreamedSpanJSON, hint?: { spanKind?: number }): void {
23-
const attributes = spanJSON.attributes;
24-
if (!attributes) {
25-
return;
26-
}
23+
const attributes = spanJSON.attributes ?? {};
2724

2825
const kind = hint?.spanKind ?? SPAN_KIND.INTERNAL;
2926
const { op, description, source, data } = inferSpanData(spanJSON.name, attributes as unknown as SpanAttributes, kind);

0 commit comments

Comments
 (0)