Skip to content

Commit 9d7dfd5

Browse files
committed
only send integrations
1 parent 0609305 commit 9d7dfd5

3 files changed

Lines changed: 4 additions & 27 deletions

File tree

packages/core/src/semanticAttributes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ export const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = 'sentry.sdk.name';
5454
export const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = 'sentry.sdk.version';
5555
/** The list of integrations enabled in the Sentry SDK (e.g., ["InboundFilters", "BrowserTracing"]) */
5656
export const SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS = 'sentry.sdk.integrations';
57-
/** The list of SDK packages loaded by the application (e.g., ["npm:@sentry/browser@9.0.0"]) */
58-
export const SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES = 'sentry.sdk.packages';
5957

6058
/** The user ID (gated by sendDefaultPii) */
6159
export const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id';

packages/core/src/tracing/spans/captureSpan.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,
77
SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS,
88
SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,
9-
SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES,
109
SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,
1110
SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,
1211
SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,
@@ -95,13 +94,10 @@ function applyScopeToSegmentSpan(_segmentSpanJSON: StreamedSpanJSON, _scopeData:
9594

9695
function applySdkMetadataToSegmentSpan(segmentSpanJSON: StreamedSpanJSON, client: Client): void {
9796
const integrationNames = client.getOptions().integrations.map(i => i.name);
98-
const packages = client.getSdkMetadata()?.sdk?.packages?.map(p => `${p.name}@${p.version}`);
97+
if (!integrationNames.length) return;
9998

10099
safeSetSpanJSONAttributes(segmentSpanJSON, {
101-
[SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS]: integrationNames.length
102-
? JSON.stringify(integrationNames)
103-
: undefined,
104-
[SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES]: packages?.length ? JSON.stringify(packages) : undefined,
100+
[SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS]: JSON.stringify(integrationNames),
105101
});
106102
}
107103

packages/core/test/lib/tracing/spans/captureSpan.test.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
1010
SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS,
1111
SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,
12-
SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES,
1312
SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,
1413
SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,
1514
SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,
@@ -293,7 +292,7 @@ describe('captureSpan', () => {
293292
});
294293
});
295294

296-
it('adds sentry.sdk.integrations and sentry.sdk.packages to segment spans as JSON-stringified strings', () => {
295+
it('adds sentry.sdk.integrations to segment spans as a JSON-stringified string', () => {
297296
const client = new TestClient(
298297
getDefaultTestClientOptions({
299298
dsn: 'https://dsn@ingest.f00.f00/1',
@@ -308,10 +307,6 @@ describe('captureSpan', () => {
308307
sdk: {
309308
name: 'sentry.javascript.browser',
310309
version: '9.0.0',
311-
packages: [
312-
{ name: 'npm:@sentry/browser', version: '9.0.0' },
313-
{ name: 'npm:@sentry/core', version: '9.0.0' },
314-
],
315310
},
316311
},
317312
}),
@@ -350,28 +345,17 @@ describe('captureSpan', () => {
350345
type: 'string',
351346
value: '["InboundFilters","BrowserTracing"]',
352347
},
353-
[SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES]: {
354-
type: 'string',
355-
value: '["npm:@sentry/browser@9.0.0","npm:@sentry/core@9.0.0"]',
356-
},
357348
},
358349
_segmentSpan: span,
359350
});
360351
});
361352

362-
it('does not add sentry.sdk.integrations or sentry.sdk.packages to non-segment child spans', () => {
353+
it('does not add sentry.sdk.integrations to non-segment child spans', () => {
363354
const client = new TestClient(
364355
getDefaultTestClientOptions({
365356
dsn: 'https://dsn@ingest.f00.f00/1',
366357
tracesSampleRate: 1,
367358
integrations: [{ name: 'InboundFilters', setupOnce: () => {} }],
368-
_metadata: {
369-
sdk: {
370-
name: 'sentry.javascript.browser',
371-
version: '9.0.0',
372-
packages: [{ name: 'npm:@sentry/browser', version: '9.0.0' }],
373-
},
374-
},
375359
}),
376360
);
377361

@@ -386,7 +370,6 @@ describe('captureSpan', () => {
386370

387371
expect(serializedChild.is_segment).toBe(false);
388372
expect(serializedChild.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS]).toBeUndefined();
389-
expect(serializedChild.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SDK_PACKAGES]).toBeUndefined();
390373
});
391374

392375
describe('client hooks', () => {

0 commit comments

Comments
 (0)