Skip to content

Commit b79c5ab

Browse files
nicohrubeccodex
andauthored
fix(core): Exclude DSN from SDK configuration reports (#26677)
## What Exclude `dsn` from the experimental `sdk.config` payload and its configuration hash, even when explicitly supplied. Bump the config payload version to 3 to identify the change in reported fields. ## Why Relay already associates the report with its organization and project through ingestion metadata. Repeating the DSN adds payload bytes and splits otherwise identical configurations when the DSN key changes. Co-authored-by: Codex <codex@openai.com>
1 parent 5322b58 commit b79c5ab

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎packages/core/src/integrations/reportSdkConfig.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function serialize(value: unknown, ancestors = new Set<object>()): unknown {
9595
}
9696

9797
// Integrations are reported at the top level; serverName would split configurations by host.
98-
const EXCLUDED_OPTIONS = new Set(['integrations', 'serverName']);
98+
const EXCLUDED_OPTIONS = new Set(['dsn', 'integrations', 'serverName']);
9999

100100
function buildConfigAttributes(client: Client): Record<string, string> {
101101
const { sdk, optionsSetByUser = [] } = client.getSdkMetadata() || {};
@@ -116,7 +116,7 @@ function buildConfigAttributes(client: Client): Record<string, string> {
116116

117117
// The hash covers the whole payload, so a payload cached by its hash is never stale.
118118
const payload = JSON.stringify({
119-
version: 2,
119+
version: 3,
120120
sdk: serialize(sdk),
121121
runtime: serialize(runtime),
122122
release,

‎packages/core/test/lib/integrations/reportSdkConfig.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('experimentalReportSdkConfigIntegration', () => {
4040

4141
it('reports SDK and deployment metadata alongside user-set options', () => {
4242
const userOptions = captureOptionsSetByUser({
43+
dsn: 'https://username@domain/123',
4344
tracesSampleRate: 0.5,
4445
runtime: { name: 'node', version: 'v24.22.1' },
4546
release: 'shop@1.4.2',
@@ -52,7 +53,6 @@ describe('experimentalReportSdkConfigIntegration', () => {
5253

5354
const payload = reportConfig(
5455
getDefaultTestClientOptions({
55-
dsn: 'https://username@domain/123',
5656
sendDefaultPii: false,
5757
...userOptions,
5858
_metadata: {
@@ -63,7 +63,7 @@ describe('experimentalReportSdkConfigIntegration', () => {
6363
);
6464

6565
expect(payload).toEqual({
66-
version: 2,
66+
version: 3,
6767
sdk: { name: 'sentry.javascript.node', version: '11.14.0' },
6868
runtime: { name: 'node', version: 'v24.22.1' },
6969
release: 'shop@1.4.2',
@@ -101,7 +101,7 @@ describe('experimentalReportSdkConfigIntegration', () => {
101101
);
102102

103103
expect(payload).toEqual({
104-
version: 2,
104+
version: 3,
105105
...resolvedOptions,
106106
integrations: [{ name: 'ExperimentalReportSdkConfig' }],
107107
options: {},
@@ -145,7 +145,7 @@ describe('experimentalReportSdkConfigIntegration', () => {
145145
);
146146

147147
expect(payload).toEqual({
148-
version: 2,
148+
version: 3,
149149
integrations: [{ name: 'Kept' }, { name: 'Tag' }, { name: 'ExperimentalReportSdkConfig' }],
150150
options: {},
151151
});
@@ -161,7 +161,7 @@ describe('experimentalReportSdkConfigIntegration', () => {
161161
);
162162

163163
expect(payload).toEqual({
164-
version: 2,
164+
version: 3,
165165
integrations: [{ name: 'ExperimentalReportSdkConfig' }],
166166
options: {},
167167
});

0 commit comments

Comments
 (0)