From e44b025cf038253e6a3b7878ce9f2d4c839d6b70 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 8 Jul 2026 17:27:07 +0200 Subject: [PATCH 1/3] fix(opentelemetry): Fall back to `'sentry.origin': manual` when backfilling OTel data --- .../opentelemetry/src/utils/backfillStreamedSpanData.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/opentelemetry/src/utils/backfillStreamedSpanData.ts b/packages/opentelemetry/src/utils/backfillStreamedSpanData.ts index 298aadcff5da..dc215d95e7db 100644 --- a/packages/opentelemetry/src/utils/backfillStreamedSpanData.ts +++ b/packages/opentelemetry/src/utils/backfillStreamedSpanData.ts @@ -7,6 +7,7 @@ import { spanKindToName, } from '@sentry/core'; import { inferSpanData } from './parseSpanDescription'; +import { SENTRY_ORIGIN } from '@sentry/conventions/attributes'; /** * Backfill op, source, name and data on a streamed span JSON from OTel semantic conventions. @@ -30,6 +31,11 @@ export function backfillStreamedSpanDataFromOtel(spanJSON: StreamedSpanJSON, hin safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, + // If nothing in the chain previously set an origin, we now default it to 'manual' + // For transactions, this is done in the SpanExporter. + // TODO (v11): Remove this again once we fully moved away from OTel's TracerProvider. + // at this point, we use `SentrySpan` everywhere, which defaults its origin to 'manual'. + [SENTRY_ORIGIN]: 'manual', ...data, }); From c46e81155d7f607e74c58bbb5a81669fc515beed Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 9 Jul 2026 08:10:09 +0200 Subject: [PATCH 2/3] fix node-core integration test --- .../suites/public-api/startSpan/basic-usage-streamed/test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts index 6e4de612fa8e..19bad9d611ad 100644 --- a/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts +++ b/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts @@ -13,6 +13,7 @@ import { SENTRY_SDK_NAME, SENTRY_SDK_VERSION, SENTRY_TRACE_LIFECYCLE, + SENTRY_ORIGIN, } from '@sentry/conventions/attributes'; import { expect, test } from 'vitest'; import { createRunner } from '../../../../utils/runner'; @@ -65,6 +66,7 @@ test('sends a streamed span envelope with correct spans for a manually started s [SENTRY_SDK_VERSION]: { type: 'string', value: SDK_VERSION }, [SENTRY_SEGMENT_ID]: { type: 'string', value: segmentSpanId }, [SENTRY_SEGMENT_NAME]: { type: 'string', value: 'test-span' }, + [SENTRY_ORIGIN]: { type: 'string', value: 'manual' }, [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: { type: 'string', value: '1.0.0' }, [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: { type: 'string', value: 'production' }, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: { type: 'string', value: 'custom' }, From 7678d2d8135545a6cf24dd93bcb1e429151f2f79 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 9 Jul 2026 09:34:55 +0200 Subject: [PATCH 3/3] fix test for real --- .../suites/public-api/startSpan/basic-usage-streamed/test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts index 19bad9d611ad..b3e84ce4fed3 100644 --- a/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts +++ b/dev-packages/node-core-integration-tests/suites/public-api/startSpan/basic-usage-streamed/test.ts @@ -91,6 +91,7 @@ test('sends a streamed span envelope with correct spans for a manually started s [SENTRY_SDK_VERSION]: { type: 'string', value: SDK_VERSION }, [SENTRY_SEGMENT_ID]: { type: 'string', value: segmentSpanId }, [SENTRY_SEGMENT_NAME]: { type: 'string', value: 'test-span' }, + [SENTRY_ORIGIN]: { type: 'string', value: 'manual' }, [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: { type: 'string', value: '1.0.0' }, [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: { type: 'string', value: 'production' }, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: { type: 'string', value: 'custom' }, @@ -128,6 +129,7 @@ test('sends a streamed span envelope with correct spans for a manually started s [SENTRY_SDK_VERSION]: { type: 'string', value: SDK_VERSION }, [SENTRY_SEGMENT_ID]: { type: 'string', value: segmentSpanId }, [SENTRY_SEGMENT_NAME]: { type: 'string', value: 'test-span' }, + [SENTRY_ORIGIN]: { type: 'string', value: 'manual' }, [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: { type: 'string', value: '1.0.0' }, [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: { type: 'string', value: 'production' }, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: { type: 'string', value: 'custom' }, @@ -145,6 +147,7 @@ test('sends a streamed span envelope with correct spans for a manually started s const expectedAttributes: Record = { [SENTRY_TRACE_LIFECYCLE]: { type: 'string', value: 'stream' }, + [SENTRY_ORIGIN]: { type: 'string', value: 'manual' }, [SEMANTIC_ATTRIBUTE_SENTRY_OP]: { type: 'string', value: 'test' }, [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: { type: 'integer', value: 1 }, [SENTRY_SDK_NAME]: { type: 'string', value: 'sentry.javascript.node-core' },