Skip to content

ref: Stop using dropUndefinedKeys in SpanExporter #15794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025
Merged
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
9 changes: 4 additions & 5 deletions packages/opentelemetry/src/spanExporter.ts
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ import {
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
captureEvent,
dropUndefinedKeys,
getCapturedScopesOnSpan,
getDynamicSamplingContextFromSpan,
getStatusMessage,
@@ -274,7 +273,7 @@ export function createTransactionForOtelSpan(span: ReadableSpan): TransactionEve
const statusCode = attributes[ATTR_HTTP_RESPONSE_STATUS_CODE];
const responseContext = typeof statusCode === 'number' ? { response: { status_code: statusCode } } : undefined;

const transactionEvent: TransactionEvent = dropUndefinedKeys({
const transactionEvent: TransactionEvent = {
contexts: {
trace: traceContext,
otel: {
@@ -298,7 +297,7 @@ export function createTransactionForOtelSpan(span: ReadableSpan): TransactionEve
source,
},
}),
});
};

return transactionEvent;
}
@@ -335,7 +334,7 @@ function createAndFinishSpanForOtelSpan(node: SpanNode, spans: SpanJSON[], sentS

const status = mapStatus(span);

const spanJSON: SpanJSON = dropUndefinedKeys({
const spanJSON: SpanJSON = {
span_id,
trace_id,
data: allData,
@@ -349,7 +348,7 @@ function createAndFinishSpanForOtelSpan(node: SpanNode, spans: SpanJSON[], sentS
origin,
measurements: timedEventsToMeasurements(span.events),
links: convertSpanLinksForEnvelope(links),
});
};

spans.push(spanJSON);