From 852a2cfef1e7a4dd79fbf3b51e3e357307ae67ae Mon Sep 17 00:00:00 2001 From: Martin Sonnberger Date: Tue, 25 Aug 2026 14:24:43 +0200 Subject: [PATCH 1/3] ref(core)!: Rename deprecated `http.*` span attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of the v11 migration away from attributes `@sentry/conventions` marks deprecated. This PR covers the renames on HTTP spans, all of them 1:1 with no behavior change. `http.target` and the Node body size behavior change follow in stacked PRs; the `net.*` attributes are migrated separately in #23301. `http.method` -> `http.request.method`, `http.status_code` -> `http.response.status_code`, `http.status_text` -> `http.response.status_text`, `http.scheme` -> `url.scheme`, `http.user_agent` -> `user_agent.original`, `http.request_content_length` -> `http.request.body.size`, `http.request_content_length_uncompressed` -> `http.request.body.decoded_size`, `http.response_content_length` -> `http.response.body.size`, `http.response_content_length_uncompressed` and `http.decoded_response_content_length` -> `http.response.body.decoded_size`, `http.response_transfer_size` -> `http.response.size`, and `url.same_origin` -> `http.request.same_origin`. The last two legacy response body size names meant the same thing — the decoded response body size. Node HTTP spans used `http.response_content_length_uncompressed`, browser resource spans used `http.decoded_response_content_length`. Which of the encoded and decoded attribute an HTTP span sets is unchanged here: the code still branches on whether a `content-encoding` header is present. That branching is what the stacked body size PR addresses. `http.host`, `http.flavor` and `http.client_ip` are dropped without a replacement being set here. Their replacements — `server.address`, `network.protocol.version` and `client.address` — are introduced by #23301, so setting them here too would mean two PRs writing the same keys with different values. `SanitizedRequestData`, the shape backing `http` breadcrumb data, now keys the method as `http.request.method`. Span attributes in the touched files are now imported from `@sentry/conventions/attributes` rather than written as string literals. That is what surfaced `url.same_origin` as deprecated; as a literal it was invisible. Co-Authored-By: Claude Opus 5 (1M context) --- docs/migration/v11-end-state.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/migration/v11-end-state.md b/docs/migration/v11-end-state.md index c0de5f29a3f8..f2749ab6cbe1 100644 --- a/docs/migration/v11-end-state.md +++ b/docs/migration/v11-end-state.md @@ -633,6 +633,7 @@ Legacy HTTP span attributes were replaced by their current semantic-convention e | `http.response_content_length` | `http.response.body.size` | | `http.decoded_response_content_length` | `http.response.body.decoded_size` | | `http.response_transfer_size` | `http.response.size` | +| `http.target` | `url.path` + `url.query` | | `url.same_origin` | `http.request.same_origin` | `SanitizedRequestData` — the shape used for `http` breadcrumb data and `http.client` span data — now uses `http.request.method` instead of `http.method` as a key for the request method. From db9b1dfd7a69675274eb149ae4260bb2237f9c94 Mon Sep 17 00:00:00 2001 From: Martin Sonnberger Date: Tue, 25 Aug 2026 14:24:43 +0200 Subject: [PATCH 2/3] ref(core)!: Rename deprecated `http.*` span attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of the v11 migration away from attributes `@sentry/conventions` marks deprecated. This PR covers the renames on HTTP spans, all of them 1:1 with no behavior change. `http.target` and the Node body size behavior change follow in stacked PRs; the `net.*` attributes are migrated separately in #23301. `http.method` -> `http.request.method`, `http.status_code` -> `http.response.status_code`, `http.status_text` -> `http.response.status_text`, `http.scheme` -> `url.scheme`, `http.user_agent` -> `user_agent.original`, `http.request_content_length` -> `http.request.body.size`, `http.request_content_length_uncompressed` -> `http.request.body.decoded_size`, `http.response_content_length` -> `http.response.body.size`, `http.response_content_length_uncompressed` and `http.decoded_response_content_length` -> `http.response.body.decoded_size`, `http.response_transfer_size` -> `http.response.size`, and `url.same_origin` -> `http.request.same_origin`. The last two legacy response body size names meant the same thing — the decoded response body size. Node HTTP spans used `http.response_content_length_uncompressed`, browser resource spans used `http.decoded_response_content_length`. Which of the encoded and decoded attribute an HTTP span sets is unchanged here: the code still branches on whether a `content-encoding` header is present. That branching is what the stacked body size PR addresses. `http.host`, `http.flavor` and `http.client_ip` are dropped without a replacement being set here. Their replacements — `server.address`, `network.protocol.version` and `client.address` — are introduced by #23301, so setting them here too would mean two PRs writing the same keys with different values. `SanitizedRequestData`, the shape backing `http` breadcrumb data, now keys the method as `http.request.method`. Span attributes in the touched files are now imported from `@sentry/conventions/attributes` rather than written as string literals. That is what surfaced `url.same_origin` as deprecated; as a literal it was invisible. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/src/integrations/http/server-subscription.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/integrations/http/server-subscription.ts b/packages/core/src/integrations/http/server-subscription.ts index 8d22c81b25f5..9a8b75c6ab68 100644 --- a/packages/core/src/integrations/http/server-subscription.ts +++ b/packages/core/src/integrations/http/server-subscription.ts @@ -293,8 +293,8 @@ function buildServerSpanWrap( const name = `${method} ${httpTargetWithoutQueryFragment}`; const headers = request.headers; const userAgent = headers['user-agent']; - const ips = headers['x-forwarded-for']; const httpVersion = request.httpVersion; + const ips = headers['x-forwarded-for']; const host = headers.host as undefined | string; const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, '$1') || 'localhost'; const scheme = fullUrl.startsWith('https') ? 'https' : 'http'; From fc3aaaa0e8dcfcd9784f403ff2b8efc1bcf9125e Mon Sep 17 00:00:00 2001 From: Martin Sonnberger Date: Tue, 25 Aug 2026 15:05:15 +0200 Subject: [PATCH 3/3] ref(core)!: Replace the deprecated `http.target` span attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../nestjs-11/tests/transactions.test.ts | 1 - .../nestjs-8/tests/transactions.test.ts | 1 - .../nestjs-basic/tests/transactions.test.ts | 1 - .../tests/propagation.test.ts | 20 ++++++++----------- .../nestjs-fastify/tests/transactions.test.ts | 1 - .../tests/transactions.test.ts | 1 - .../tests/transactions.test.ts | 1 - .../tests/server.test.ts | 3 +-- .../tests/transactions.test.ts | 1 - .../node-express/tests/transactions.test.ts | 1 - .../node-fastify-3/tests/propagation.test.ts | 20 ++++++++----------- .../node-fastify-3/tests/transactions.test.ts | 1 - .../node-fastify-4/tests/propagation.test.ts | 20 ++++++++----------- .../node-fastify-4/tests/transactions.test.ts | 1 - .../node-fastify-5/tests/propagation.test.ts | 20 ++++++++----------- .../node-fastify-5/tests/transactions.test.ts | 1 - .../node-hapi/tests/transactions.test.ts | 5 ++--- .../node-koa/tests/propagation.test.ts | 20 ++++++++----------- .../node-koa/tests/transactions.test.ts | 1 - .../low-quality-filter.server.test.ts | 4 ++-- .../low-quality-filter.server.test.ts | 4 ++-- .../tsx-express/tests/transactions.test.ts | 1 - .../suites/express/tracing/test.ts | 4 ++-- .../http-strip-query/test.ts | 1 - .../suites/tracing/httpIntegration/test.ts | 2 -- .../http/get-outgoing-span-data.ts | 5 ++--- .../integrations/http/server-subscription.ts | 16 +++++++-------- .../http/get-outgoing-span-data.test.ts | 13 ++++-------- .../http/server-subscription.test.ts | 11 +++++----- .../src/rules/no-unfiltered-url-attributes.js | 4 +++- .../utils/dropMiddlewareTunnelRequests.ts | 10 ++++++---- .../common/utils/setUrlProcessingMetadata.ts | 8 ++++++-- .../server/enhanceHandleRequestRootSpan.ts | 5 ++++- .../http/httpServerSpansIntegration.ts | 6 ------ ...lowQualityTransactionsFilterIntegration.ts | 5 +++-- ...alityTransactionsFilterIntegration.test.ts | 6 +++--- .../src/server/tunnelRoute.ts | 5 +++-- .../test/server/tunnelRoute.test.ts | 10 +++++----- 38 files changed, 101 insertions(+), 139 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts index 5e5eb00835d3..b4baeaec78cf 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts index 131167ac73fe..bc877b06d278 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts index 6f87724ac2fd..c7e781d9d80f 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts @@ -52,7 +52,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts index 048deb6e69fa..34eabe32d817 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts @@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}` ); }); @@ -67,7 +67,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-http/${id}`, 'user_agent.original': expect.any(String), 'client.address': '::1', 'client.port': expect.any(Number), @@ -108,7 +107,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -141,14 +139,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}` ); }); @@ -200,7 +198,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-fetch/${id}`, 'user_agent.original': expect.any(String), 'client.address': '::1', 'client.port': expect.any(Number), @@ -241,7 +238,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -268,7 +264,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL }) const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed` ); }); @@ -305,7 +301,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed` ); }); @@ -329,7 +325,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL } const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed` ); }); @@ -366,7 +362,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation const inboundTransactionPromise = waitForTransaction('nestjs-distributed-tracing', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed` ); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts index e1f1d59ddd86..da0c75b2d5fb 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts @@ -30,7 +30,6 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts index caee3c36d8a7..c3a9488127b0 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/example-module/transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts index 7ad464eb80c1..a14df196c572 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/example-module/transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts index f53224c73b15..81f01e81cf77 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts @@ -23,7 +23,7 @@ test('Should record a transaction for a parameterless route', async ({ request } test('Should record a transaction for route with parameters', async ({ request }) => { const transactionEventPromise = waitForTransaction('node-express-esm-loader', transactionEvent => { - return transactionEvent.contexts?.trace?.data?.['http.target'] === '/test-transaction/1'; + return transactionEvent.contexts?.trace?.data?.['url.path'] === '/test-transaction/1'; }); await request.get('/test-transaction/1'); @@ -39,7 +39,6 @@ test('Should record a transaction for route with parameters', async ({ request } 'http.route': '/test-transaction/:param', 'url.scheme': 'http', 'http.response.status_text': 'OK', - 'http.target': '/test-transaction/1', 'url.full': 'http://localhost:3030/test-transaction/1', 'user_agent.original': expect.any(String), 'network.local.address': expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts index 770c46af5ab1..99d212432614 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts index 5ffbf7ab9de7..8c427018e99a 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/propagation.test.ts index fc5b0e84d1c8..e3742504fb03 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/propagation.test.ts @@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}` ); }); @@ -67,7 +67,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-http/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -108,7 +107,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -141,14 +139,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}` ); }); @@ -200,7 +198,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-fetch/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -241,7 +238,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -278,7 +274,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL }) const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed` ); }); @@ -315,7 +311,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed` ); }); @@ -339,7 +335,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL } const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed` ); }); @@ -376,7 +372,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation const inboundTransactionPromise = waitForTransaction('node-fastify-3', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed` ); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts index 568aa0c76163..e1f4fc1c73d9 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts @@ -31,7 +31,6 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/propagation.test.ts index 46e2201f261b..481549e66952 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/propagation.test.ts @@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}` ); }); @@ -67,7 +67,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-http/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -108,7 +107,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -141,14 +139,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}` ); }); @@ -200,7 +198,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-fetch/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -241,7 +238,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -278,7 +274,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL }) const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed` ); }); @@ -315,7 +311,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed` ); }); @@ -339,7 +335,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL } const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed` ); }); @@ -376,7 +372,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation const inboundTransactionPromise = waitForTransaction('node-fastify-4', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed` ); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts index 6efddcb5e5ee..7fe0bf2c4a5b 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts index 162d87d84bd0..70e16b2cdd60 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts @@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}` ); }); @@ -67,7 +67,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-http/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -108,7 +107,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -141,14 +139,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}` ); }); @@ -200,7 +198,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-fetch/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -241,7 +238,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -278,7 +274,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL }) const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed` ); }); @@ -315,7 +311,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed` ); }); @@ -339,7 +335,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL } const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed` ); }); @@ -376,7 +372,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation const inboundTransactionPromise = waitForTransaction('node-fastify-5', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed` ); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts index 67efe576ac73..8bed705fe905 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts index 2f88c811d5bc..25bffcb0c280 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts @@ -25,7 +25,6 @@ test('Sends successful transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-success', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -131,13 +130,13 @@ test('Isolates requests', async ({ baseURL }) => { const transaction1Promise = waitForTransaction('node-hapi', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent?.contexts?.trace?.data?.['http.target'] === '/test-param/888' + transactionEvent?.contexts?.trace?.data?.['url.path'] === '/test-param/888' ); }); const transaction2Promise = waitForTransaction('node-hapi', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent?.contexts?.trace?.data?.['http.target'] === '/test-param/999' + transactionEvent?.contexts?.trace?.data?.['url.path'] === '/test-param/999' ); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts index f235f3d6f345..e084391353ca 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts @@ -8,14 +8,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http/${id}` ); }); @@ -66,7 +66,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-http/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -107,7 +106,6 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -140,14 +138,14 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-inbound-headers/${id}` ); }); const outboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch/${id}` ); }); @@ -199,7 +197,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-outgoing-fetch/${id}`, 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -240,7 +237,6 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': `/test-inbound-headers/${id}`, 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -277,7 +273,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL }) const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-allowed` ); }); @@ -314,7 +310,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-http-external-disallowed` ); }); @@ -338,7 +334,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL } const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-allowed` ); }); @@ -375,7 +371,7 @@ test('Does not propagate outgoing fetch requests not covered by tracePropagation const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => { return ( transactionEvent?.contexts?.trace?.op === 'http.server' && - transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed` + transactionEvent.contexts?.trace?.data?.['url.path'] === `/test-outgoing-fetch-external-disallowed` ); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts index effa19866995..c511424106c2 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/low-quality-filter.server.test.ts b/dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/low-quality-filter.server.test.ts index 0e5351a5704f..0664ac5c99e1 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/low-quality-filter.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/low-quality-filter.server.test.ts @@ -27,8 +27,8 @@ test.describe('low-quality transaction filter', () => { await page.evaluate(() => fetch('/__sentry-flush')); const targetIsManifest = (t: (typeof serverTxns)[number]) => - typeof t.contexts?.trace?.data?.['http.target'] === 'string' && - (t.contexts.trace.data['http.target'] as string).includes('/__manifest'); + typeof t.contexts?.trace?.data?.['url.path'] === 'string' && + (t.contexts.trace.data['url.path'] as string).includes('/__manifest'); expect(serverTxns.some(targetIsManifest)).toBe(false); }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-router-8-framework/tests/performance/low-quality-filter.server.test.ts b/dev-packages/e2e-tests/test-applications/react-router-8-framework/tests/performance/low-quality-filter.server.test.ts index 0e5351a5704f..0664ac5c99e1 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-8-framework/tests/performance/low-quality-filter.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-8-framework/tests/performance/low-quality-filter.server.test.ts @@ -27,8 +27,8 @@ test.describe('low-quality transaction filter', () => { await page.evaluate(() => fetch('/__sentry-flush')); const targetIsManifest = (t: (typeof serverTxns)[number]) => - typeof t.contexts?.trace?.data?.['http.target'] === 'string' && - (t.contexts.trace.data['http.target'] as string).includes('/__manifest'); + typeof t.contexts?.trace?.data?.['url.path'] === 'string' && + (t.contexts.trace.data['url.path'] as string).includes('/__manifest'); expect(serverTxns.some(targetIsManifest)).toBe(false); }); }); diff --git a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts index 573827f679f2..3854337c3b9c 100644 --- a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts @@ -26,7 +26,6 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'server.address': 'localhost', 'http.request.method': 'GET', 'url.scheme': 'http', - 'http.target': '/test-transaction', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/dev-packages/node-integration-tests/suites/express/tracing/test.ts b/dev-packages/node-integration-tests/suites/express/tracing/test.ts index b8695f245aca..765a88c8dcea 100644 --- a/dev-packages/node-integration-tests/suites/express/tracing/test.ts +++ b/dev-packages/node-integration-tests/suites/express/tracing/test.ts @@ -138,7 +138,7 @@ describe('express tracing', () => { 'http.request.method': 'GET', 'url.full': expect.stringMatching(/\/$/), 'http.route': '/', - 'http.target': '/', + 'url.path': '/', }, op: 'http.server', status: 'ok', @@ -397,7 +397,7 @@ describe('express tracing', () => { 'http.response.status_code': status_code, 'http.request.method': 'GET', 'url.full': expect.stringMatching(url), - 'http.target': url, + 'url.path': url, }, op: 'http.server', status, diff --git a/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts b/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts index 42888fca422b..6a12c77eb768 100644 --- a/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts @@ -27,7 +27,6 @@ describe('outgoing http spans - strip query', () => { expect(txn.spans?.[0]).toMatchObject({ data: { 'url.full': `${SERVER_URL}/api/v0/users?id=1`, - 'http.target': '/api/v0/users?id=1', 'http.request.method': 'GET', 'url.query': 'id=1', 'http.response.status_code': 200, diff --git a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts index c6b2207e66d8..a49aec9f49c0 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -98,7 +98,6 @@ describe('httpIntegration', () => { 'http.route': '/test', 'url.scheme': 'http', 'http.response.status_text': 'OK', - 'http.target': '/test?a=1&b=2', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), @@ -142,7 +141,6 @@ describe('httpIntegration', () => { 'http.route': '/test', 'url.scheme': 'http', 'http.response.status_text': 'OK', - 'http.target': '/test?a=1&b=2', 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), diff --git a/packages/core/src/integrations/http/get-outgoing-span-data.ts b/packages/core/src/integrations/http/get-outgoing-span-data.ts index 4be06fb6a161..3c5454b8da73 100644 --- a/packages/core/src/integrations/http/get-outgoing-span-data.ts +++ b/packages/core/src/integrations/http/get-outgoing-span-data.ts @@ -8,7 +8,6 @@ import type { StartSpanOptions } from '../../types/startSpanOptions'; import { HTTP_RESPONSE_BODY_SIZE, HTTP_RESPONSE_STATUS_CODE, - HTTP_TARGET, NETWORK_LOCAL_ADDRESS, NETWORK_LOCAL_PORT, NETWORK_PEER_ADDRESS, @@ -44,8 +43,8 @@ export function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpa [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', [SENTRY_KIND]: 'client', [URL_FULL]: filterCollectedUrl(url), - // eslint-disable-next-line typescript/no-deprecated - [HTTP_TARGET]: filterCollectedUrl(request.path || '/'), + // The old `http.target` (path plus query) has no separate replacement here: `url.path`, + // `url.query` and `http.request.method` all come from `attributes` below. [SERVER_ADDRESS]: request.host, [SERVER_PORT]: typeof request.port === 'number' && !isNaN(request.port) ? request.port : undefined, [USER_AGENT_ORIGINAL]: userAgent || undefined, diff --git a/packages/core/src/integrations/http/server-subscription.ts b/packages/core/src/integrations/http/server-subscription.ts index 9a8b75c6ab68..70e733fe6709 100644 --- a/packages/core/src/integrations/http/server-subscription.ts +++ b/packages/core/src/integrations/http/server-subscription.ts @@ -27,7 +27,7 @@ import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } fro import { hasSpansEnabled } from '../../utils/hasSpansEnabled'; import { headersToDict, httpHeadersToSpanAttributes, httpRequestToRequestData } from '../../utils/request'; import { patchRequestToCaptureBody } from './patch-request-to-capture-body'; -import { parseStringToURLObject, stripUrlQueryAndFragment } from '../../utils/url'; +import { getUrlFragment, getUrlQuery, parseStringToURLObject, stripUrlQueryAndFragment } from '../../utils/url'; import { recordRequestSession } from './record-request-session'; import { generateSpanId, generateTraceId } from '../../utils/propagationContext'; import { continueTrace, startSpanManual } from '../../tracing/trace'; @@ -53,13 +53,14 @@ import { SERVER_ADDRESS, SERVER_PORT, SENTRY_SEGMENT_NAME_SOURCE, - HTTP_TARGET, + URL_FRAGMENT, URL_FULL, URL_PATH, + URL_QUERY, URL_SCHEME, USER_AGENT_ORIGINAL, } from '@sentry/conventions/attributes'; -import { filterCollectedUrl } from '../../utils/data-collection/filterCollectedUrl'; +import { filterCollectedUrl, filterCollectedUrlQuery } from '../../utils/data-collection/filterCollectedUrl'; // Tree-shakable guard to remove all code related to tracing declare const __SENTRY_TRACING__: boolean; @@ -293,8 +294,8 @@ function buildServerSpanWrap( const name = `${method} ${httpTargetWithoutQueryFragment}`; const headers = request.headers; const userAgent = headers['user-agent']; - const httpVersion = request.httpVersion; const ips = headers['x-forwarded-for']; + const httpVersion = request.httpVersion; const host = headers.host as undefined | string; const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, '$1') || 'localhost'; const scheme = fullUrl.startsWith('https') ? 'https' : 'http'; @@ -326,11 +327,8 @@ function buildServerSpanWrap( [SENTRY_HTTP_PREFETCH]: isKnownPrefetchRequest(request) || undefined, [URL_FULL]: filterCollectedUrl(fullUrl, client), [URL_PATH]: urlObj?.pathname ?? httpTargetWithoutQueryFragment, - // eslint-disable-next-line typescript/no-deprecated - [HTTP_TARGET]: filterCollectedUrl( - urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, - client, - ), + [URL_QUERY]: filterCollectedUrlQuery(getUrlQuery(urlObj?.search), client), + [URL_FRAGMENT]: getUrlFragment(urlObj?.hash), [HTTP_REQUEST_METHOD]: method, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, diff --git a/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts b/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts index 3ac6aae33141..38e06f6c8172 100644 --- a/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts +++ b/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts @@ -7,7 +7,6 @@ import type { HttpClientRequest, HttpIncomingMessage } from '../../../../src/int import type { Span } from '../../../../src/types/span'; import { HTTP_REQUEST_METHOD, - HTTP_TARGET, NETWORK_LOCAL_ADDRESS, NETWORK_LOCAL_PORT, NETWORK_PEER_ADDRESS, @@ -16,6 +15,7 @@ import { SERVER_ADDRESS, SERVER_PORT, URL_FULL, + URL_PATH, } from '@sentry/conventions/attributes'; function makeMockRequest(overrides: Partial> = {}): HttpClientRequest { @@ -76,22 +76,17 @@ describe('getOutgoingRequestSpanData', () => { expect(result.name).toMatch(/^POST /); }); - it('includes URL_FULL, HTTP_REQUEST_METHOD, HTTP_TARGET, and server endpoint attributes', () => { + it('includes URL_FULL, HTTP_REQUEST_METHOD, URL_PATH, and server endpoint attributes', () => { const result = getOutgoingRequestSpanData(makeMockRequest()); expect(result.attributes).toMatchObject({ [URL_FULL]: 'http://example.com/api/test', [HTTP_REQUEST_METHOD]: 'GET', - [HTTP_TARGET]: '/api/test', + [URL_PATH]: '/api/test', [SERVER_ADDRESS]: 'example.com', [SERVER_PORT]: 80, }); }); - it('falls back to "/" for http.target when path is not set', () => { - const result = getOutgoingRequestSpanData(makeMockRequest({ path: undefined })); - expect(result.attributes!['http.target']).toBe('/'); - }); - it('includes user_agent.original when user-agent header is set', () => { const request = makeMockRequest({ getHeader: (name: string) => (name === 'user-agent' ? 'Mozilla/5.0' : undefined), @@ -122,7 +117,7 @@ describe('setIncomingResponseSpanData', () => { expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.response.status_code': 201 })); }); - it('sets network.protocol.version from httpVersion', () => { + it('sets network.protocol.version and http.flavor from httpVersion', () => { const span = makeMockSpan(); setIncomingResponseSpanData(makeMockResponse({ httpVersion: '2.0' }), span); expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'network.protocol.version': '2.0' })); diff --git a/packages/core/test/lib/integrations/http/server-subscription.test.ts b/packages/core/test/lib/integrations/http/server-subscription.test.ts index 6707418eb287..628d84fc757a 100644 --- a/packages/core/test/lib/integrations/http/server-subscription.test.ts +++ b/packages/core/test/lib/integrations/http/server-subscription.test.ts @@ -12,6 +12,7 @@ import { SERVER_PORT, URL_FULL, URL_PATH, + URL_QUERY, } from '@sentry/conventions/attributes'; import * as http from 'node:http'; import type { AddressInfo } from 'node:net'; @@ -119,7 +120,6 @@ describe('getHttpServerSubscriptions', () => { data: expect.objectContaining({ 'http.request.method': 'GET', 'http.response.status_code': 200, - 'http.target': '/users/42?foo=bar', 'sentry.kind': 'server', 'sentry.op': 'http.server', 'sentry.origin': 'auto.http.server', @@ -137,6 +137,7 @@ describe('getHttpServerSubscriptions', () => { [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: '1.1', [NETWORK_TRANSPORT]: 'tcp', + [URL_QUERY]: 'foo=bar', }), }), ); @@ -183,9 +184,9 @@ describe('getHttpServerSubscriptions', () => { expect(data).not.toHaveProperty(NETWORK_PEER_ADDRESS); }); - // `http.target` is the deprecated alias of `url.full` and carries the same query string, so it has to - // respect `dataCollection.urlQueryParams` too. - it('filters sensitive query params in `http.target` and `url.full`', async () => { + // `url.query` and `url.full` both carry the query string, so both have to respect + // `dataCollection.urlQueryParams`. + it('filters sensitive query params in `url.query` and `url.full`', async () => { server = http.createServer((_req, res) => res.end('ok')); await new Promise(resolve => server.listen(0, '127.0.0.1', () => resolve())); instrument(true); @@ -195,7 +196,7 @@ describe('getHttpServerSubscriptions', () => { expect(transaction.contexts?.trace?.data).toEqual( expect.objectContaining({ - 'http.target': '/users/42?token=[Filtered]&foo=bar', + [URL_QUERY]: 'token=[Filtered]&foo=bar', [URL_FULL]: expect.stringMatching(/\/users\/42\?token=\[Filtered\]&foo=bar$/), [URL_PATH]: '/users/42', }), diff --git a/packages/eslint-plugin-sdk/src/rules/no-unfiltered-url-attributes.js b/packages/eslint-plugin-sdk/src/rules/no-unfiltered-url-attributes.js index d55b38f12d68..168e9f3d80f9 100644 --- a/packages/eslint-plugin-sdk/src/rules/no-unfiltered-url-attributes.js +++ b/packages/eslint-plugin-sdk/src/rules/no-unfiltered-url-attributes.js @@ -11,7 +11,9 @@ */ // Attribute keys that carry a query string, by constant name and by literal value. -const GUARDED_ATTRIBUTES = new Set(['URL_FULL', 'URL_QUERY', 'HTTP_TARGET', 'url.full', 'url.query', 'http.target']); +// `http.target` is not listed: the SDK no longer sets it, and its replacement `url.path` is a bare +// pathname with nothing to filter. +const GUARDED_ATTRIBUTES = new Set(['URL_FULL', 'URL_QUERY', 'url.full', 'url.query']); // Helpers that apply `dataCollection.urlQueryParams`. const FILTER_FUNCTIONS = new Set([ diff --git a/packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts b/packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts index e83c51de0482..42fa54903797 100644 --- a/packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts +++ b/packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts @@ -1,4 +1,4 @@ -import { HTTP_TARGET, URL_FULL } from '@sentry/conventions/attributes'; +import { HTTP_TARGET, URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; import type { RawAttributes } from '@sentry/core'; import { getClient, GLOBAL_OBJ, isSentryRequestUrl, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, type Span } from '@sentry/core'; import { ATTR_NEXT_SPAN_TYPE } from '../nextSpanAttributes'; @@ -68,12 +68,14 @@ function isTunnelRouteSpan(spanAttributes: Record): boolean { return false; } + // `http.target` is only read for spans from a user's own OpenTelemetry instrumentation, which + // still emits the old semantic conventions; the SDK sets `url.path`. // eslint-disable-next-line typescript/no-deprecated - const httpTarget = spanAttributes[HTTP_TARGET]; + const target = spanAttributes[URL_PATH] ?? spanAttributes[HTTP_TARGET]; - if (typeof httpTarget === 'string') { + if (typeof target === 'string') { // Extract pathname from the target (e.g., "/tunnel?o=123&p=456" -> "/tunnel") - const pathname = httpTarget.split('?')[0] || ''; + const pathname = target.split('?')[0] || ''; return isPathnameUnderSentryTunnelRoute(pathname, tunnelPath); } diff --git a/packages/nextjs/src/common/utils/setUrlProcessingMetadata.ts b/packages/nextjs/src/common/utils/setUrlProcessingMetadata.ts index 61add752008a..e094f9a54720 100644 --- a/packages/nextjs/src/common/utils/setUrlProcessingMetadata.ts +++ b/packages/nextjs/src/common/utils/setUrlProcessingMetadata.ts @@ -1,3 +1,4 @@ +import { HTTP_ROUTE, HTTP_TARGET, URL_PATH } from '@sentry/conventions/attributes'; import type { Event } from '@sentry/core'; import { getClient } from '@sentry/core'; import { getSanitizedRequestUrl } from './urls'; @@ -19,8 +20,11 @@ export function setUrlProcessingMetadata(event: Event): void { const traceData = event.contexts.trace.data; // Get the route from trace data - const componentRoute = traceData['next.route'] || traceData['http.route']; - const httpTarget = traceData['http.target'] as string | undefined; + const componentRoute = traceData['next.route'] || traceData[HTTP_ROUTE]; + // `http.target` is only read for spans from a user's own OpenTelemetry instrumentation, which + // still emits the old semantic conventions; the SDK sets `url.path`. + // eslint-disable-next-line typescript/no-deprecated + const httpTarget = (traceData[URL_PATH] ?? traceData[HTTP_TARGET]) as string | undefined; if (!componentRoute) { return; diff --git a/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts b/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts index c7ce02b99195..19a464788050 100644 --- a/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts +++ b/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts @@ -4,6 +4,7 @@ import { HTTP_REQUEST_METHOD, HTTP_ROUTE, HTTP_TARGET, + URL_PATH, } from '@sentry/conventions/attributes'; import { MIDDLEWARE } from '@sentry/conventions/op'; import { SEMANTIC_ATTRIBUTE_SENTRY_OP, stripUrlQueryAndFragment } from '@sentry/core'; @@ -48,8 +49,10 @@ export function enhanceHandleRequestRootSpan(span: MutableRootSpan): void { // eslint-disable-next-line typescript/no-deprecated const method = attributes[HTTP_REQUEST_METHOD] ?? attributes[HTTP_METHOD]; + // `http.target` is only read for spans from a user's own OpenTelemetry instrumentation, which + // still emits the old semantic conventions; the SDK sets `url.path`. // eslint-disable-next-line typescript/no-deprecated - const target = attributes[HTTP_TARGET]; + const target = attributes[URL_PATH] ?? attributes[HTTP_TARGET]; const route = attributes[HTTP_ROUTE] || attributes[ATTR_NEXT_ROUTE]; const spanName = attributes[ATTR_NEXT_SPAN_NAME]; diff --git a/packages/node/src/integrations/http/httpServerSpansIntegration.ts b/packages/node/src/integrations/http/httpServerSpansIntegration.ts index f03a62c05f61..d930bd141ab6 100644 --- a/packages/node/src/integrations/http/httpServerSpansIntegration.ts +++ b/packages/node/src/integrations/http/httpServerSpansIntegration.ts @@ -5,7 +5,6 @@ import { SENTRY_SEGMENT_NAME_SOURCE, HTTP_REQUEST_METHOD, HTTP_RESPONSE_STATUS_CODE, - HTTP_TARGET, CLIENT_ADDRESS, CLIENT_PORT, NETWORK_LOCAL_ADDRESS, @@ -168,11 +167,6 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions [URL_QUERY]: filterCollectedUrlQuery(query, client), [URL_FRAGMENT]: fragment, [HTTP_REQUEST_METHOD]: normalizedRequest.method, - // eslint-disable-next-line typescript/no-deprecated - [HTTP_TARGET]: filterCollectedUrl( - urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, - client, - ), [USER_AGENT_ORIGINAL]: userAgent, [URL_SCHEME]: scheme, [SERVER_ADDRESS]: hostname, diff --git a/packages/react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts b/packages/react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts index fa387e2f826f..e62e083e12ab 100644 --- a/packages/react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts +++ b/packages/react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts @@ -1,3 +1,4 @@ +import { URL_PATH } from '@sentry/conventions/attributes'; import type { IntegrationFn } from '@sentry/core'; import { defineIntegration } from '@sentry/core'; @@ -6,8 +7,8 @@ const LOW_QUALITY_TRANSACTIONS_FILTERS = [ /GET \/favicon\.ico/, /GET \/@id\//, // The span description for the `__manifest` endpoint is `GET *` (`http.route` resolves to `*`). - // Filter by `http.target` instead, which carries the raw request path. - { attributes: { 'http.target': /\/__manifest/ } }, + // Filter by `url.path` instead, which carries the raw request path. + { attributes: { [URL_PATH]: /\/__manifest/ } }, ]; const _lowQualityTransactionsFilterIntegration = (() => ({ diff --git a/packages/react-router/test/server/lowQualityTransactionsFilterIntegration.test.ts b/packages/react-router/test/server/lowQualityTransactionsFilterIntegration.test.ts index d2dfcac398e5..d9f37ff064a0 100644 --- a/packages/react-router/test/server/lowQualityTransactionsFilterIntegration.test.ts +++ b/packages/react-router/test/server/lowQualityTransactionsFilterIntegration.test.ts @@ -21,7 +21,7 @@ describe('lowQualityTransactionsFilterIntegration', () => { /GET \/node_modules\//, /GET \/favicon\.ico/, /GET \/@id\//, - { attributes: { 'http.target': /\/__manifest/ } }, + { attributes: { 'url.path': /\/__manifest/ } }, ]); }); @@ -31,7 +31,7 @@ describe('lowQualityTransactionsFilterIntegration', () => { /GET \/node_modules\//, /GET \/favicon\.ico/, /GET \/@id\//, - { attributes: { 'http.target': /\/__manifest/ } }, + { attributes: { 'url.path': /\/__manifest/ } }, ]); }); @@ -40,7 +40,7 @@ describe('lowQualityTransactionsFilterIntegration', () => { ['node_modules requests', { description: 'GET /node_modules/some-package/index.js' }], ['favicon.ico requests', { description: 'GET /favicon.ico' }], ['@id/ requests', { description: 'GET /@id/some-id' }], - ['manifest requests', { description: 'GET *', attributes: { 'http.target': '/__manifest?paths=foo' } }], + ['manifest requests', { description: 'GET *', attributes: { 'url.path': '/__manifest?paths=foo' } }], ])('%s', (_label, span) => { const ignoreSpans = setupIntegrationAndGetIgnoreSpans(); expect(shouldIgnoreSpan({ op: 'http.server', ...span }, ignoreSpans)).toBe(true); diff --git a/packages/tanstackstart-react/src/server/tunnelRoute.ts b/packages/tanstackstart-react/src/server/tunnelRoute.ts index a2d3cd87f6df..89501d8a2da4 100644 --- a/packages/tanstackstart-react/src/server/tunnelRoute.ts +++ b/packages/tanstackstart-react/src/server/tunnelRoute.ts @@ -1,10 +1,11 @@ +import { URL_PATH } from '@sentry/conventions/attributes'; import { dsnToString, escapeStringForRegex, getClient, handleTunnelRequest } from '@sentry/core'; const registeredTunnelRoutePaths = new Set(); /** * Drops the incoming `http.server` transaction for a tunnel route by matching its request path (the - * `http.target` attribute, set at span creation, so it works for static and streamed lifecycles). + * `url.path` attribute, set at span creation, so it works for static and streamed lifecycles). * Called at server startup for the managed route and from the handler (self-registration) otherwise. */ export function registerSentryServerTunnelRoute(path: string): void { @@ -23,7 +24,7 @@ export function registerSentryServerTunnelRoute(path: string): void { const options = client.getOptions(); options.ignoreSpans = [ ...(options.ignoreSpans ?? []), - { attributes: { 'http.target': new RegExp(`^${escapeStringForRegex(path)}(?:[/?#]|$)`) } }, + { attributes: { [URL_PATH]: new RegExp(`^${escapeStringForRegex(path)}(?:[/?#]|$)`) } }, ]; } diff --git a/packages/tanstackstart-react/test/server/tunnelRoute.test.ts b/packages/tanstackstart-react/test/server/tunnelRoute.test.ts index c2cb080a6966..0016be5c0785 100644 --- a/packages/tanstackstart-react/test/server/tunnelRoute.test.ts +++ b/packages/tanstackstart-react/test/server/tunnelRoute.test.ts @@ -88,10 +88,10 @@ describe('createSentryTunnelRoute', () => { await createSentryTunnelRoute({ allowedDsns: ['https://public@o0.ingest.sentry.io/0'] }).handlers.POST({ request }); const matcher = options.ignoreSpans?.find( - (entry): entry is { attributes: { 'http.target': RegExp } } => - !!(entry as { attributes?: { 'http.target'?: unknown } })?.attributes?.['http.target'], + (entry): entry is { attributes: { 'url.path': RegExp } } => + !!(entry as { attributes?: { 'url.path'?: unknown } })?.attributes?.['url.path'], ); - expect(matcher?.attributes['http.target'].test('/handler-selfreg')).toBe(true); + expect(matcher?.attributes['url.path'].test('/handler-selfreg')).toBe(true); }); it('returns 500 when allowedDsns is omitted and no active server Sentry client DSN exists', async () => { @@ -121,8 +121,8 @@ describe('registerSentryServerTunnelRoute', () => { registerSentryServerTunnelRoute('/abcd1234'); expect(options.ignoreSpans).toHaveLength(2); - const matcher = options.ignoreSpans?.[1] as { attributes: { 'http.target': RegExp } }; - const pattern = matcher.attributes['http.target']; + const matcher = options.ignoreSpans?.[1] as { attributes: { 'url.path': RegExp } }; + const pattern = matcher.attributes['url.path']; expect(pattern.test('/abcd1234')).toBe(true); expect(pattern.test('/abcd1234?o=1&p=2')).toBe(true);