Skip to content

Commit fc3aaaa

Browse files
msonnbclaude
andcommitted
ref(core)!: Replace the deprecated http.target span attribute
Part of the v11 migration away from attributes `@sentry/conventions` marks deprecated. Stacked on the `http.*` renames. `http.target` carried the pathname *and* the query, while `url.path` is the pathname only. The core server span set neither `url.query` nor `url.fragment`, so dropping `http.target` would have lost the query — it now sets both, which the node server span already did. Consumers that matched on `http.target` were repointed at `url.path`: the react-router low-quality-transaction filter and the TanStack Start tunnel-route filter, both `ignoreSpans` rules against our own spans that would otherwise have silently stopped matching. The Next.js readers keep `http.target` as a fallback behind a `url.path` primary, since they also see spans from a user's own OpenTelemetry instrumentation. All other read-side fallbacks are untouched for the same reason. `no-unfiltered-url-attributes` no longer guards `http.target`: nothing sets it, and its replacement `url.path` is a bare pathname with no query to filter. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent db9b1df commit fc3aaaa

38 files changed

Lines changed: 101 additions & 139 deletions

File tree

‎dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/test-transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/test-transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
5252
'server.address': 'localhost',
5353
'http.request.method': 'GET',
5454
'url.scheme': 'http',
55-
'http.target': '/test-transaction',
5655
'user_agent.original': 'node',
5756
'client.address': '::1',
5857
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
88
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
99
return (
1010
transactionEvent.contexts?.trace?.op === 'http.server' &&
11-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
11+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}`
1212
);
1313
});
1414

1515
const outboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
1616
return (
1717
transactionEvent.contexts?.trace?.op === 'http.server' &&
18-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}`
18+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}`
1919
);
2020
});
2121

@@ -67,7 +67,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
6767
'server.address': 'localhost',
6868
'http.request.method': 'GET',
6969
'url.scheme': 'http',
70-
'http.target': `/test-outgoing-http/${id}`,
7170
'user_agent.original': expect.any(String),
7271
'client.address': '::1',
7372
'client.port': expect.any(Number),
@@ -108,7 +107,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
108107
'server.address': 'localhost',
109108
'http.request.method': 'GET',
110109
'url.scheme': 'http',
111-
'http.target': `/test-inbound-headers/${id}`,
112110
'client.address': '::1',
113111
'client.port': expect.any(Number),
114112
'network.transport': 'tcp',
@@ -141,14 +139,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
141139
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
142140
return (
143141
transactionEvent?.contexts?.trace?.op === 'http.server' &&
144-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
142+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}`
145143
);
146144
});
147145

148146
const outboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
149147
return (
150148
transactionEvent?.contexts?.trace?.op === 'http.server' &&
151-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}`
149+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}`
152150
);
153151
});
154152

@@ -200,7 +198,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
200198
'server.address': 'localhost',
201199
'http.request.method': 'GET',
202200
'url.scheme': 'http',
203-
'http.target': `/test-outgoing-fetch/${id}`,
204201
'user_agent.original': expect.any(String),
205202
'client.address': '::1',
206203
'client.port': expect.any(Number),
@@ -241,7 +238,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
241238
'server.address': 'localhost',
242239
'http.request.method': 'GET',
243240
'url.scheme': 'http',
244-
'http.target': `/test-inbound-headers/${id}`,
245241
'client.address': '::1',
246242
'client.port': expect.any(Number),
247243
'network.transport': 'tcp',
@@ -268,7 +264,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL })
268264
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
269265
return (
270266
transactionEvent?.contexts?.trace?.op === 'http.server' &&
271-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed`
267+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed`
272268
);
273269
});
274270

@@ -305,7 +301,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT
305301
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
306302
return (
307303
transactionEvent?.contexts?.trace?.op === 'http.server' &&
308-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed`
304+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed`
309305
);
310306
});
311307

@@ -329,7 +325,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL }
329325
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
330326
return (
331327
transactionEvent?.contexts?.trace?.op === 'http.server' &&
332-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed`
328+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed`
333329
);
334330
});
335331

@@ -366,7 +362,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation
366362
const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => {
367363
return (
368364
transactionEvent?.contexts?.trace?.op === 'http.server' &&
369-
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed`
365+
transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed`
370366
);
371367
});
372368

‎dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => {
3030
'server.address': 'localhost',
3131
'http.request.method': 'GET',
3232
'url.scheme': 'http',
33-
'http.target': '/test-transaction',
3433
'user_agent.original': 'node',
3534
'client.address': '::1',
3635
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction from module', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/example-module/transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction from module', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/example-module/transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('Should record a transaction for a parameterless route', async ({ request }
2323

2424
test('Should record a transaction for route with parameters', async ({ request }) => {
2525
const transactionEventPromise = waitForTransaction('node-express-esm-loader', transactionEvent => {
26-
return transactionEvent.contexts?.trace?.data?.['http.target'] === '/test-transaction/1';
26+
return transactionEvent.contexts?.trace?.data?.['url.path'] === '/test-transaction/1';
2727
});
2828

2929
await request.get('/test-transaction/1');
@@ -39,7 +39,6 @@ test('Should record a transaction for route with parameters', async ({ request }
3939
'http.route': '/test-transaction/:param',
4040
'url.scheme': 'http',
4141
'http.response.status_text': 'OK',
42-
'http.target': '/test-transaction/1',
4342
'url.full': 'http://localhost:3030/test-transaction/1',
4443
'user_agent.original': expect.any(String),
4544
'network.local.address': expect.any(String),

‎dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/test-transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

‎dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
2626
'server.address': 'localhost',
2727
'http.request.method': 'GET',
2828
'url.scheme': 'http',
29-
'http.target': '/test-transaction',
3029
'user_agent.original': 'node',
3130
'client.address': '::1',
3231
'client.port': expect.any(Number),

0 commit comments

Comments
 (0)