diff --git a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/fetch/test.ts b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/fetch/test.ts index f4708e8b336d..98bdc15e6d4e 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/fetch/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/fetch/test.ts @@ -48,7 +48,7 @@ sentryTest('should update spans for GraphQL fetch requests', async ({ getLocalTe status: 'ok', data: expect.objectContaining({ type: 'fetch', - 'http.method': 'POST', + 'http.request.method': 'POST', 'url.full': 'http://sentry-test.io/foo', 'server.address': 'sentry-test.io', 'sentry.op': 'http.client', diff --git a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-fetch/test.ts b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-fetch/test.ts index 31ee18e6f6d4..85bca8b11546 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-fetch/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-fetch/test.ts @@ -42,7 +42,7 @@ sentryTest('should update spans for GraphQL persisted query fetch requests', asy status: 'ok', data: expect.objectContaining({ type: 'fetch', - 'http.method': 'POST', + 'http.request.method': 'POST', 'url.full': 'http://sentry-test.io/graphql', 'server.address': 'sentry-test.io', 'sentry.op': 'http.client', diff --git a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-xhr/test.ts b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-xhr/test.ts index bf5aeaa40393..7e48cf913934 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-xhr/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/persistedQuery-xhr/test.ts @@ -42,7 +42,7 @@ sentryTest('should update spans for GraphQL persisted query XHR requests', async status: 'ok', data: { type: 'xhr', - 'http.method': 'POST', + 'http.request.method': 'POST', 'url.full': 'http://sentry-test.io/graphql', 'server.address': 'sentry-test.io', 'sentry.op': 'http.client', diff --git a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/xhr/test.ts b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/xhr/test.ts index c254d82c3e7d..722f6487c072 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/xhr/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/graphqlClient/xhr/test.ts @@ -48,7 +48,7 @@ sentryTest('should update spans for GraphQL XHR requests', async ({ getLocalTest status: 'ok', data: { type: 'xhr', - 'http.method': 'POST', + 'http.request.method': 'POST', 'url.full': 'http://sentry-test.io/foo', 'server.address': 'sentry-test.io', 'sentry.op': 'http.client', diff --git a/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/init.js b/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/init.js index a6a4e1f4740b..f57cb5bfaa57 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/init.js +++ b/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/init.js @@ -5,7 +5,7 @@ window.Sentry = Sentry; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', integrations: [Sentry.spanStreamingIntegration()], - ignoreSpans: [{ attributes: { 'http.status_code': 200 } }], + ignoreSpans: [{ attributes: { 'http.response.status_code': 200 } }], tracesSampleRate: 1, debug: true, }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/subject.js b/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/subject.js index 741f4077d2ca..104fe3956cb9 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/subject.js +++ b/dev-packages/browser-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/subject.js @@ -1,11 +1,11 @@ // This segment span matches ignoreSpans via attributes — segment + child should be dropped -Sentry.startSpan({ name: 'health-check', attributes: { 'http.status_code': 200 } }, () => { +Sentry.startSpan({ name: 'health-check', attributes: { 'http.response.status_code': 200 } }, () => { Sentry.startSpan({ name: 'child-of-ignored' }, () => {}); }); setTimeout(() => { // This segment span does NOT match — segment + child should be sent - Sentry.startSpan({ name: 'normal-segment', attributes: { 'http.status_code': 500 } }, () => { + Sentry.startSpan({ name: 'normal-segment', attributes: { 'http.response.status_code': 500 } }, () => { Sentry.startSpan({ name: 'child-span' }, () => {}); }); }, 1000); diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts index 2ae373d673e5..d5bc3e7877c4 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts @@ -68,7 +68,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU // The init bundle script is served from the test origin: its description is origin-relative, // but `url.full` retains the full absolute URL (needed for span description inference). const sameOriginScriptSpan = scriptSpans?.find(({ description }) => description === '/init.bundle.js'); - expect(sameOriginScriptSpan?.data?.['url.same_origin']).toBe(true); + expect(sameOriginScriptSpan?.data?.['http.request.same_origin']).toBe(true); expect(sameOriginScriptSpan?.data?.['url.full']).toMatch(/^https?:\/\/.+\/init\.bundle\.js$/); const customScriptSpan = scriptSpans?.find( @@ -77,9 +77,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU expect(imgSpan).toEqual({ data: { - 'http.decoded_response_content_length': expect.any(Number), - 'http.response_content_length': expect.any(Number), - 'http.response_transfer_size': expect.any(Number), + 'http.response.body.decoded_size': expect.any(Number), + 'http.response.body.size': expect.any(Number), + 'http.response.size': expect.any(Number), 'http.request.connect_start': expect.any(Number), 'http.request.connection_end': expect.any(Number), 'http.request.domain_lookup_end': expect.any(Number), @@ -99,7 +99,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', - 'url.same_origin': false, + 'http.request.same_origin': false, 'url.scheme': 'https', 'url.full': 'https://sentry-test-site.example/path/to/image.svg', ...(!isWebkitRun && { @@ -127,9 +127,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU expect(linkSpan).toEqual({ data: { - 'http.decoded_response_content_length': expect.any(Number), - 'http.response_content_length': expect.any(Number), - 'http.response_transfer_size': expect.any(Number), + 'http.response.body.decoded_size': expect.any(Number), + 'http.response.body.size': expect.any(Number), + 'http.response.size': expect.any(Number), 'http.request.connect_start': expect.any(Number), 'http.request.connection_end': expect.any(Number), 'http.request.domain_lookup_end': expect.any(Number), @@ -149,7 +149,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', - 'url.same_origin': false, + 'http.request.same_origin': false, 'url.scheme': 'https', 'url.full': 'https://sentry-test-site.example/path/to/style.css', ...(!isWebkitRun && { @@ -171,9 +171,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU expect(customScriptSpan).toEqual({ data: { - 'http.decoded_response_content_length': expect.any(Number), - 'http.response_content_length': expect.any(Number), - 'http.response_transfer_size': expect.any(Number), + 'http.response.body.decoded_size': expect.any(Number), + 'http.response.body.size': expect.any(Number), + 'http.response.size': expect.any(Number), 'http.request.connection_end': expect.any(Number), 'http.request.connect_start': expect.any(Number), 'http.request.domain_lookup_end': expect.any(Number), @@ -193,7 +193,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU 'sentry.origin': 'auto.resource.browser.metrics', 'server.address': 'sentry-test-site.example', 'url.domain': 'sentry-test-site.example', - 'url.same_origin': false, + 'http.request.same_origin': false, 'url.scheme': 'https', 'url.full': 'https://sentry-test-site.example/path/to/script.js', ...(!isWebkitRun && { diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-data-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-data-url/test.ts index 35b4950ed00c..2e79255e3993 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-data-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-data-url/test.ts @@ -26,7 +26,7 @@ sentryTest('sanitizes data URLs in fetch span name and attributes', async ({ get expect(span?.description).toBe(`GET ${sanitizedUrl}`); expect(span?.data).toMatchObject({ - 'http.method': 'GET', + 'http.request.method': 'GET', type: 'fetch', }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-immediate/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-immediate/test.ts index 432b4188c359..f43ff5448679 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-immediate/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-immediate/test.ts @@ -30,7 +30,7 @@ sentryTest('should create spans for fetch requests called directly after init', timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/0', 'server.address': 'sentry-test-site.example', type: 'fetch', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts index 221b457a18e2..323060c7e4b2 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts @@ -28,7 +28,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': `${TEST_HOST}/test-req/${index}`, 'server.address': 'sentry-test.io', type: 'fetch', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed-track-stream-performance/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed-track-stream-performance/test.ts index c8261692dbfa..8e332aa18a0b 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed-track-stream-performance/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed-track-stream-performance/test.ts @@ -52,7 +52,7 @@ sentryTest( expect(streamSpan).toMatchObject({ name: 'GET http://sentry-test-site.example/delayed', attributes: expect.objectContaining({ - 'http.method': { type: 'string', value: 'GET' }, + 'http.request.method': { type: 'string', value: 'GET' }, 'url.full': { type: 'string', value: 'http://sentry-test-site.example/delayed' }, type: { type: 'string', value: 'fetch' }, }), diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed/test.ts index 1568115bb908..9702763ce3f1 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-streamed/test.ts @@ -36,7 +36,7 @@ sentryTest('creates spans for fetch requests', async ({ getLocalTestUrl, page }) end_timestamp: expect.any(Number), trace_id: pageloadSpan?.trace_id, attributes: expect.objectContaining({ - 'http.method': { type: 'string', value: 'GET' }, + 'http.request.method': { type: 'string', value: 'GET' }, 'url.full': { type: 'string', value: `http://sentry-test-site.example/${index}` }, 'server.address': { type: 'string', value: 'sentry-test-site.example' }, type: { type: 'string', value: 'fetch' }, diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-strip-query-and-fragment/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-strip-query-and-fragment/test.ts index cbac553aa21a..bbe15d81429f 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-strip-query-and-fragment/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-strip-query-and-fragment/test.ts @@ -29,11 +29,11 @@ sentryTest('strips query params in fetch request spans', async ({ getLocalTestUr timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/0?id=123;page=5', 'url.query': 'id=123;page=5', 'http.response.status_code': 200, - 'http.response_content_length': 2, + 'http.response.body.size': 2, 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', type: 'fetch', @@ -71,11 +71,11 @@ sentryTest('strips hash fragment in fetch request spans', async ({ getLocalTestU timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/1#fragment', 'url.fragment': 'fragment', 'http.response.status_code': 200, - 'http.response_content_length': 2, + 'http.response.body.size': 2, 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', type: 'fetch', @@ -113,12 +113,12 @@ sentryTest('strips hash fragment and query params in fetch request spans', async timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/2?id=1#fragment', 'url.query': 'id=1', 'url.fragment': 'fragment', 'http.response.status_code': 200, - 'http.response_content_length': 2, + 'http.response.body.size': 2, 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', type: 'fetch', @@ -156,12 +156,12 @@ sentryTest( timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test.io/api/users?id=1#fragment', 'url.query': 'id=1', 'url.fragment': 'fragment', 'http.response.status_code': 200, - 'http.response_content_length': 2, + 'http.response.body.size': 2, 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', type: 'fetch', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts index 5b62a5752c63..a177445bb980 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts @@ -31,7 +31,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': `http://sentry-test-site.example/${index}`, 'server.address': 'sentry-test-site.example', type: 'fetch', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-data-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-data-url/test.ts index ebf06272e1c2..549c468c2e0b 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-data-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-data-url/test.ts @@ -21,7 +21,7 @@ sentryTest('sanitizes data URLs in XHR span name and attributes', async ({ getLo expect(span?.description).toBe(`GET ${sanitizedUrl}`); expect(span?.data).toMatchObject({ - 'http.method': 'GET', + 'http.request.method': 'GET', type: 'xhr', }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts index c01f4ce5b04c..110df467837f 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts @@ -28,7 +28,7 @@ sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, pag timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': `${TEST_HOST}/test-req/${index}`, 'server.address': 'sentry-test.io', type: 'xhr', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-streamed/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-streamed/test.ts index 4e40cc6829c3..7fb689dafc1e 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-streamed/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-streamed/test.ts @@ -36,7 +36,7 @@ sentryTest('creates spans for XHR requests', async ({ getLocalTestUrl, page }) = end_timestamp: expect.any(Number), trace_id: pageloadSpan?.trace_id, attributes: expect.objectContaining({ - 'http.method': { type: 'string', value: 'GET' }, + 'http.request.method': { type: 'string', value: 'GET' }, 'url.full': { type: 'string', value: `http://sentry-test-site.example/${index}` }, 'server.address': { type: 'string', value: 'sentry-test-site.example' }, type: { type: 'string', value: 'xhr' }, diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment/test.ts index 67d41160e659..f5445029b4c3 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment/test.ts @@ -29,7 +29,7 @@ sentryTest('strips query params in XHR request spans', async ({ getLocalTestUrl, timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/0?id=123;page=5', 'url.query': 'id=123;page=5', 'http.response.status_code': 200, @@ -70,7 +70,7 @@ sentryTest('strips hash fragment in XHR request spans', async ({ getLocalTestUrl timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/1#fragment', 'url.fragment': 'fragment', 'http.response.status_code': 200, @@ -111,7 +111,7 @@ sentryTest('strips hash fragment and query params in XHR request spans', async ( timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test-site.example/2?id=1#fragment', 'url.query': 'id=1', 'url.fragment': 'fragment', @@ -153,7 +153,7 @@ sentryTest( timestamp: expect.any(Number), trace_id: transactionEvent.contexts?.trace?.trace_id, data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://sentry-test.io/api/users?id=1#fragment', 'url.query': 'id=1', 'url.fragment': 'fragment', diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts index ed9832dee74e..971cb0f5c030 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts @@ -26,7 +26,7 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestUrl, pag timestamp: expect.any(Number), trace_id: eventData.contexts?.trace?.trace_id, data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': `http://sentry-test-site.example/${index}`, 'server.address': 'sentry-test-site.example', type: 'xhr', diff --git a/dev-packages/bun-integration-tests/suites/fetch/test.ts b/dev-packages/bun-integration-tests/suites/fetch/test.ts index 114b6bbdb2aa..7a168d9a8a84 100644 --- a/dev-packages/bun-integration-tests/suites/fetch/test.ts +++ b/dev-packages/bun-integration-tests/suites/fetch/test.ts @@ -21,7 +21,7 @@ it('creates an http.client span for outgoing fetch requests', async ({ signal }) origin: 'auto.http.fetch', description: expect.stringMatching(/^GET http:\/\/localhost:\d+\/allowed$/), data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', type: 'fetch', }), }); 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 17f40deee68b..5e5eb00835d3 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 767f5ca19489..131167ac73fe 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 3e5181de5e02..6f87724ac2fd 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 @@ -49,13 +49,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -66,8 +64,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 2b90081054b0..048deb6e69fa 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 @@ -64,13 +64,11 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, - 'http.user_agent': expect.any(String), - 'http.flavor': '1.1', + 'user_agent.original': expect.any(String), 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -81,8 +79,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -108,12 +105,10 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -124,8 +119,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', 'http.request.header.baggage': expect.any(String), 'http.request.header.connection': 'keep-alive', @@ -203,13 +197,11 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, - 'http.user_agent': expect.any(String), - 'http.flavor': '1.1', + 'user_agent.original': expect.any(String), 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -220,8 +212,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -247,12 +238,10 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -263,8 +252,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', }), op: 'http.server', 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 fa104ba07382..e1f1d59ddd86 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 @@ -27,13 +27,11 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'sentry.kind': 'server', 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -44,8 +42,7 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -111,7 +108,7 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { component: '@nestjs/core', 'nestjs.version': expect.any(String), 'nestjs.type': 'request_context', - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': '/test-transaction', 'http.route': '/test-transaction', 'nestjs.controller': 'AppController', 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 67c06d9b1c85..caee3c36d8a7 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/example-module/transaction', 'url.path': '/example-module/transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/example-module/transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/example-module/transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 abde21c17f67..7ad464eb80c1 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/example-module/transaction', 'url.path': '/example-module/transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/example-module/transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/example-module/transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts index 66752e7c2e41..7289c004d754 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/request-instrumentation.test.ts @@ -26,7 +26,7 @@ test('Should send a transaction with a fetch span', async ({ page }) => { expect(transactionEvent.spans).toContainEqual( expect.objectContaining({ data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.client', }), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/middleware.test.ts index 8d7300a0ea86..4fad06850a4f 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/middleware.test.ts @@ -83,7 +83,7 @@ test.skip('Should trace outgoing fetch requests inside middleware and create bre expect.arrayContaining([ { category: 'http', - data: { 'http.method': 'GET', status_code: 200, url: 'http://localhost:3030/' }, + data: { 'http.request.method': 'GET', status_code: 200, url: 'http://localhost:3030/' }, timestamp: expect.any(Number), type: 'http', }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/middleware.test.ts index 964e913679f0..d1f18f32ca54 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/middleware.test.ts @@ -103,7 +103,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru expect.arrayContaining([ { category: 'http', - data: { 'http.method': 'GET', status_code: 200, url: 'http://localhost:3030/' }, + data: { 'http.request.method': 'GET', status_code: 200, url: 'http://localhost:3030/' }, timestamp: expect.any(Number), type: 'http', }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/request-instrumentation.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/request-instrumentation.test.ts index 939347da2a09..3cb8292bdf46 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/request-instrumentation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/request-instrumentation.test.ts @@ -14,7 +14,7 @@ test.skip('Should send a transaction with a http span', async ({ request }) => { expect((await transactionPromise).spans).toContainEqual( expect.objectContaining({ data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.client', }), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts index e45fa3547f49..694368cac2ec 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts @@ -70,7 +70,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru expect.arrayContaining([ { data: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, type: 'fetch', 'url.full': 'http://localhost:3030/', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/request-instrumentation.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/request-instrumentation.test.ts index 65a6820a83da..a532841b8540 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/request-instrumentation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/request-instrumentation.test.ts @@ -14,7 +14,7 @@ test.skip('Should send a transaction with a http span', async ({ request }) => { expect((await transactionPromise).spans).toContainEqual( expect.objectContaining({ data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.client', }), 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 82425467ec4c..f53224c73b15 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 @@ -34,17 +34,14 @@ test('Should record a transaction for route with parameters', async ({ request } expect(transactionEvent.transaction).toEqual('GET /test-transaction/:param'); expect(transactionEvent.contexts?.trace?.data).toEqual( expect.objectContaining({ - 'http.flavor': '1.1', - 'http.host': 'localhost:3030', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, 'http.route': '/test-transaction/:param', - 'http.scheme': 'http', - 'http.status_code': 200, - 'http.status_text': 'OK', + 'url.scheme': 'http', + 'http.response.status_text': 'OK', 'http.target': '/test-transaction/1', 'url.full': 'http://localhost:3030/test-transaction/1', - 'http.user_agent': expect.any(String), + 'user_agent.original': expect.any(String), 'network.local.address': expect.any(String), 'server.address': 'localhost', 'network.local.port': 3030, @@ -128,7 +125,7 @@ test('Instruments MySQL via Orchestrion', async ({ baseURL }) => { expect(transactionEvent.contexts?.trace?.op).toEqual('http.server'); expect(transactionEvent.transaction).toEqual('GET /test-mysql'); expect(transactionEvent.contexts?.trace?.status).toEqual('ok'); - expect(transactionEvent.contexts?.trace?.data?.['http.status_code']).toEqual(200); + expect(transactionEvent.contexts?.trace?.data?.['http.response.status_code']).toEqual(200); const spans = transactionEvent.spans || []; expect(spans).toContainEqual( diff --git a/dev-packages/e2e-tests/test-applications/node-express-streaming/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-express-streaming/tests/spans.test.ts index bb48067a21dd..5fc4fa3240d4 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-streaming/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-streaming/tests/spans.test.ts @@ -74,7 +74,7 @@ test('Sends streamed spans for an errored route', async ({ baseURL }) => { expect(rootSpan.name).toBe('GET /test-exception/:id'); expect(getSpanOp(rootSpan)).toBe('http.server'); expect(rootSpan.status).toBe('error'); - expect(rootSpan.attributes['http.status_code']?.value).toBe(500); + expect(rootSpan.attributes['http.response.status_code']?.value).toBe(500); }); test('Outgoing fetch spans are streamed', async ({ baseURL }) => { diff --git a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/mysql.test.ts index bb82f3a52e25..76849657bd30 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/mysql.test.ts @@ -13,7 +13,7 @@ test('Instruments MySQL via Orchestrion', async ({ baseURL }) => { expect(transactionEvent.contexts?.trace?.op).toEqual('http.server'); expect(transactionEvent.transaction).toEqual('GET /test-mysql'); expect(transactionEvent.contexts?.trace?.status).toEqual('ok'); - expect(transactionEvent.contexts?.trace?.data?.['http.status_code']).toEqual(200); + expect(transactionEvent.contexts?.trace?.data?.['http.response.status_code']).toEqual(200); const spans = transactionEvent.spans || []; expect(spans).toContainEqual( 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 39d15fdea7d4..770c46af5ab1 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -124,5 +121,5 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) expect(transactionEvent.contexts?.trace?.op).toEqual('http.server'); expect(transactionEvent.transaction).toEqual('GET /test-exception/:id'); expect(transactionEvent.contexts?.trace?.status).toEqual('internal_error'); - expect(transactionEvent.contexts?.trace?.data?.['http.status_code']).toEqual(500); + expect(transactionEvent.contexts?.trace?.data?.['http.response.status_code']).toEqual(500); }); 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 f29afd0c3513..5ffbf7ab9de7 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -160,7 +157,7 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) expect(transactionEvent.contexts?.trace?.op).toEqual('http.server'); expect(transactionEvent.transaction).toEqual('GET /test-exception/:id'); expect(transactionEvent.contexts?.trace?.status).toEqual('internal_error'); - expect(transactionEvent.contexts?.trace?.data?.['http.status_code']).toEqual(500); + expect(transactionEvent.contexts?.trace?.data?.['http.response.status_code']).toEqual(500); const spans = transactionEvent.spans || []; 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 364622eb8f11..fc5b0e84d1c8 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 @@ -64,13 +64,11 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -81,8 +79,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -108,12 +105,10 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -124,8 +119,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', 'http.request.header.baggage': expect.any(String), 'http.request.header.connection': 'keep-alive', @@ -203,13 +197,11 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -220,8 +212,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -247,12 +238,10 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -263,9 +252,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', - 'http.user_agent': 'node', + 'http.response.status_text': 'OK', + 'user_agent.original': 'node', 'http.route': '/test-inbound-headers/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 c84893b3a860..568aa0c76163 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 @@ -28,13 +28,11 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -45,8 +43,7 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 b322e7be7a96..46e2201f261b 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 @@ -64,13 +64,11 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -81,8 +79,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -108,12 +105,10 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -124,8 +119,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', 'http.request.header.baggage': expect.any(String), 'http.request.header.connection': 'keep-alive', @@ -203,13 +197,11 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -220,8 +212,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -247,12 +238,10 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -263,10 +252,9 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', - 'http.user_agent': 'node', + 'user_agent.original': 'node', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 'http.request.header.accept_language': '*', 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 1a54d84796c9..6efddcb5e5ee 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 315c069a6938..162d87d84bd0 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 @@ -64,13 +64,11 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -81,8 +79,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -108,12 +105,10 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -124,8 +119,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', 'http.request.header.baggage': expect.any(String), 'http.request.header.connection': 'keep-alive', @@ -203,13 +197,11 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -220,8 +212,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -247,12 +238,10 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -263,9 +252,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', - 'http.user_agent': 'node', + 'http.response.status_text': 'OK', + 'user_agent.original': 'node', 'http.route': '/test-inbound-headers/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 113a9430627a..67efe576ac73 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 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 048d0987daae..2f88c811d5bc 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 @@ -22,13 +22,11 @@ test('Sends successful transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-success', 'url.path': '/test-success', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-success', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -39,8 +37,7 @@ test('Sends successful transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-success', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -77,7 +74,7 @@ test('Sends successful transaction', async ({ baseURL }) => { { data: { 'hapi.type': 'router', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.route': '/test-success', 'sentry.op': 'router', 'sentry.origin': 'auto.http.hapi', 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 a0ca50024d5c..f235f3d6f345 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 @@ -63,13 +63,11 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -80,8 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -107,12 +104,10 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -123,8 +118,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', 'http.request.header.baggage': expect.stringContaining(traceId!), // we already check if traceId is defined 'http.request.header.connection': 'keep-alive', @@ -202,13 +196,11 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -219,8 +211,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -246,12 +237,10 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, - 'http.flavor': '1.1', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -262,10 +251,9 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', - 'http.user_agent': 'node', + 'user_agent.original': 'node', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', 'http.request.header.accept_language': '*', 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 57523b480fb6..effa19866995 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3-dynamic-import/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3-dynamic-import/tests/tracing.test.ts index bf1166abd65d..64ae846d00d1 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3-dynamic-import/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3-dynamic-import/tests/tracing.test.ts @@ -114,7 +114,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.test.ts index afbe237c330e..5851ca1721db 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.test.ts @@ -115,7 +115,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3-top-level-import/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3-top-level-import/tests/tracing.test.ts index 8dfdbc13f4b2..7ec391c3174c 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3-top-level-import/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3-top-level-import/tests/tracing.test.ts @@ -114,7 +114,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.test.ts index 693a702ba10b..8a11a0c3db81 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.test.ts @@ -114,7 +114,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.test.ts index 7f4a0978012b..fcaeef2d46c5 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.test.ts @@ -114,7 +114,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-5/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-5/tests/tracing.test.ts index 67cb2074d192..29f87cf85fa8 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-5/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-5/tests/tracing.test.ts @@ -114,7 +114,7 @@ test.describe('distributed tracing', () => { type: 'fetch', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.browser', - 'http.method': 'GET', + 'http.request.method': 'GET', }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.test.ts index a9e8cd2ba449..bb74859d9e59 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.test.ts @@ -182,7 +182,7 @@ test('record client-side universal load fetch span and trace', async ({ page }) data: { 'url.full': expect.stringContaining('/api/users'), type: 'fetch', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, 'network.protocol.version': '1.1', 'network.protocol.name': 'http', diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.test.ts index b4d2f5698354..d61a9d6355f5 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.test.ts @@ -175,7 +175,7 @@ test.describe('performance events', () => { data: { 'url.full': expect.stringContaining('/api/users'), type: 'fetch', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, 'network.protocol.version': '1.1', 'network.protocol.name': 'http', diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.test.ts index 1580e70eb3e0..4aacdb936087 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.test.ts @@ -175,7 +175,7 @@ test.describe('performance events', () => { data: { 'url.full': expect.stringContaining('/api/users'), type: 'fetch', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, 'network.protocol.version': '1.1', 'network.protocol.name': 'http', diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.test.ts index ad3c8961ce05..b3cf48adce31 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.test.ts @@ -167,7 +167,7 @@ test('record client-side universal load fetch span and trace', async ({ page }) data: { 'url.full': expect.stringContaining('/api/users'), type: 'fetch', - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, 'network.protocol.version': '1.1', 'network.protocol.name': 'http', 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 501849f38e60..573827f679f2 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 @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', - 'http.host': 'localhost:3030', 'server.address': 'localhost', - 'http.method': 'GET', - 'http.scheme': 'http', + 'http.request.method': 'GET', + 'url.scheme': 'http', 'http.target': '/test-transaction', - 'http.user_agent': 'node', - 'http.flavor': '1.1', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.transport': 'tcp', @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'network.protocol.name': 'http', 'network.protocol.version': '1.1', 'server.port': 3030, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', 'http.request.header.accept_encoding': 'gzip, deflate', @@ -146,7 +143,7 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) expect(transactionEvent.contexts?.trace?.op).toEqual('http.server'); expect(transactionEvent.transaction).toEqual('GET /test-exception/:id'); expect(transactionEvent.contexts?.trace?.status).toEqual('internal_error'); - expect(transactionEvent.contexts?.trace?.data?.['http.status_code']).toEqual(500); + expect(transactionEvent.contexts?.trace?.data?.['http.response.status_code']).toEqual(500); const spans = transactionEvent.spans || []; diff --git a/dev-packages/node-integration-tests/suites/aws-serverless/aws-integration-streamed/test.ts b/dev-packages/node-integration-tests/suites/aws-serverless/aws-integration-streamed/test.ts index 1f52afbbf25d..7964b04c96a9 100644 --- a/dev-packages/node-integration-tests/suites/aws-serverless/aws-integration-streamed/test.ts +++ b/dev-packages/node-integration-tests/suites/aws-serverless/aws-integration-streamed/test.ts @@ -77,7 +77,7 @@ function assertAwsServiceSpans(spanCcontainer: SerializedStreamedSpanContainer): }), }, // Two spans share the name `S3.GetObject`; disambiguate by HTTP status code. - item => item.attributes['http.status_code']?.value === 200, + item => item.attributes['http.response.status_code']?.value === 200, ); // S3 - GetObject (errored, missing key) @@ -91,7 +91,7 @@ function assertAwsServiceSpans(spanCcontainer: SerializedStreamedSpanContainer): 'rpc.service': { value: 'S3', type: 'string' }, }), }, - item => item.attributes['http.status_code']?.value === 404, + item => item.attributes['http.response.status_code']?.value === 404, ); // DynamoDB - PutItem 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 06be06aba228..b8695f245aca 100644 --- a/dev-packages/node-integration-tests/suites/express/tracing/test.ts +++ b/dev-packages/node-integration-tests/suites/express/tracing/test.ts @@ -135,7 +135,7 @@ describe('express tracing', () => { trace_id: expect.stringMatching(/[a-f\d]{32}/), data: { 'http.response.status_code': 200, - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': expect.stringMatching(/\/$/), 'http.route': '/', 'http.target': '/', @@ -395,7 +395,7 @@ describe('express tracing', () => { trace_id: expect.stringMatching(/[a-f\d]{32}/), data: { 'http.response.status_code': status_code, - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': expect.stringMatching(url), 'http.target': url, }, diff --git a/dev-packages/node-integration-tests/suites/express/tracing/tracesSampler/instrument.mjs b/dev-packages/node-integration-tests/suites/express/tracing/tracesSampler/instrument.mjs index 696f626f182c..15b20267dd3c 100644 --- a/dev-packages/node-integration-tests/suites/express/tracing/tracesSampler/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/express/tracing/tracesSampler/instrument.mjs @@ -13,7 +13,7 @@ Sentry.init({ return ( samplingContext.name === 'GET /test/123' && samplingContext.attributes['sentry.op'] === 'http.server' && - samplingContext.attributes['http.method'] === 'GET' + samplingContext.attributes['http.request.method'] === 'GET' ); }, }); diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/scenario.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/scenario.ts index eca137f87160..87f2a025a57c 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/scenario.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/scenario.ts @@ -16,7 +16,7 @@ Sentry.startSpan( { name: 'GET /route', attributes: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.route': '/route', [Sentry.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.server', [SENTRY_SEGMENT_NAME_SOURCE]: 'route', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/scenario.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/scenario.ts index 7cde093c1402..093856dd1d12 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/scenario.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/scenario.ts @@ -16,7 +16,7 @@ Sentry.startSpan( { name: 'GET /route/1', attributes: { - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.route': '/route', [Sentry.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.server', [SENTRY_SEGMENT_NAME_SOURCE]: 'url', diff --git a/dev-packages/node-integration-tests/suites/tracing/hapi/test.ts b/dev-packages/node-integration-tests/suites/tracing/hapi/test.ts index d8519f5bdae3..720269556c62 100644 --- a/dev-packages/node-integration-tests/suites/tracing/hapi/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/hapi/test.ts @@ -14,7 +14,7 @@ describe('hapi auto-instrumentation', () => { expect.objectContaining({ data: expect.objectContaining({ 'http.route': '/', - 'http.method': 'GET', + 'http.request.method': 'GET', 'hapi.type': 'router', 'sentry.origin': origin, 'sentry.op': 'router', 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 901c4d9229c1..42888fca422b 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 @@ -28,14 +28,11 @@ describe('outgoing http spans - strip query', () => { data: { 'url.full': `${SERVER_URL}/api/v0/users?id=1`, 'http.target': '/api/v0/users?id=1', - 'http.flavor': '1.1', - 'http.host': expect.stringMatching(/localhost:\d+$/), - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.query': 'id=1', 'http.response.status_code': 200, - 'http.response_content_length_uncompressed': 0, - 'http.status_code': 200, - 'http.status_text': 'OK', + 'http.response.body.decoded_size': 0, + 'http.response.status_text': 'OK', 'network.peer.address': '::1', 'server.address': 'localhost', 'network.peer.port': expect.any(Number), 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 498835701f64..c6b2207e66d8 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -92,17 +92,14 @@ describe('httpIntegration', () => { const port = runner.getPort(); expect(transaction.transaction).toBe('GET /test'); expect(transaction.contexts?.trace?.data).toEqual({ - 'http.flavor': '1.1', - 'http.host': `localhost:${port}`, - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.query': 'a=1&b=2', 'http.response.status_code': 200, 'http.route': '/test', - 'http.scheme': 'http', - 'http.status_code': 200, - 'http.status_text': 'OK', + 'url.scheme': 'http', + 'http.response.status_text': 'OK', 'http.target': '/test?a=1&b=2', - 'http.user_agent': 'node', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.local.address': '::1', @@ -138,18 +135,15 @@ describe('httpIntegration', () => { const port = runner.getPort(); expect(transaction.transaction).toBe('POST /test'); expect(transaction.contexts?.trace?.data).toEqual({ - 'http.flavor': '1.1', - 'http.host': `localhost:${port}`, - 'http.method': 'POST', + 'http.request.method': 'POST', 'url.query': 'a=1&b=2', - 'http.request_content_length_uncompressed': 9, + 'http.request.body.decoded_size': 9, 'http.response.status_code': 200, 'http.route': '/test', - 'http.scheme': 'http', - 'http.status_code': 200, - 'http.status_text': 'OK', + 'url.scheme': 'http', + 'http.response.status_text': 'OK', 'http.target': '/test?a=1&b=2', - 'http.user_agent': 'node', + 'user_agent.original': 'node', 'client.address': '::1', 'client.port': expect.any(Number), 'network.local.address': '::1', diff --git a/dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/instrument.mjs index 7cf67b82fc11..31da3f1dacfb 100644 --- a/dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/ignoreSpans-streamed/attributes/instrument.mjs @@ -7,6 +7,6 @@ Sentry.init({ tracesSampleRate: 1.0, transport: loggingTransport, traceLifecycle: 'stream', - ignoreSpans: [{ attributes: { 'http.method': 'POST' } }], + ignoreSpans: [{ attributes: { 'http.request.method': 'POST' } }], clientReportFlushInterval: 1_000, }); diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/test.ts index 2691d10294a5..27f4697b3b5d 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/test.ts @@ -19,7 +19,7 @@ describe('outgoing fetch', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 404, ADDED_PATH: '/api/v0', @@ -30,7 +30,7 @@ describe('outgoing fetch', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 404, ADDED_PATH: '/api/v1', @@ -41,7 +41,7 @@ describe('outgoing fetch', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v2`, status_code: 404, ADDED_PATH: '/api/v2', @@ -52,7 +52,7 @@ describe('outgoing fetch', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v3`, status_code: 404, ADDED_PATH: '/api/v3', diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/fetch-no-trace-propagation/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/fetch-no-trace-propagation/test.ts index dad27aa5dc17..5ffcdfb4cdd0 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/fetch-no-trace-propagation/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/fetch-no-trace-propagation/test.ts @@ -30,7 +30,7 @@ describe('outgoing fetch with tracePropagation disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 200, }, @@ -40,7 +40,7 @@ describe('outgoing fetch with tracePropagation disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 200, }, diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/test.ts index 96892353d2dd..adf08ca19664 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/test.ts @@ -19,7 +19,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 404, ADDED_PATH: '/api/v0', @@ -30,7 +30,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 404, ADDED_PATH: '/api/v1', @@ -41,7 +41,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v2`, status_code: 404, ADDED_PATH: '/api/v2', @@ -52,7 +52,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v3`, status_code: 404, ADDED_PATH: '/api/v3', diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/test.ts index 5ba5c63da74f..e4a592e5b571 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/test.ts @@ -30,7 +30,7 @@ describe('outgoing http with tracePropagation disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 200, }, @@ -40,7 +40,7 @@ describe('outgoing http with tracePropagation disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 200, }, diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/test.ts index a1a9ce5d51dc..df073d2c7ef0 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/test.ts @@ -48,7 +48,7 @@ describe('outgoing http requests with tracing & spans disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 200, ADDED_PATH: '/api/v0', @@ -59,7 +59,7 @@ describe('outgoing http requests with tracing & spans disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 200, ADDED_PATH: '/api/v1', @@ -70,7 +70,7 @@ describe('outgoing http requests with tracing & spans disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v2`, status_code: 200, ADDED_PATH: '/api/v2', @@ -81,7 +81,7 @@ describe('outgoing http requests with tracing & spans disabled', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v3`, status_code: 200, ADDED_PATH: '/api/v3', diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/test.ts index 4f6593f82e34..6bc9f3f06c6a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/test.ts @@ -48,7 +48,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v0`, status_code: 200, ADDED_PATH: '/api/v0', @@ -59,7 +59,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v1`, status_code: 200, ADDED_PATH: '/api/v1', @@ -70,7 +70,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v2`, status_code: 200, ADDED_PATH: '/api/v2', @@ -81,7 +81,7 @@ describe('outgoing http', () => { { category: 'http', data: { - 'http.method': 'GET', + 'http.request.method': 'GET', url: `${SERVER_URL}/api/v3`, status_code: 200, ADDED_PATH: '/api/v3', diff --git a/docs/migration/v11-end-state.md b/docs/migration/v11-end-state.md index fc606a040f1a..c0de5f29a3f8 100644 --- a/docs/migration/v11-end-state.md +++ b/docs/migration/v11-end-state.md @@ -615,6 +615,28 @@ If you reference these attributes in custom instrumentation, `beforeSendSpan`, d The `http.query` and `http.fragment` span attributes were renamed to `url.query` and `url.fragment`. +#### HTTP attributes + +Legacy HTTP span attributes were replaced by their current semantic-convention equivalents: + +| v10 attribute | v11 attribute | +| -------------------------------------- | --------------------------------- | +| `http.host` | `server.address` | +| `http.flavor` | `network.protocol.version` | +| `http.client_ip` | `client.address` | +| `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.response_content_length` | `http.response.body.size` | +| `http.decoded_response_content_length` | `http.response.body.decoded_size` | +| `http.response_transfer_size` | `http.response.size` | +| `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. + #### Network attributes Network-related span attributes now use the current Sentry semantic conventions, aligned across SDKs. If you query, transform, or alert on the legacy `net.*` fields, update those references: diff --git a/packages/browser-utils/src/performance/entries.ts b/packages/browser-utils/src/performance/entries.ts index a630c91885a6..d79710f4279f 100644 --- a/packages/browser-utils/src/performance/entries.ts +++ b/packages/browser-utils/src/performance/entries.ts @@ -10,7 +10,22 @@ import { spanToJSON, filterCollectedUrl, } from '@sentry/core'; -import { CODE_FILE_PATH, CODE_FUNCTION_NAME, SENTRY_OP, URL_DOMAIN, URL_FULL } from '@sentry/conventions/attributes'; +import { + CODE_FILE_PATH, + CODE_FUNCTION_NAME, + HTTP_REQUEST_SAME_ORIGIN, + HTTP_RESPONSE_BODY_SIZE, + HTTP_RESPONSE_SIZE, + HTTP_RESPONSE_STATUS_CODE, + NETWORK_CONNECTION_EFFECTIVE_TYPE, + NETWORK_CONNECTION_RTT, + NETWORK_CONNECTION_TYPE, + SENTRY_OP, + SERVER_ADDRESS, + URL_DOMAIN, + URL_FULL, + URL_SCHEME, +} from '@sentry/conventions/attributes'; import { BROWSER_PAINT, UI_LONG_ANIMATION_FRAME, UI_LONG_TASK } from '@sentry/conventions/op'; import { addPerformanceInstrumentationHandler, @@ -388,14 +403,14 @@ export function _addResourceSpans( const parsedUrl = parseUrl(resourceUrl); if (parsedUrl.protocol) { - attributes['url.scheme'] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it. + attributes[URL_SCHEME] = parsedUrl.protocol.split(':').pop(); // the protocol returned by parseUrl includes a :, but OTEL spec does not, so we remove it. } // `host` is the URL authority, so it can carry userinfo, which doesn't belong on either attribute. const host = parsedUrl.host?.replace(/^.*@/, ''); if (host) { - attributes['server.address'] = host; + attributes[SERVER_ADDRESS] = host; } // Unlike `server.address`, `url.domain` excludes the port. @@ -405,17 +420,17 @@ export function _addResourceSpans( attributes[URL_DOMAIN] = domain; } - attributes['url.same_origin'] = resourceUrl.includes(WINDOW.location.origin); + attributes[HTTP_REQUEST_SAME_ORIGIN] = resourceUrl.includes(WINDOW.location.origin); attributes[URL_FULL] = filterCollectedUrl(resourceUrl); _setResourceRequestAttributes(entry, attributes, [ // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStatus - ['responseStatus', 'http.response.status_code'], + ['responseStatus', HTTP_RESPONSE_STATUS_CODE], - ['transferSize', 'http.response_transfer_size'], - ['encodedBodySize', 'http.response_content_length'], - ['decodedBodySize', 'http.decoded_response_content_length'], + ['transferSize', HTTP_RESPONSE_SIZE], + ['encodedBodySize', HTTP_RESPONSE_BODY_SIZE], + ['decodedBodySize', 'http.response.body.decoded_size'], // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/renderBlockingStatus ['renderBlockingStatus', 'resource.render_blocking_status'], @@ -454,18 +469,18 @@ function _trackNavigator(span: Span, spanStreamingEnabled: boolean | undefined): if (connection) { if (connection.effectiveType) { span.setAttribute( - spanStreamingEnabled ? 'network.connection.effective_type' : 'effectiveConnectionType', + spanStreamingEnabled ? NETWORK_CONNECTION_EFFECTIVE_TYPE : 'effectiveConnectionType', connection.effectiveType, ); } if (connection.type) { - span.setAttribute(spanStreamingEnabled ? 'network.connection.type' : 'connectionType', connection.type); + span.setAttribute(spanStreamingEnabled ? NETWORK_CONNECTION_TYPE : 'connectionType', connection.type); } if (isMeasurementValue(connection.rtt)) { if (spanStreamingEnabled) { - span.setAttribute('network.connection.rtt', connection.rtt); + span.setAttribute(NETWORK_CONNECTION_RTT, connection.rtt); } else if (spanToJSON(span).attributes[SENTRY_OP] === 'pageload') { // Measurements are only recorded on the pageload span, matching the historical // behavior where `connection.rtt` was only flushed for pageload transactions. diff --git a/packages/browser-utils/test/performance/browserMetrics.test.ts b/packages/browser-utils/test/performance/browserMetrics.test.ts index d94fe3c7b6f6..10555be9cb44 100644 --- a/packages/browser-utils/test/performance/browserMetrics.test.ts +++ b/packages/browser-utils/test/performance/browserMetrics.test.ts @@ -243,14 +243,14 @@ describe('_addResourceSpans', () => { attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'resource.css', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', - ['http.decoded_response_content_length']: entry.decodedBodySize, - ['http.response_content_length']: entry.encodedBodySize, - ['http.response_transfer_size']: entry.transferSize, + ['http.response.body.decoded_size']: entry.decodedBodySize, + ['http.response.body.size']: entry.encodedBodySize, + ['http.response.size']: entry.transferSize, ['resource.render_blocking_status']: entry.renderBlockingStatus, ['url.scheme']: 'https', ['server.address']: 'example.com', ['url.domain']: 'example.com', - ['url.same_origin']: true, + ['http.request.same_origin']: true, ['url.full']: resourceEntryName, ['network.protocol.name']: 'http', ['network.protocol.version']: '1.1', @@ -310,7 +310,7 @@ describe('_addResourceSpans', () => { const json = spanToJSON(spans[0]!); expect(json.name).toBe('https://cdn.example.org/static/logo.png'); expect(json.attributes['url.full']).toBe('https://cdn.example.org/static/logo.png'); - expect(json.attributes['url.same_origin']).toBe(false); + expect(json.attributes['http.request.same_origin']).toBe(false); }); it('creates a variety of resource spans', () => { @@ -426,14 +426,14 @@ describe('_addResourceSpans', () => { attributes: expect.objectContaining({ [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'resource.css', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', - ['http.decoded_response_content_length']: entry.decodedBodySize, - ['http.response_content_length']: entry.encodedBodySize, - ['http.response_transfer_size']: entry.transferSize, + ['http.response.body.decoded_size']: entry.decodedBodySize, + ['http.response.body.size']: entry.encodedBodySize, + ['http.response.size']: entry.transferSize, ['resource.render_blocking_status']: entry.renderBlockingStatus, ['url.scheme']: 'https', ['server.address']: 'example.com', ['url.domain']: 'example.com', - ['url.same_origin']: true, + ['http.request.same_origin']: true, ['url.full']: resourceEntryName, ['network.protocol.name']: 'http', ['network.protocol.version']: '2', @@ -467,7 +467,7 @@ describe('_addResourceSpans', () => { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', 'server.address': 'example.com', 'url.domain': 'example.com', - 'url.same_origin': true, + 'http.request.same_origin': true, 'url.scheme': 'https', 'url.full': resourceEntryName, ['network.protocol.name']: 'http', @@ -519,7 +519,7 @@ describe('_addResourceSpans', () => { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics', 'server.address': 'example.com', 'url.domain': 'example.com', - 'url.same_origin': true, + 'http.request.same_origin': true, 'url.scheme': 'https', 'url.full': resourceEntryName, ['network.protocol.name']: 'http', @@ -798,7 +798,7 @@ describe('_setResourceRequestAttributes', () => { }); _setResourceRequestAttributes(entry, attributes, [ - ['transferSize', 'http.response_transfer_size'], + ['transferSize', 'http.response.size'], ['deliveryType', 'http.response_delivery_type'], ['renderBlockingStatus', 'resource.render_blocking_status'], ['responseStatus', 'http.response.status_code'], @@ -807,7 +807,7 @@ describe('_setResourceRequestAttributes', () => { ]); expect(attributes).toEqual({ - 'http.response_transfer_size': 0, + 'http.response.size': 0, 'http.request.redirect_start': 100, 'http.response.start': 200, 'http.response.status_code': 200, @@ -825,10 +825,10 @@ describe('_setResourceRequestAttributes', () => { renderBlockingStatus: 'non-blocking', }); - _setResourceRequestAttributes(entry, attributes, [['transferSize', 'http.response_transfer_size']]); + _setResourceRequestAttributes(entry, attributes, [['transferSize', 'http.response.size']]); expect(attributes).toEqual({ - 'http.response_transfer_size': 0, + 'http.response.size': 0, }); }); @@ -844,7 +844,7 @@ describe('_setResourceRequestAttributes', () => { }); _setResourceRequestAttributes(entry, attributes, [ - ['transferSize', 'http.response_transfer_size'], + ['transferSize', 'http.response.size'], ['deliveryType', 'http.response_delivery_type'], ['renderBlockingStatus', 'resource.render_blocking_status'], ]); diff --git a/packages/browser/src/integrations/fetchStreamPerformance.ts b/packages/browser/src/integrations/fetchStreamPerformance.ts index d03e668f89a6..96b2930c512c 100644 --- a/packages/browser/src/integrations/fetchStreamPerformance.ts +++ b/packages/browser/src/integrations/fetchStreamPerformance.ts @@ -1,4 +1,4 @@ -import { URL_FULL } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, URL_FULL } from '@sentry/conventions/attributes'; import type { IntegrationFn, Span } from '@sentry/core'; import { addFetchEndInstrumentationHandler, @@ -83,7 +83,7 @@ export const fetchStreamPerformanceIntegration = defineIntegration(() => { startTime: handlerData.endTimestamp, attributes: { [URL_FULL]: filterCollectedUrl(stripDataUrlContent(url)), - 'http.method': method, + [HTTP_REQUEST_METHOD]: method, type: 'fetch', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client.stream', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser.stream', diff --git a/packages/browser/src/tracing/request.ts b/packages/browser/src/tracing/request.ts index 2ba87f347d67..5ab075ca0620 100644 --- a/packages/browser/src/tracing/request.ts +++ b/packages/browser/src/tracing/request.ts @@ -43,7 +43,7 @@ import { } from '@sentry/browser-utils'; import type { BrowserClient } from '../client'; import { baggageHeaderHasSentryValues, createHeadersSafely, getFullURL, isPerformanceResourceTiming } from './utils'; -import { HTTP_METHOD, SERVER_ADDRESS, URL_FRAGMENT, URL_FULL, URL_QUERY } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, SERVER_ADDRESS, URL_FRAGMENT, URL_FULL, URL_QUERY } from '@sentry/conventions/attributes'; /** Options for Request Instrumentation */ export interface RequestInstrumentationOptions { @@ -163,7 +163,7 @@ export function instrumentOutgoingRequests(client: Client, _options?: Partial { expect(requestSpan).toBeDefined(); const requestSpanJson = utils.spanToJSON(requestSpan!); expect(requestSpanJson.name).toBe('QUERY https://example.com/rest/v1/users'); - expect(requestSpanJson.attributes[HTTP_METHOD]).toBe('QUERY'); + expect(requestSpanJson.attributes[HTTP_REQUEST_METHOD]).toBe('QUERY'); }); it('creates a QUERY XHR span with the QUERY method attribute', () => { @@ -123,7 +123,7 @@ describe('instrumentOutgoingRequests', () => { expect(requestSpan).toBeDefined(); const requestSpanJson = utils.spanToJSON(requestSpan!); expect(requestSpanJson.name).toBe('QUERY https://example.com/rest/v1/users'); - expect(requestSpanJson.attributes[HTTP_METHOD]).toBe('QUERY'); + expect(requestSpanJson.attributes[HTTP_REQUEST_METHOD]).toBe('QUERY'); }); describe('XHR trace header span', () => { diff --git a/packages/bun/test/integrations/bunHttpServer.test.ts b/packages/bun/test/integrations/bunHttpServer.test.ts index e959be856a2a..ed73e0c61a3c 100644 --- a/packages/bun/test/integrations/bunHttpServer.test.ts +++ b/packages/bun/test/integrations/bunHttpServer.test.ts @@ -1,5 +1,5 @@ import http from 'node:http'; -import { HTTP_METHOD } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD } from '@sentry/conventions/attributes'; import { getActiveSpan, getCurrentScope, getTraceData, SEMANTIC_ATTRIBUTE_SENTRY_OP, spanToJSON } from '@sentry/core'; import { afterAll, beforeAll, describe, expect, test } from 'bun:test'; import { init } from '../../src'; @@ -82,7 +82,7 @@ describe('Bun HTTP Server Integration', () => { expect(span).toBeDefined(); expect(span?.attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]).toBe('http.server'); expect(span?.name).toBe('QUERY /search'); - expect(span?.attributes[HTTP_METHOD]).toBe('QUERY'); + expect(span?.attributes[HTTP_REQUEST_METHOD]).toBe('QUERY'); }); test('isolates each incoming request with a distinct trace id', async () => { diff --git a/packages/core/src/fetch.ts b/packages/core/src/fetch.ts index fd46e87cea65..86f5ed517236 100644 --- a/packages/core/src/fetch.ts +++ b/packages/core/src/fetch.ts @@ -1,6 +1,7 @@ /* eslint-disable max-lines */ import { - HTTP_METHOD, + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_BODY_SIZE, SERVER_ADDRESS, SERVER_PORT, URL_FRAGMENT, @@ -297,7 +298,7 @@ function endSpan(span: Span, handlerData: HandlerDataFetch): void { if (contentLength) { const contentLengthNum = parseInt(contentLength); if (contentLengthNum > 0) { - span.setAttribute('http.response_content_length', contentLengthNum); + span.setAttribute(HTTP_RESPONSE_BODY_SIZE, contentLengthNum); } } } else if (handlerData.error) { @@ -366,7 +367,7 @@ function getFetchSpanAttributes( [URL_FULL]: filterCollectedUrl(stripDataUrlContent(url), client), type: 'fetch', // oxlint-disable-next-line typescript/no-deprecated - [HTTP_METHOD]: method, + [HTTP_REQUEST_METHOD]: method, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', }; diff --git a/packages/core/src/integrations/http/add-outgoing-request-breadcrumb.ts b/packages/core/src/integrations/http/add-outgoing-request-breadcrumb.ts index 77d8c045f922..1b365bf061ba 100644 --- a/packages/core/src/integrations/http/add-outgoing-request-breadcrumb.ts +++ b/packages/core/src/integrations/http/add-outgoing-request-breadcrumb.ts @@ -1,4 +1,4 @@ -import { HTTP_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; import { addBreadcrumb } from '../../breadcrumbs'; import { getBreadcrumbLogLevelFromHttpStatusCode } from '../../utils/breadcrumb-log-level'; import { filterCollectedUrlQuery } from '../../utils/data-collection/filterCollectedUrl'; @@ -26,7 +26,7 @@ export function addOutgoingRequestBreadcrumb( status_code: statusCode, url: getSanitizedUrlString(parsedUrl), // eslint-disable-next-line typescript/no-deprecated - [HTTP_METHOD]: request.method || 'GET', + [HTTP_REQUEST_METHOD]: request.method || 'GET', [URL_QUERY]: filterCollectedUrlQuery(getUrlQuery(parsedUrl.search)), [URL_FRAGMENT]: getUrlFragment(parsedUrl.hash), }, 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 7ca1a4f64f17..4be06fb6a161 100644 --- a/packages/core/src/integrations/http/get-outgoing-span-data.ts +++ b/packages/core/src/integrations/http/get-outgoing-span-data.ts @@ -6,8 +6,8 @@ import type { HttpClientRequest, HttpIncomingMessage } from './types'; import { getRequestUrlFromClientRequest } from './get-request-url'; import type { StartSpanOptions } from '../../types/startSpanOptions'; import { - HTTP_HOST, - HTTP_METHOD, + HTTP_RESPONSE_BODY_SIZE, + HTTP_RESPONSE_STATUS_CODE, HTTP_TARGET, NETWORK_LOCAL_ADDRESS, NETWORK_LOCAL_PORT, @@ -41,18 +41,13 @@ export function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpa return { name, attributes: { - // TODO(v11): Update these to the Sentry semantic attributes for urls. - // https://getsentry.github.io/sentry-conventions/attributes/ [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', [SENTRY_KIND]: 'client', [URL_FULL]: filterCollectedUrl(url), - /* eslint-disable typescript/no-deprecated */ - [HTTP_METHOD]: request.method, + // eslint-disable-next-line typescript/no-deprecated [HTTP_TARGET]: filterCollectedUrl(request.path || '/'), [SERVER_ADDRESS]: request.host, [SERVER_PORT]: typeof request.port === 'number' && !isNaN(request.port) ? request.port : undefined, - [HTTP_HOST]: request.getHeader('host') as string | undefined, - /* eslint-enable typescript/no-deprecated */ [USER_AGENT_ORIGINAL]: userAgent || undefined, ...attributes, }, @@ -68,15 +63,11 @@ export function setIncomingResponseSpanData(response: HttpIncomingMessage, span: const transport = httpVersion?.toUpperCase() !== 'QUIC' ? 'tcp' : 'udp'; span.setAttributes({ - 'http.response.status_code': statusCode, + [HTTP_RESPONSE_STATUS_CODE]: statusCode, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, - // TODO(v11): Update these to the Sentry semantic attributes for urls. - // https://getsentry.github.io/sentry-conventions/attributes/ - 'http.flavor': httpVersion, [NETWORK_TRANSPORT]: transport, - 'http.status_text': statusMessage?.toUpperCase(), - 'http.status_code': statusCode, + 'http.response.status_text': statusMessage?.toUpperCase(), ...getResponseContentLengthAttributes(response), ...getSocketAttrs(socket), }); @@ -100,7 +91,7 @@ function getResponseContentLengthAttributes(response: HttpIncomingMessage): Span const encoding = headers['content-encoding']; return length >= 0 ? encoding && encoding !== 'identity' - ? { 'http.response_content_length': length } - : { 'http.response_content_length_uncompressed': length } + ? { [HTTP_RESPONSE_BODY_SIZE]: length } + : { 'http.response.body.decoded_size': length } : {}; } diff --git a/packages/core/src/integrations/http/server-subscription.ts b/packages/core/src/integrations/http/server-subscription.ts index f89d528f4f69..8d22c81b25f5 100644 --- a/packages/core/src/integrations/http/server-subscription.ts +++ b/packages/core/src/integrations/http/server-subscription.ts @@ -39,6 +39,8 @@ import type { SpanStatus } from '../../types/spanStatus'; import { CLIENT_ADDRESS, CLIENT_PORT, + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, NETWORK_LOCAL_ADDRESS, NETWORK_LOCAL_PORT, NETWORK_PEER_ADDRESS, @@ -46,12 +48,16 @@ import { NETWORK_PROTOCOL_NAME, NETWORK_PROTOCOL_VERSION, NETWORK_TRANSPORT, + SENTRY_HTTP_PREFETCH, + SENTRY_KIND, SERVER_ADDRESS, SERVER_PORT, - SENTRY_KIND, SENTRY_SEGMENT_NAME_SOURCE, + HTTP_TARGET, URL_FULL, URL_PATH, + URL_SCHEME, + USER_AGENT_ORIGINAL, } from '@sentry/conventions/attributes'; import { filterCollectedUrl } from '../../utils/data-collection/filterCollectedUrl'; @@ -317,22 +323,19 @@ function buildServerSpanWrap( [CLIENT_PORT]: remotePort, [NETWORK_PEER_ADDRESS]: collectClientAddress ? remoteAddress : undefined, [NETWORK_PEER_PORT]: remotePort, - 'sentry.http.prefetch': isKnownPrefetchRequest(request) || undefined, - // Old Semantic Conventions attributes for compatibility + [SENTRY_HTTP_PREFETCH]: isKnownPrefetchRequest(request) || undefined, [URL_FULL]: filterCollectedUrl(fullUrl, client), [URL_PATH]: urlObj?.pathname ?? httpTargetWithoutQueryFragment, - 'http.method': method, - 'http.target': filterCollectedUrl( + // eslint-disable-next-line typescript/no-deprecated + [HTTP_TARGET]: filterCollectedUrl( urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, client, ), - 'http.host': host, + [HTTP_REQUEST_METHOD]: method, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, - 'http.client_ip': collectClientAddress ? getForwardedClientAddress(ips) : undefined, - 'http.user_agent': userAgent, - 'http.scheme': scheme, - 'http.flavor': httpVersion, + [USER_AGENT_ORIGINAL]: userAgent, + [URL_SCHEME]: scheme, [NETWORK_TRANSPORT]: httpVersion?.toUpperCase() === 'QUIC' ? 'udp' : 'tcp', ...getRequestContentLengthAttribute(request), ...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, dataCollectionOptions), @@ -352,9 +355,8 @@ function buildServerSpanWrap( isEnded = true; // set attributes that come from the response span.setAttributes({ - 'http.status_text': response.statusMessage?.toUpperCase(), - 'http.response.status_code': response.statusCode, - 'http.status_code': response.statusCode, + 'http.response.status_text': response.statusMessage?.toUpperCase(), + [HTTP_RESPONSE_STATUS_CODE]: response.statusCode, ...httpHeadersToSpanAttributes(headersToDict(response.headers), dataCollectionOptions, 'response'), }); span.setStatus(status); @@ -447,7 +449,7 @@ function getRequestContentLengthAttribute(request: HttpIncomingMessage): SpanAtt const encoding = headers['content-encoding']; return length >= 0 ? encoding && encoding !== 'identity' - ? { 'http.request_content_length': length } - : { 'http.request_content_length_uncompressed': length } + ? { 'http.request.body.size': length } + : { 'http.request.body.decoded_size': length } : {}; } diff --git a/packages/core/src/types/request.ts b/packages/core/src/types/request.ts index 8cc6719a7e2d..bbfddcc96e41 100644 --- a/packages/core/src/types/request.ts +++ b/packages/core/src/types/request.ts @@ -1,4 +1,4 @@ -import type { HTTP_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; +import type { HTTP_REQUEST_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; import type { WebFetchHeaders } from './webfetchapi'; /** @@ -28,8 +28,7 @@ export type SanitizedRequestData = { * {@link FetchBreadcrumbData}). Span attributes use `url.full` instead. */ url: string; - // oxlint-disable-next-line typescript/no-deprecated - [HTTP_METHOD]: string; + [HTTP_REQUEST_METHOD]: string; [URL_FRAGMENT]?: string; [URL_QUERY]?: string; }; diff --git a/packages/core/test/lib/fetch.test.ts b/packages/core/test/lib/fetch.test.ts index 844b49f851ce..ac6a8ab66041 100644 --- a/packages/core/test/lib/fetch.test.ts +++ b/packages/core/test/lib/fetch.test.ts @@ -489,7 +489,7 @@ describe('instrumentFetchRequest', () => { name: 'GET https://api.example.com/users/42', attributes: { type: 'fetch', - 'http.method': 'GET', + 'http.request.method': 'GET', 'sentry.origin': 'auto.http.fetch', 'sentry.op': 'http.client', [URL_FULL]: url, diff --git a/packages/core/test/lib/integrations/http/add-outgoing-request-breadcrumb.test.ts b/packages/core/test/lib/integrations/http/add-outgoing-request-breadcrumb.test.ts index a0032cce6f27..e23b1d59bc84 100644 --- a/packages/core/test/lib/integrations/http/add-outgoing-request-breadcrumb.test.ts +++ b/packages/core/test/lib/integrations/http/add-outgoing-request-breadcrumb.test.ts @@ -71,7 +71,7 @@ describe('addOutgoingRequestBreadcrumb', () => { expect.objectContaining({ data: expect.objectContaining({ url: 'http://example.com/api/test', - 'http.method': 'POST', + 'http.request.method': 'POST', status_code: 201, }), }), @@ -165,7 +165,7 @@ describe('addOutgoingRequestBreadcrumb', () => { addOutgoingRequestBreadcrumb(makeMockRequest({ method: undefined }), makeMockResponse()); const callArg = vi.mocked(breadcrumbsModule.addBreadcrumb).mock.calls[0]![0]; - expect(callArg.data?.['http.method']).toBe('GET'); + expect(callArg.data?.['http.request.method']).toBe('GET'); }); // Breadcrumbs never reach the span pipeline, so this is the only place `urlQueryParams` is applied to them. 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 72c8b22aa0e6..3ac6aae33141 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 @@ -6,7 +6,7 @@ import { import type { HttpClientRequest, HttpIncomingMessage } from '../../../../src/integrations/http/types'; import type { Span } from '../../../../src/types/span'; import { - HTTP_METHOD, + HTTP_REQUEST_METHOD, HTTP_TARGET, NETWORK_LOCAL_ADDRESS, NETWORK_LOCAL_PORT, @@ -76,11 +76,11 @@ describe('getOutgoingRequestSpanData', () => { expect(result.name).toMatch(/^POST /); }); - it('includes URL_FULL, HTTP_METHOD, HTTP_TARGET, and server endpoint attributes', () => { + it('includes URL_FULL, HTTP_REQUEST_METHOD, HTTP_TARGET, and server endpoint attributes', () => { const result = getOutgoingRequestSpanData(makeMockRequest()); expect(result.attributes).toMatchObject({ [URL_FULL]: 'http://example.com/api/test', - [HTTP_METHOD]: 'GET', + [HTTP_REQUEST_METHOD]: 'GET', [HTTP_TARGET]: '/api/test', [SERVER_ADDRESS]: 'example.com', [SERVER_PORT]: 80, @@ -122,18 +122,18 @@ describe('setIncomingResponseSpanData', () => { expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.response.status_code': 201 })); }); - it('sets network.protocol.version and http.flavor from httpVersion', () => { + it('sets network.protocol.version from httpVersion', () => { const span = makeMockSpan(); setIncomingResponseSpanData(makeMockResponse({ httpVersion: '2.0' }), span); - expect(span.setAttributes).toHaveBeenCalledWith( - expect.objectContaining({ 'network.protocol.version': '2.0', 'http.flavor': '2.0' }), - ); + expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'network.protocol.version': '2.0' })); }); - it('sets http.status_text from statusMessage', () => { + it('sets http.response.status_text from statusMessage', () => { const span = makeMockSpan(); setIncomingResponseSpanData(makeMockResponse({ statusMessage: 'Created' }), span); - expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.status_text': 'CREATED' })); + expect(span.setAttributes).toHaveBeenCalledWith( + expect.objectContaining({ 'http.response.status_text': 'CREATED' }), + ); }); it('uses tcp transport for non-QUIC connections', () => { @@ -170,9 +170,7 @@ describe('setIncomingResponseSpanData', () => { headers: { 'content-length': '42', 'content-encoding': 'identity' }, }); setIncomingResponseSpanData(response, span); - expect(span.setAttributes).toHaveBeenCalledWith( - expect.objectContaining({ 'http.response_content_length_uncompressed': 42 }), - ); + expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.response.body.decoded_size': 42 })); }); it('includes compressed content-length when content-encoding is gzip', () => { @@ -181,6 +179,6 @@ describe('setIncomingResponseSpanData', () => { headers: { 'content-length': '100', 'content-encoding': 'gzip' }, }); setIncomingResponseSpanData(response, span); - expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.response_content_length': 100 })); + expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.response.body.size': 100 })); }); }); 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 609cd7b343a3..6707418eb287 100644 --- a/packages/core/test/lib/integrations/http/server-subscription.test.ts +++ b/packages/core/test/lib/integrations/http/server-subscription.test.ts @@ -117,9 +117,8 @@ describe('getHttpServerSubscriptions', () => { op: 'http.server', origin: 'auto.http.server', data: expect.objectContaining({ - 'http.method': 'GET', + 'http.request.method': 'GET', 'http.response.status_code': 200, - 'http.status_code': 200, 'http.target': '/users/42?foo=bar', 'sentry.kind': 'server', 'sentry.op': 'http.server', @@ -182,19 +181,6 @@ describe('getHttpServerSubscriptions', () => { const data = transaction.contexts?.trace?.data; expect(data).not.toHaveProperty(CLIENT_ADDRESS); expect(data).not.toHaveProperty(NETWORK_PEER_ADDRESS); - // the deprecated alias of `client.address` carries the same IP, so it has to be gated too - expect(data).not.toHaveProperty('http.client_ip'); - }); - - it('reports the forwarded client address on the deprecated `http.client_ip` alias too', async () => { - server = http.createServer((_req, res) => res.end('ok')); - await new Promise(resolve => server.listen(0, '127.0.0.1', () => resolve())); - instrument(true); - - await makeRequest('/users/42', 'GET', { 'X-Forwarded-For': '203.0.113.7, 198.51.100.1' }); - const transaction = await waitForTransaction(); - - expect(transaction.contexts?.trace?.data).toEqual(expect.objectContaining({ 'http.client_ip': '203.0.113.7' })); }); // `http.target` is the deprecated alias of `url.full` and carries the same query string, so it has to diff --git a/packages/deno/test/deno-http.test.ts b/packages/deno/test/deno-http.test.ts index 9dc0aa4a4362..640e7eefaa0d 100644 --- a/packages/deno/test/deno-http.test.ts +++ b/packages/deno/test/deno-http.test.ts @@ -106,7 +106,7 @@ Deno.test({ await new Promise(resolve => server.close(() => resolve())); assertEquals(txn.transaction, 'QUERY /users/42'); - assertEquals(txn.contexts?.trace?.data?.['http.method'], 'QUERY'); + assertEquals(txn.contexts?.trace?.data?.['http.request.method'], 'QUERY'); assertEquals(txn.contexts?.trace?.data?.['http.response.status_code'], 200); assertEquals(txn.contexts?.trace?.data?.['network.protocol.name'], 'http'); assertEquals(txn.contexts?.trace?.data?.['network.protocol.version'], '1.1'); @@ -213,7 +213,7 @@ Deno.test({ httpClientSpan, `expected an http.client child span, got ops: ${parent.spans?.map(s => s.op).join(', ')}`, ); - assertEquals(httpClientSpan!.data?.['http.method'], 'QUERY'); + assertEquals(httpClientSpan!.data?.['http.request.method'], 'QUERY'); assertEquals(httpClientSpan!.data?.['http.response.status_code'], 200); }, }); diff --git a/packages/nestjs/src/integrations/wrap-route.ts b/packages/nestjs/src/integrations/wrap-route.ts index a16f8a744caf..906ba7172fc8 100644 --- a/packages/nestjs/src/integrations/wrap-route.ts +++ b/packages/nestjs/src/integrations/wrap-route.ts @@ -1,4 +1,4 @@ -import { HTTP_METHOD, HTTP_ROUTE, SENTRY_OP, URL_FULL } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, HTTP_ROUTE, SENTRY_OP, URL_FULL } from '@sentry/conventions/attributes'; import { FUNCTION } from '@sentry/conventions/op'; import type { SpanAttributes } from '@sentry/core'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan, filterCollectedUrl } from '@sentry/core'; @@ -97,7 +97,7 @@ export function wrapRequestContextHandler( [AttributeNames.VERSION]: moduleVersion || undefined, [HTTP_ROUTE]: httpRoute || undefined, // oxlint-disable-next-line typescript/no-deprecated - [HTTP_METHOD]: req.method || undefined, + [HTTP_REQUEST_METHOD]: req.method || undefined, [URL_FULL]: filterCollectedUrl(req.originalUrl || req.url || undefined), }; return startSpan({ name: spanName, attributes }, () => handler.apply(this, handlerArgs)); diff --git a/packages/nestjs/test/integrations/orchestrion-subscriber.test.ts b/packages/nestjs/test/integrations/orchestrion-subscriber.test.ts index d683cef828a8..93d42ededb4a 100644 --- a/packages/nestjs/test/integrations/orchestrion-subscriber.test.ts +++ b/packages/nestjs/test/integrations/orchestrion-subscriber.test.ts @@ -241,7 +241,7 @@ describe('NestJS orchestrion subscriber: request_context / request_handler', () 'nestjs.callback': 'getCats', 'nestjs.version': '10.4.1', 'http.route': '/cats', - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': '/cats?q=1', }); }); diff --git a/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts b/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts index ce4b793ccf2a..c7ce02b99195 100644 --- a/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts +++ b/packages/nextjs/src/server/enhanceHandleRequestRootSpan.ts @@ -47,7 +47,7 @@ export function enhanceHandleRequestRootSpan(span: MutableRootSpan): void { } // eslint-disable-next-line typescript/no-deprecated - const method = attributes[HTTP_METHOD] ?? attributes[HTTP_REQUEST_METHOD]; + const method = attributes[HTTP_REQUEST_METHOD] ?? attributes[HTTP_METHOD]; // eslint-disable-next-line typescript/no-deprecated const target = attributes[HTTP_TARGET]; const route = attributes[HTTP_ROUTE] || attributes[ATTR_NEXT_ROUTE]; diff --git a/packages/node/src/integrations/http/httpServerSpansIntegration.ts b/packages/node/src/integrations/http/httpServerSpansIntegration.ts index f1bee46b1a2d..f03a62c05f61 100644 --- a/packages/node/src/integrations/http/httpServerSpansIntegration.ts +++ b/packages/node/src/integrations/http/httpServerSpansIntegration.ts @@ -3,15 +3,9 @@ import { errorMonitor } from 'node:events'; import type { IncomingHttpHeaders } from 'node:http'; import { SENTRY_SEGMENT_NAME_SOURCE, - HTTP_CLIENT_IP, - HTTP_FLAVOR, - HTTP_HOST, - HTTP_METHOD, + HTTP_REQUEST_METHOD, HTTP_RESPONSE_STATUS_CODE, - HTTP_SCHEME, - HTTP_STATUS_CODE, HTTP_TARGET, - HTTP_USER_AGENT, CLIENT_ADDRESS, CLIENT_PORT, NETWORK_LOCAL_ADDRESS, @@ -24,11 +18,13 @@ import { SERVER_ADDRESS, SERVER_PORT, SENTRY_HTTP_PREFETCH, + SENTRY_KIND, URL_FRAGMENT, URL_FULL, URL_PATH, URL_QUERY, - SENTRY_KIND, + URL_SCHEME, + USER_AGENT_ORIGINAL, } from '@sentry/conventions/attributes'; import type { Event, @@ -145,7 +141,6 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions const headers = request.headers; const userAgent = headers['user-agent']; - const ips = headers['x-forwarded-for']; const httpVersion = request.httpVersion; const host = headers.host as string | undefined; const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, '$1') || 'localhost'; @@ -172,23 +167,18 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions [URL_PATH]: urlObj?.pathname ?? httpTargetWithoutQueryFragment, [URL_QUERY]: filterCollectedUrlQuery(query, client), [URL_FRAGMENT]: fragment, - // Old Semantic Conventions attributes - added for compatibility with what `@opentelemetry/instrumentation-http` output before - /* eslint-disable typescript/no-deprecated */ - [HTTP_METHOD]: normalizedRequest.method, + [HTTP_REQUEST_METHOD]: normalizedRequest.method, + // eslint-disable-next-line typescript/no-deprecated [HTTP_TARGET]: filterCollectedUrl( urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, client, ), - [HTTP_HOST]: host, + [USER_AGENT_ORIGINAL]: userAgent, + [URL_SCHEME]: scheme, [SERVER_ADDRESS]: hostname, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, - [HTTP_CLIENT_IP]: client.getDataCollectionOptions().userInfo ? getForwardedClientAddress(ips) : undefined, - [HTTP_USER_AGENT]: userAgent, - [HTTP_SCHEME]: scheme, - [HTTP_FLAVOR]: httpVersion, [NETWORK_TRANSPORT]: httpVersion?.toUpperCase() === 'QUIC' ? 'udp' : 'tcp', - /* eslint-enable typescript/no-deprecated */ ...getRequestContentLengthAttribute(request), ...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, client.getDataCollectionOptions()), }, @@ -238,7 +228,7 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions }, processEvent(event) { if (event.type === 'transaction') { - const statusCode = event.contexts?.trace?.data?.['http.response.status_code']; + const statusCode = event.contexts?.trace?.data?.[HTTP_RESPONSE_STATUS_CODE]; if (typeof statusCode === 'number') { // Drop transaction if it has a status code that should be ignored if (shouldFilterStatusCode(statusCode, ignoreStatusCodes)) { @@ -362,11 +352,11 @@ function getRequestContentLengthAttribute(request: HttpIncomingMessage): SpanAtt if (isCompressed(request.headers)) { return { - ['http.request_content_length']: length, + ['http.request.body.size']: length, }; } else { return { - ['http.request_content_length_uncompressed']: length, + ['http.request.body.decoded_size']: length, }; } } @@ -407,9 +397,7 @@ function getIncomingRequestAttributesOnResponse( const newAttributes: SpanAttributes = { [HTTP_RESPONSE_STATUS_CODE]: statusCode, - // eslint-disable-next-line typescript/no-deprecated - [HTTP_STATUS_CODE]: statusCode, - 'http.status_text': statusMessage?.toUpperCase(), + 'http.response.status_text': statusMessage?.toUpperCase(), }; if (collectClientAddress) { diff --git a/packages/node/src/utils/outgoingFetchRequest.ts b/packages/node/src/utils/outgoingFetchRequest.ts index 209eaddbd72a..af98b90a3f1d 100644 --- a/packages/node/src/utils/outgoingFetchRequest.ts +++ b/packages/node/src/utils/outgoingFetchRequest.ts @@ -1,4 +1,4 @@ -import { HTTP_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes'; import type { LRUMap, SanitizedRequestData, Span } from '@sentry/core'; import { filterCollectedUrlQuery, @@ -259,7 +259,7 @@ function getBreadcrumbData(request: UndiciRequest): Partial { data: { status_code: 200, url: 'https://example.com/api', - [HTTP_METHOD]: method, + [HTTP_REQUEST_METHOD]: method, 'url.query': undefined, 'url.fragment': undefined, }, diff --git a/packages/react-router/src/server/createServerInstrumentation.ts b/packages/react-router/src/server/createServerInstrumentation.ts index 95cfe91afb19..d00743799f10 100644 --- a/packages/react-router/src/server/createServerInstrumentation.ts +++ b/packages/react-router/src/server/createServerInstrumentation.ts @@ -82,7 +82,7 @@ export function createSentryServerInstrumentation( if (result.status === 'error' && result.error instanceof Error) { existingRootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); captureInstrumentationError(result, captureErrors, 'react_router.request_handler', { - 'http.method': info.request.method, + [HTTP_REQUEST_METHOD]: info.request.method, [URL_FULL]: pathname, }); } @@ -109,7 +109,7 @@ export function createSentryServerInstrumentation( if (result.status === 'error' && result.error instanceof Error) { span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); captureInstrumentationError(result, captureErrors, 'react_router.request_handler', { - 'http.method': info.request.method, + [HTTP_REQUEST_METHOD]: info.request.method, [URL_FULL]: pathname, }); } @@ -149,7 +149,7 @@ export function createSentryServerInstrumentation( if (result.status === 'error' && result.error instanceof Error) { span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); captureInstrumentationError(result, captureErrors, 'react_router.loader', { - 'http.method': info.request.method, + [HTTP_REQUEST_METHOD]: info.request.method, [URL_FULL]: urlPath, }); } @@ -177,7 +177,7 @@ export function createSentryServerInstrumentation( if (result.status === 'error' && result.error instanceof Error) { span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); captureInstrumentationError(result, captureErrors, 'react_router.action', { - 'http.method': info.request.method, + [HTTP_REQUEST_METHOD]: info.request.method, [URL_FULL]: urlPath, }); } @@ -225,7 +225,7 @@ export function createSentryServerInstrumentation( if (result.status === 'error' && result.error instanceof Error) { span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); captureInstrumentationError(result, captureErrors, 'react_router.middleware', { - 'http.method': info.request.method, + [HTTP_REQUEST_METHOD]: info.request.method, [URL_FULL]: urlPath, }); } diff --git a/packages/react-router/test/server/createServerInstrumentation.test.ts b/packages/react-router/test/server/createServerInstrumentation.test.ts index 174ff6c8cf40..2bc05251ea4a 100644 --- a/packages/react-router/test/server/createServerInstrumentation.test.ts +++ b/packages/react-router/test/server/createServerInstrumentation.test.ts @@ -165,7 +165,7 @@ describe('createSentryServerInstrumentation', () => { mechanism: { type: 'react_router.request_handler', handled: false, - data: { 'http.method': 'GET', 'url.full': '/api/users' }, + data: { 'http.request.method': 'GET', 'url.full': '/api/users' }, }, }); }); @@ -192,7 +192,7 @@ describe('createSentryServerInstrumentation', () => { mechanism: { type: 'react_router.request_handler', handled: false, - data: { 'http.method': 'GET', 'url.full': '/api/users' }, + data: { 'http.request.method': 'GET', 'url.full': '/api/users' }, }, }); }); @@ -520,7 +520,7 @@ describe('createSentryServerInstrumentation', () => { mechanism: { type: 'react_router.loader', handled: false, - data: { 'http.method': 'GET', 'url.full': '/test' }, + data: { 'http.request.method': 'GET', 'url.full': '/test' }, }, }); diff --git a/packages/remix/src/server/integrations/tracing-channel.ts b/packages/remix/src/server/integrations/tracing-channel.ts index b117b8aa4104..714082a35ecb 100644 --- a/packages/remix/src/server/integrations/tracing-channel.ts +++ b/packages/remix/src/server/integrations/tracing-channel.ts @@ -17,13 +17,12 @@ import { bindTracingChannelToSpan } from '@sentry/server-utils'; import { SENTRY_SEGMENT_NAME_SOURCE, CODE_FUNCTION_NAME, - HTTP_METHOD, HTTP_ROUTE, - HTTP_STATUS_CODE, URL_FULL, URL_PATH, SENTRY_KIND, SENTRY_OP, + HTTP_REQUEST_METHOD, HTTP_RESPONSE_STATUS_CODE, } from '@sentry/conventions/attributes'; import { FUNCTION } from '@sentry/conventions/op'; @@ -74,8 +73,7 @@ function getRequestAttributes(request: unknown): SpanAttributes { const { method, url } = request as Partial; const attributes: SpanAttributes = {}; if (typeof method === 'string') { - // oxlint-disable-next-line typescript/no-deprecated - attributes[HTTP_METHOD] = method; + attributes[HTTP_REQUEST_METHOD] = method; } if (typeof url === 'string') { const urlObject = parseStringToURLObject(url); @@ -105,8 +103,6 @@ function setResponseStatus(span: Span, result: unknown): void { } const status = (result as { status?: unknown }).status; if (typeof status === 'number') { - // oxlint-disable-next-line typescript/no-deprecated - span.setAttribute(HTTP_STATUS_CODE, status); span.setAttribute(HTTP_RESPONSE_STATUS_CODE, status); const spanStatus = getSpanStatusFromHttpCode(status); @@ -128,10 +124,8 @@ function enrichActiveSpanWithRoute(result: unknown): void { const route = matches[matches.length - 1]?.route; if (route?.path) { - // oxlint-disable-next-line typescript/no-deprecated span.setAttribute(HTTP_ROUTE, route.path); - // oxlint-disable-next-line typescript/no-deprecated - const method = spanToJSON(span).attributes[HTTP_METHOD]; + const method = spanToJSON(span).attributes[HTTP_REQUEST_METHOD]; span.updateName(typeof method === 'string' ? `${method} ${route.path}` : route.path); span.setAttribute(SENTRY_SEGMENT_NAME_SOURCE, 'route'); } @@ -145,8 +139,7 @@ function subscribeRequestHandler(): void { diagnosticsChannel.tracingChannel(remixChannels.REMIX_REQUEST_HANDLER), data => { const requestAttributes = getRequestAttributes(data.arguments[0]); - // oxlint-disable-next-line typescript/no-deprecated - const method = requestAttributes[HTTP_METHOD]; + const method = requestAttributes[HTTP_REQUEST_METHOD]; const path = requestAttributes[URL_PATH]; const hasUrlName = typeof method === 'string' && typeof path === 'string'; return startInactiveSpan({ diff --git a/packages/remix/test/server/tracing-channel-no-form-data.test.ts b/packages/remix/test/server/tracing-channel-no-form-data.test.ts index 6c42e24610e8..d8b5d1e9cbef 100644 --- a/packages/remix/test/server/tracing-channel-no-form-data.test.ts +++ b/packages/remix/test/server/tracing-channel-no-form-data.test.ts @@ -56,11 +56,11 @@ describe('remixIntegration with orchestrion (no form-data capture configured)', attributes: expect.objectContaining({ 'sentry.op': 'function', 'code.function.name': 'action', - 'http.method': 'POST', + 'http.request.method': 'POST', }), }), ); - expect(span.setAttribute).toHaveBeenCalledWith('http.status_code', 201); + expect(span.setAttribute).toHaveBeenCalledWith('http.response.status_code', 201); // No form-data capture configured, so no `remix.action_form_data.*` attribute is set. expect(span.setAttribute).not.toHaveBeenCalledWith('remix.action_form_data.actionType', expect.anything()); expect(span.end).toHaveBeenCalledTimes(1); diff --git a/packages/remix/test/server/tracing-channel.test.ts b/packages/remix/test/server/tracing-channel.test.ts index 72d7a6de1ea5..22b9e226b52d 100644 --- a/packages/remix/test/server/tracing-channel.test.ts +++ b/packages/remix/test/server/tracing-channel.test.ts @@ -50,12 +50,12 @@ describe('remixIntegration (Orchestrion-based)', () => { 'sentry.op': 'http.server', 'sentry.segment.name.source': 'url', 'code.function.name': 'requestHandler', - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://localhost/users', }), }), ); - expect(span.setAttribute).toHaveBeenCalledWith('http.status_code', 200); + expect(span.setAttribute).toHaveBeenCalledWith('http.response.status_code', 200); expect(span.setAttribute).toHaveBeenCalledWith('http.response.status_code', 200); expect(span.setStatus).toHaveBeenCalledWith({ code: 1 }); expect(span.end).toHaveBeenCalledTimes(1); @@ -72,7 +72,7 @@ describe('remixIntegration (Orchestrion-based)', () => { }); it('matchServerRoutes: enriches the active request span with the matched route', () => { - span = makeSpan({ 'http.method': 'GET' }); + span = makeSpan({ 'http.request.method': 'GET' }); getActiveSpanSpy.mockReturnValue(span); const ctx = { arguments: [[], '/users/123'], @@ -116,14 +116,14 @@ describe('remixIntegration (Orchestrion-based)', () => { 'sentry.origin': 'auto.http.remix', 'sentry.op': 'function', 'code.function.name': 'loader', - 'http.method': 'GET', + 'http.request.method': 'GET', 'url.full': 'http://localhost/users/123', 'match.route.id': 'routes/users.$userId', 'match.params.userId': '123', }), }), ); - expect(span.setAttribute).toHaveBeenCalledWith('http.status_code', 200); + expect(span.setAttribute).toHaveBeenCalledWith('http.response.status_code', 200); expect(span.end).toHaveBeenCalledTimes(1); }); @@ -155,13 +155,13 @@ describe('remixIntegration (Orchestrion-based)', () => { attributes: expect.objectContaining({ 'sentry.op': 'function', 'code.function.name': 'action', - 'http.method': 'POST', + 'http.request.method': 'POST', }), }), ); // The span ends only after the async form-data read resolves. await vi.waitFor(() => expect(span.end).toHaveBeenCalledTimes(1)); - expect(span.setAttribute).toHaveBeenCalledWith('http.status_code', 201); + expect(span.setAttribute).toHaveBeenCalledWith('http.response.status_code', 201); expect(span.setAttribute).toHaveBeenCalledWith('remix.action_form_data.actionType', 'create'); }); }); diff --git a/packages/replay-internal/test/fixtures/transaction.ts b/packages/replay-internal/test/fixtures/transaction.ts index 4ff283f32281..7b8e3c4bbf55 100644 --- a/packages/replay-internal/test/fixtures/transaction.ts +++ b/packages/replay-internal/test/fixtures/transaction.ts @@ -71,9 +71,9 @@ export function Transaction(traceId?: string, obj?: Partial): any { }, { data: { - 'http.response_transfer_size': 1097, - 'http.response_content_length': 797, - 'http.decoded_response_content_length': 1885, + 'http.response.size': 1097, + 'http.response.body.size': 797, + 'http.response.body.decoded_size': 1885, 'resource.render_blocking_status': 'non-blocking', }, description: '/favicon.ico', diff --git a/packages/server-utils/src/integrations/aws-sdk/index.ts b/packages/server-utils/src/integrations/aws-sdk/index.ts index 1f6289cbb9f8..a27294cc145f 100644 --- a/packages/server-utils/src/integrations/aws-sdk/index.ts +++ b/packages/server-utils/src/integrations/aws-sdk/index.ts @@ -5,7 +5,6 @@ import { _AWS_REQUEST_ID as AWS_REQUEST_ID, AWS_REQUEST_EXTENDED_ID, CLOUD_REGION, - HTTP_STATUS_CODE, SENTRY_KIND, HTTP_RESPONSE_STATUS_CODE, } from '@sentry/conventions/attributes'; @@ -56,8 +55,6 @@ function setMetadataAttributes(span: Span, metadata: Record | undef span.setAttribute(AWS_REQUEST_ID, metadata.requestId); } if (metadata.httpStatusCode) { - // oxlint-disable-next-line typescript/no-deprecated - span.setAttribute(HTTP_STATUS_CODE, metadata.httpStatusCode); span.setAttribute(HTTP_RESPONSE_STATUS_CODE, metadata.httpStatusCode); } if (metadata.extendedRequestId) { diff --git a/packages/server-utils/src/integrations/hapi-utils.ts b/packages/server-utils/src/integrations/hapi-utils.ts index dd67a6f36e89..83ab15372097 100644 --- a/packages/server-utils/src/integrations/hapi-utils.ts +++ b/packages/server-utils/src/integrations/hapi-utils.ts @@ -30,8 +30,7 @@ import type { ServerRoute, ServerRouteOptions, } from './hapi-types'; -// eslint-disable-next-line typescript/no-deprecated -- TODO(v11): Replace deprecated attributes -import { HTTP_METHOD, HTTP_ROUTE } from '@sentry/conventions/attributes'; +import { HTTP_REQUEST_METHOD, HTTP_ROUTE } from '@sentry/conventions/attributes'; import { AttributeNames, handlerPatched, HapiLayerType, HapiLifecycleMethodNames } from './hapi-types'; import { setHttpServerSpanRouteAttribute } from '../utils/setHttpServerSpanRouteAttribute'; @@ -70,8 +69,7 @@ const isPatchableExtMethod = ( export const getRouteMetadata = (route: ServerRoute, pluginName?: string): SpanMetadata => { const attributes: SpanAttributes = { [HTTP_ROUTE]: route.path, - // eslint-disable-next-line typescript/no-deprecated -- TODO(v11): Replace deprecated attributes - [HTTP_METHOD]: route.method, + [HTTP_REQUEST_METHOD]: route.method, }; if (pluginName) { diff --git a/packages/server-utils/test/integrations/hapi-utils.test.ts b/packages/server-utils/test/integrations/hapi-utils.test.ts index 836cb335314b..0bc03f907807 100644 --- a/packages/server-utils/test/integrations/hapi-utils.test.ts +++ b/packages/server-utils/test/integrations/hapi-utils.test.ts @@ -15,7 +15,7 @@ describe('getRouteMetadata', () => { name: 'GET /users/{id}', attributes: { 'http.route': '/users/{id}', - 'http.method': 'get', + 'http.request.method': 'get', 'hapi.type': 'router', }, }); @@ -26,7 +26,7 @@ describe('getRouteMetadata', () => { name: 'GET /users/{id}', attributes: { 'http.route': '/users/{id}', - 'http.method': 'get', + 'http.request.method': 'get', 'hapi.type': 'plugin', 'hapi.plugin.name': 'my-plugin', }, diff --git a/packages/sveltekit/src/server-common/handle.ts b/packages/sveltekit/src/server-common/handle.ts index 82ac28bf66a1..11da9c4b8a08 100644 --- a/packages/sveltekit/src/server-common/handle.ts +++ b/packages/sveltekit/src/server-common/handle.ts @@ -23,7 +23,13 @@ import { import type { Handle, ResolveOptions } from '@sveltejs/kit'; import { DEBUG_BUILD } from '../common/debug-build'; import { getTracePropagationData, sendErrorToSentry } from './utils'; -import { SENTRY_SEGMENT_NAME_SOURCE, HTTP_ROUTE, URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; +import { + SENTRY_SEGMENT_NAME_SOURCE, + HTTP_REQUEST_METHOD, + HTTP_ROUTE, + URL_FULL, + URL_PATH, +} from '@sentry/conventions/attributes'; export type SentryHandleOptions = { /** @@ -213,7 +219,7 @@ async function instrumentHandle( attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.sveltekit', [SENTRY_SEGMENT_NAME_SOURCE]: routeId ? 'route' : 'url', - 'http.method': event.request.method, + [HTTP_REQUEST_METHOD]: event.request.method, [URL_FULL]: filterCollectedUrl(event.url.href), [URL_PATH]: event.url.pathname, ...(routeId && { diff --git a/packages/sveltekit/src/server-common/load.ts b/packages/sveltekit/src/server-common/load.ts index 8bd5aa4b60c6..93af6ba989dc 100644 --- a/packages/sveltekit/src/server-common/load.ts +++ b/packages/sveltekit/src/server-common/load.ts @@ -1,5 +1,10 @@ import { addNonEnumerableProperty, flushIfServerless, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core'; -import { SENTRY_SEGMENT_NAME_SOURCE, CODE_FUNCTION_NAME, SENTRY_OP } from '@sentry/conventions/attributes'; +import { + SENTRY_SEGMENT_NAME_SOURCE, + CODE_FUNCTION_NAME, + HTTP_REQUEST_METHOD, + SENTRY_OP, +} from '@sentry/conventions/attributes'; import { FUNCTION } from '@sentry/conventions/op'; import type { LoadEvent, ServerLoadEvent } from '@sveltejs/kit'; import type { SentryWrappedFlag } from '../common/utils'; @@ -105,7 +110,7 @@ export function wrapServerLoadWithSentry any>(origSe [CODE_FUNCTION_NAME]: 'load', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.sveltekit.server', [SENTRY_SEGMENT_NAME_SOURCE]: routeId ? 'route' : 'url', - 'http.method': event.request.method, + [HTTP_REQUEST_METHOD]: event.request.method, }, name: routeId ? routeId : event.url.pathname, }, diff --git a/packages/sveltekit/test/server-common/load.test.ts b/packages/sveltekit/test/server-common/load.test.ts index 04ad4a96787f..9fe29889226c 100644 --- a/packages/sveltekit/test/server-common/load.test.ts +++ b/packages/sveltekit/test/server-common/load.test.ts @@ -258,7 +258,7 @@ describe('wrapServerLoadWithSentry calls `startSpan`', () => { [SENTRY_SEGMENT_NAME_SOURCE]: 'url', [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function', 'code.function.name': 'load', - 'http.method': 'GET', + 'http.request.method': 'GET', 'sentry.sample_rate': 1, }, op: 'function',