diff --git a/MIGRATION.md b/MIGRATION.md index 66a283adb042..d6c102b55ee9 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -796,6 +796,8 @@ Legacy HTTP span attributes were replaced by their current semantic-convention e On server-side HTTP spans, the `content-length` header is now always reported as `http.request.body.size`/`http.response.body.size` instead of switching to `http.request_body_size_uncompressed` when the no encoding was present. +The `http.request.header.`/`http.response.header.` attributes now write the header name lowercased as previously but no longer replaces dashes (`-`) with underscores (`_`). For example, the SDK now sets `http.request.header.user-agent` rather than `http.request.header.user_agent`. The same applies to the cookie names in `http.request.header.cookie.` and `http.request.header.set-cookie.`. + #### 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/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts b/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts index 8c6b18c3931d..de670f15cea1 100644 --- a/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts @@ -229,15 +229,15 @@ it('sends a streamed span envelope with correct spans for a manually started spa type: 'string', value: '*/*', }, - 'http.request.header.accept_encoding': { + 'http.request.header.accept-encoding': { type: 'string', value: 'br, gzip', }, - 'http.request.header.accept_language': { + 'http.request.header.accept-language': { type: 'string', value: '*', }, - 'http.request.header.cf_connecting_ip': { + 'http.request.header.cf-connecting-ip': { type: 'string', value: '127.0.0.1', }, @@ -249,11 +249,11 @@ it('sends a streamed span envelope with correct spans for a manually started spa type: 'string', value: expect.stringMatching(/^localhost:.+$/), }, - 'http.request.header.sec_fetch_mode': { + 'http.request.header.sec-fetch-mode': { type: 'string', value: 'cors', }, - 'http.request.header.user_agent': { + 'http.request.header.user-agent': { type: 'string', value: 'node', }, diff --git a/dev-packages/e2e-tests/test-applications/astro-4/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-4/tests/tracing.dynamic.test.ts index 6161c6391da4..d9ffda6a1c68 100644 --- a/dev-packages/e2e-tests/test-applications/astro-4/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-4/tests/tracing.dynamic.test.ts @@ -62,10 +62,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'url.full': { value: expect.stringContaining('/test-ssr'), type: 'string' }, // demonstrates that the request data integration can extract headers 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -153,10 +153,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/myUsername123'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // HTTP client span - with span streaming only the domain is kept in the name, the URL lives in @@ -175,10 +175,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); @@ -216,10 +216,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/catchAll/hell0/whatever-do'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -254,10 +254,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/settings'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts index 332699bfc5d9..ad56501fc6f3 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts @@ -62,10 +62,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'url.full': { value: expect.stringContaining('/test-ssr'), type: 'string' }, // demonstrates that the request data integration can extract headers 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -153,10 +153,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/myUsername123'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // HTTP client span - with span streaming only the domain is kept in the name, the URL lives in @@ -175,10 +175,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); @@ -216,10 +216,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/catchAll/hell0/whatever-do'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -254,10 +254,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/settings'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts index 7b339a3b3911..9cc43ad5b6d3 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts @@ -56,10 +56,10 @@ test.describe('tracing in static routes with server islands', () => { 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // unfortunately, the server island trace id is not the same as the client pageload trace id diff --git a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/tracing.dynamic.test.ts index 8cb201e2cb70..fe78ed789bf1 100644 --- a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/tracing.dynamic.test.ts @@ -61,10 +61,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'sentry.sdk.name': { value: 'sentry.javascript.cloudflare', type: 'string' }, // demonstrates that the request data integration can extract headers 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'br, gzip', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'br, gzip', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -152,10 +152,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/myUsername123'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'br, gzip', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'br, gzip', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // HTTP client span - with span streaming only the domain is kept in the name, the URL lives in @@ -172,7 +172,7 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.op': { value: 'http.server', type: 'string' }, 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'br, gzip', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'br, gzip', type: 'string' }, }); }); @@ -210,10 +210,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/catchAll/hell0/whatever-do'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'br, gzip', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'br, gzip', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -248,10 +248,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/settings'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'br, gzip', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'br, gzip', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.dynamic.test.ts index 04ddd49118cb..37bc5aa93360 100644 --- a/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.dynamic.test.ts @@ -62,10 +62,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'url.full': { value: expect.stringContaining('/test-ssr'), type: 'string' }, // demonstrates that the request data integration can extract headers 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -153,10 +153,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/myUsername123'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // HTTP client span - with span streaming only the domain is kept in the name, the URL lives in @@ -176,10 +176,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/api/user/myUsername123.json'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); @@ -217,10 +217,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/catchAll/hell0/whatever-do'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -255,10 +255,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/settings'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.serverIslands.test.ts b/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.serverIslands.test.ts index 40ddce1cbe6c..4947ba4f65e0 100644 --- a/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.serverIslands.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-6/tests/tracing.serverIslands.test.ts @@ -56,10 +56,10 @@ test.describe('tracing in static routes with server islands', () => { 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // unfortunately, the server island trace id is not the same as the client pageload trace id diff --git a/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.dynamic.test.ts index b2ee39556e3d..103c4d2f083d 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.dynamic.test.ts @@ -79,10 +79,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'sentry.segment.name.source': 'route', 'url.full': expect.stringContaining('/test-ssr'), 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', - 'http.request.header.accept_language': 'en-US', - 'http.request.header.sec_fetch_mode': 'navigate', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-language': 'en-US', + 'http.request.header.sec-fetch-mode': 'navigate', + 'http.request.header.user-agent': expect.any(String), }, op: 'http.server', origin: 'auto.http.astro', @@ -231,10 +231,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': 'route', 'url.full': expect.stringContaining('/user-page/myUsername123'), 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', - 'http.request.header.accept_language': 'en-US', - 'http.request.header.sec_fetch_mode': 'navigate', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-language': 'en-US', + 'http.request.header.sec-fetch-mode': 'navigate', + 'http.request.header.user-agent': expect.any(String), }, }, }, @@ -269,10 +269,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': 'route', 'url.full': expect.stringContaining('/api/user/myUsername123.json'), 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate', - 'http.request.header.accept_language': '*', - 'http.request.header.sec_fetch_mode': 'cors', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate', + 'http.request.header.accept-language': '*', + 'http.request.header.sec-fetch-mode': 'cors', + 'http.request.header.user-agent': expect.any(String), }, }, }, @@ -326,10 +326,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': 'route', 'url.full': expect.stringContaining('/catchAll/hell0/whatever-do'), 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', - 'http.request.header.accept_language': 'en-US', - 'http.request.header.sec_fetch_mode': 'navigate', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-language': 'en-US', + 'http.request.header.sec-fetch-mode': 'navigate', + 'http.request.header.user-agent': expect.any(String), }, }, }, @@ -383,10 +383,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': 'route', 'url.full': expect.stringContaining('/user-page/settings'), 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', - 'http.request.header.accept_language': 'en-US', - 'http.request.header.sec_fetch_mode': 'navigate', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-language': 'en-US', + 'http.request.header.sec-fetch-mode': 'navigate', + 'http.request.header.user-agent': expect.any(String), }, }, }, diff --git a/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.serverIslands.test.ts b/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.serverIslands.test.ts index 2d64bdc51710..e713662b1843 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.serverIslands.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7-static/tests/tracing.serverIslands.test.ts @@ -71,10 +71,10 @@ test.describe('tracing in static routes with server islands', () => { 'sentry.origin': 'auto.http.astro', 'sentry.segment.name.source': 'route', 'http.request.header.accept': expect.any(String), - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', - 'http.request.header.accept_language': 'en-US', - 'http.request.header.sec_fetch_mode': 'cors', - 'http.request.header.user_agent': expect.any(String), + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-language': 'en-US', + 'http.request.header.sec-fetch-mode': 'cors', + 'http.request.header.user-agent': expect.any(String), }), op: 'http.server', origin: 'auto.http.astro', diff --git a/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.dynamic.test.ts index 7048939c70c4..7b5325dc3c89 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.dynamic.test.ts @@ -59,10 +59,10 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => { 'url.full': { value: expect.stringContaining('/test-ssr'), type: 'string' }, // demonstrates that the request data integration can extract headers 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -144,10 +144,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/myUsername123'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // HTTP client span - with span streaming only the domain is kept in the name, the URL lives in @@ -167,10 +167,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/api/user/myUsername123.json'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); @@ -202,10 +202,10 @@ test.describe('nested SSR routes (client, server, server request)', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/catchAll/hell0/whatever-do'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); }); @@ -237,10 +237,10 @@ test.describe('parametrized vs static paths', () => { 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'url.full': { value: expect.stringContaining('/user-page/settings'), type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'navigate', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'navigate', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.serverIslands.test.ts b/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.serverIslands.test.ts index 5508894885ed..bd9e0813277e 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.serverIslands.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7/tests/tracing.serverIslands.test.ts @@ -53,10 +53,10 @@ test.describe('tracing in static routes with server islands', () => { 'sentry.origin': { value: 'auto.http.astro', type: 'string' }, 'sentry.segment.name.source': { value: 'route', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, - 'http.request.header.accept_language': { value: 'en-US', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate, br, zstd', type: 'string' }, + 'http.request.header.accept-language': { value: 'en-US', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); // unfortunately, the server island trace id is not the same as the client pageload trace id diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-mcp/tests/index.test.ts b/dev-packages/e2e-tests/test-applications/cloudflare-mcp/tests/index.test.ts index 549e39ce4609..64a42cc105ab 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-mcp/tests/index.test.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-mcp/tests/index.test.ts @@ -71,7 +71,7 @@ test('sends spans for MCP 2026-07-28 tool calls', async ({ baseURL }) => { expect(requestSpan.attributes['server.address']?.value).toBe('localhost'); expect(requestSpan.attributes['http.request.body.size']?.value).toBe(341); expect(requestSpan.attributes['user_agent.original']?.value).toBe('node'); - expect(requestSpan.attributes['http.request.header.content_type']?.value).toBe('application/json'); + expect(requestSpan.attributes['http.request.header.content-type']?.value).toBe('application/json'); expect(requestSpan.attributes['network.protocol.name']?.value).toBe('http'); expect(requestSpan.attributes['network.protocol.version']?.value).toBe('1.1'); expect(requestSpan.attributes['http.response.status_code']?.value).toBe(200); diff --git a/dev-packages/e2e-tests/test-applications/deno/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/deno/tests/transactions.test.ts index cdc275e09c38..3b219c52262a 100644 --- a/dev-packages/e2e-tests/test-applications/deno/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno/tests/transactions.test.ts @@ -41,11 +41,11 @@ const SEGMENT_SPAN = { type: 'string', value: '*/*', }, - 'http.request.header.accept_encoding': { + 'http.request.header.accept-encoding': { type: 'string', value: 'gzip, deflate', }, - 'http.request.header.accept_language': { + 'http.request.header.accept-language': { type: 'string', value: '*', }, @@ -57,11 +57,11 @@ const SEGMENT_SPAN = { type: 'string', value: expect.stringMatching(/^localhost:\d+$/), }, - 'http.request.header.sec_fetch_mode': { + 'http.request.header.sec-fetch-mode': { type: 'string', value: 'cors', }, - 'http.request.header.user_agent': { + 'http.request.header.user-agent': { type: 'string', value: 'node', }, @@ -69,7 +69,7 @@ const SEGMENT_SPAN = { type: 'string', value: 'GET', }, - 'http.response.header.content_type': { + 'http.response.header.content-type': { type: 'string', value: 'application/json', }, diff --git a/dev-packages/e2e-tests/test-applications/elysia-node/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/elysia-node/tests/spans.test.ts index 300c2dcab0b7..556375501d6a 100644 --- a/dev-packages/e2e-tests/test-applications/elysia-node/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/elysia-node/tests/spans.test.ts @@ -217,5 +217,5 @@ test('Captures request metadata for POST requests', async ({ baseURL, request }) expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST'); expect(segmentEvent.attributes['url.full']?.value).toEqual(expect.stringContaining('/test-post')); - expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json'); + expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json'); }); diff --git a/dev-packages/e2e-tests/test-applications/hono-4/tests/route-patterns.test.ts b/dev-packages/e2e-tests/test-applications/hono-4/tests/route-patterns.test.ts index 2869530da624..8c353dde7a1e 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/tests/route-patterns.test.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/tests/route-patterns.test.ts @@ -149,7 +149,7 @@ test.describe('request data extraction', () => { const segment = await segmentPromise; expect(segment.attributes['http.request.method']?.value).toBe('POST'); expect(segment.attributes['url.full']?.value).toContain(PREFIX); - expect(segment.attributes['http.request.header.x_custom_header']?.value).toBe('test-value'); + expect(segment.attributes['http.request.header.x-custom-header']?.value).toBe('test-value'); }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts index 34766b3c1a71..e3129513bae1 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11-static/tests/transactions.test.ts @@ -40,12 +40,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', - 'http.request.header.accept_encoding': 'gzip, deflate', - 'http.request.header.accept_language': '*', + 'http.request.header.accept-encoding': 'gzip, deflate', + 'http.request.header.accept-language': '*', 'http.request.header.connection': 'keep-alive', 'http.request.header.host': expect.any(String), - 'http.request.header.sec_fetch_mode': 'cors', - 'http.request.header.user_agent': 'node', + 'http.request.header.sec-fetch-mode': 'cors', + 'http.request.header.user-agent': 'node', }, op: 'http.server', span_id: expect.stringMatching(/[a-f0-9]{16}/), 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 cb2ca7ed9629..d63b55c1282c 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 @@ -63,12 +63,12 @@ function testRequestHeaderAttributes(): Record { return { 'user_agent.original': { type: 'string', value: expect.any(String) }, 'http.request.header.accept': { type: 'string', value: '*/*' }, - 'http.request.header.accept_encoding': { type: 'string', value: 'gzip, deflate' }, - 'http.request.header.accept_language': { type: 'string', value: '*' }, + 'http.request.header.accept-encoding': { type: 'string', value: 'gzip, deflate' }, + 'http.request.header.accept-language': { type: 'string', value: '*' }, 'http.request.header.connection': { type: 'string', value: 'keep-alive' }, 'http.request.header.host': { type: 'string', value: expect.any(String) }, - 'http.request.header.sec_fetch_mode': { type: 'string', value: 'cors' }, - 'http.request.header.user_agent': { type: 'string', value: 'node' }, + 'http.request.header.sec-fetch-mode': { type: 'string', value: 'cors' }, + 'http.request.header.user-agent': { type: 'string', value: 'node' }, }; } @@ -139,7 +139,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.path': { type: 'string', value: `/test-inbound-headers/${id}` }, 'http.request.header.connection': { type: 'string', value: 'keep-alive' }, 'http.request.header.host': { type: 'string', value: expect.any(String) }, - 'http.request.header.sentry_trace': { + 'http.request.header.sentry-trace': { type: 'string', value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/pageload-tracing.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/pageload-tracing.test.ts index 23077e6f8b9b..445ab706f934 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/pageload-tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/pageload-tracing.test.ts @@ -23,7 +23,7 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => return ( span.name === 'GET /pageload-tracing' && span.is_segment && - span.attributes['http.request.header.x_request_id']?.value === 'nextjs-789' + span.attributes['http.request.header.x-request-id']?.value === 'nextjs-789' ); }); @@ -41,11 +41,11 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => const serverSpan = await serverSpanPromise; expect(serverSpan.attributes).toMatchObject({ - 'http.request.header.user_agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, - 'http.request.header.content_type': { value: 'text/html', type: 'string' }, - 'http.request.header.x_nextjs_test': { value: 'nextjs-header-value', type: 'string' }, + 'http.request.header.user-agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, + 'http.request.header.content-type': { value: 'text/html', type: 'string' }, + 'http.request.header.x-nextjs-test': { value: 'nextjs-header-value', type: 'string' }, 'http.request.header.accept': { value: 'text/html, application/xhtml+xml', type: 'string' }, - 'http.request.header.x_framework': { value: 'Next.js', type: 'string' }, - 'http.request.header.x_request_id': { value: 'nextjs-789', type: 'string' }, + 'http.request.header.x-framework': { value: 'Next.js', type: 'string' }, + 'http.request.header.x-request-id': { value: 'nextjs-789', type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/route-handler.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/route-handler.test.ts index 6a276032723f..869d343e0494 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/route-handler.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/route-handler.test.ts @@ -16,7 +16,7 @@ test('Should create a span for node route handlers', async ({ request }) => { // This is flaking on dev mode if (process.env.TEST_ENV !== 'development' && process.env.TEST_ENV !== 'dev-turbopack') { - expect(routehandlerSpan.attributes['http.request.header.x_charly']?.value).toBe('gomez'); + expect(routehandlerSpan.attributes['http.request.header.x-charly']?.value).toBe('gomez'); } }); @@ -35,7 +35,7 @@ test('Should create a span for edge route handlers', async ({ request }) => { expect(routehandlerSpan.status).toBe('ok'); expect(getSpanOp(routehandlerSpan)).toBe('http.server'); - expect(routehandlerSpan.attributes['http.request.header.x_charly']?.value).toBe('gomez'); + expect(routehandlerSpan.attributes['http.request.header.x-charly']?.value).toBe('gomez'); }); test('Should create a span for static route handlers', async ({ request }) => { diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/pageload-tracing.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/pageload-tracing.test.ts index db62f9c5decd..b1e6c36266b9 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/pageload-tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/pageload-tracing.test.ts @@ -25,7 +25,7 @@ test.skip('extracts HTTP request headers as span attributes', async ({ baseURL } return ( span.name === 'GET /pageload-tracing' && span.is_segment && - span.attributes['http.request.header.x_request_id']?.value === 'nextjs-789' + span.attributes['http.request.header.x-request-id']?.value === 'nextjs-789' ); }); @@ -43,11 +43,11 @@ test.skip('extracts HTTP request headers as span attributes', async ({ baseURL } const serverSpan = await serverSpanPromise; expect(serverSpan.attributes).toMatchObject({ - 'http.request.header.user_agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, - 'http.request.header.content_type': { value: 'text/html', type: 'string' }, - 'http.request.header.x_nextjs_test': { value: 'nextjs-header-value', type: 'string' }, + 'http.request.header.user-agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, + 'http.request.header.content-type': { value: 'text/html', type: 'string' }, + 'http.request.header.x-nextjs-test': { value: 'nextjs-header-value', type: 'string' }, 'http.request.header.accept': { value: 'text/html, application/xhtml+xml', type: 'string' }, - 'http.request.header.x_framework': { value: 'Next.js', type: 'string' }, - 'http.request.header.x_request_id': { value: 'nextjs-789', type: 'string' }, + 'http.request.header.x-framework': { value: 'Next.js', type: 'string' }, + 'http.request.header.x-request-id': { value: 'nextjs-789', type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/route-handler.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/route-handler.test.ts index afaa0fe899c3..a478d0be69b5 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/route-handler.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/route-handler.test.ts @@ -33,5 +33,5 @@ test('Should create a span for edge route handlers', async ({ request }) => { expect(routehandlerSpan.status).toBe('ok'); expect(getSpanOp(routehandlerSpan)).toBe('http.server'); - expect(routehandlerSpan.attributes['http.request.header.x_charly']?.value).toBe('gomez'); + expect(routehandlerSpan.attributes['http.request.header.x-charly']?.value).toBe('gomez'); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/pageload-tracing.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/pageload-tracing.test.ts index 036adea9d4b1..37c87a699414 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/pageload-tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/pageload-tracing.test.ts @@ -43,12 +43,12 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => expect(serverTransaction.contexts?.trace?.data).toEqual( expect.objectContaining({ - 'http.request.header.user_agent': 'Custom-NextJS-Agent/15.0', - 'http.request.header.content_type': 'text/html', - 'http.request.header.x_nextjs_test': 'nextjs-header-value', + 'http.request.header.user-agent': 'Custom-NextJS-Agent/15.0', + 'http.request.header.content-type': 'text/html', + 'http.request.header.x-nextjs-test': 'nextjs-header-value', 'http.request.header.accept': 'text/html, application/xhtml+xml', - 'http.request.header.x_framework': 'Next.js', - 'http.request.header.x_request_id': 'nextjs-789', + 'http.request.header.x-framework': 'Next.js', + 'http.request.header.x-request-id': 'nextjs-789', }), ); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/route-handler.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/route-handler.test.ts index 9a91fc9c95cd..2837cd84820b 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/route-handler.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-static/tests/route-handler.test.ts @@ -16,7 +16,7 @@ test('Should create a transaction for node route handlers', async ({ request }) expect(routehandlerTransaction.contexts?.trace?.status).toBe('ok'); expect(routehandlerTransaction.contexts?.trace?.op).toBe('http.server'); - expect(routehandlerTransaction.contexts?.trace?.data?.['http.request.header.x_charly']).toBe('gomez'); + expect(routehandlerTransaction.contexts?.trace?.data?.['http.request.header.x-charly']).toBe('gomez'); }); test('Should create a transaction for edge route handlers', async ({ request }) => { @@ -34,7 +34,7 @@ test('Should create a transaction for edge route handlers', async ({ request }) expect(routehandlerTransaction.contexts?.trace?.status).toBe('ok'); expect(routehandlerTransaction.contexts?.trace?.op).toBe('http.server'); - expect(routehandlerTransaction.contexts?.trace?.data?.['http.request.header.x_charly']).toBe('gomez'); + expect(routehandlerTransaction.contexts?.trace?.data?.['http.request.header.x-charly']).toBe('gomez'); }); test('Should report an error with a parameterized transaction name for a throwing route handler', async ({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/pageload-tracing.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/pageload-tracing.test.ts index b3da0fd2837c..97d2e9e128e2 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/pageload-tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/pageload-tracing.test.ts @@ -23,7 +23,7 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => return ( span.name === 'GET /pageload-tracing' && span.is_segment && - span.attributes['http.request.header.x_request_id']?.value === 'nextjs-789' + span.attributes['http.request.header.x-request-id']?.value === 'nextjs-789' ); }); @@ -41,11 +41,11 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => const serverSpan = await serverSpanPromise; expect(serverSpan.attributes).toMatchObject({ - 'http.request.header.user_agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, - 'http.request.header.content_type': { value: 'text/html', type: 'string' }, - 'http.request.header.x_nextjs_test': { value: 'nextjs-header-value', type: 'string' }, + 'http.request.header.user-agent': { value: 'Custom-NextJS-Agent/15.0', type: 'string' }, + 'http.request.header.content-type': { value: 'text/html', type: 'string' }, + 'http.request.header.x-nextjs-test': { value: 'nextjs-header-value', type: 'string' }, 'http.request.header.accept': { value: 'text/html, application/xhtml+xml', type: 'string' }, - 'http.request.header.x_framework': { value: 'Next.js', type: 'string' }, - 'http.request.header.x_request_id': { value: 'nextjs-789', type: 'string' }, + 'http.request.header.x-framework': { value: 'Next.js', type: 'string' }, + 'http.request.header.x-request-id': { value: 'nextjs-789', type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/route-handler.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/route-handler.test.ts index 693932effd1a..7d47945d9aed 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/route-handler.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/route-handler.test.ts @@ -16,7 +16,7 @@ test('Should create a span for node route handlers', async ({ request }) => { expect(routehandlerSpan.status).toBe('ok'); expect(getSpanOp(routehandlerSpan)).toBe('http.server'); - expect(routehandlerSpan.attributes['http.request.header.x_charly']?.value).toBe('gomez'); + expect(routehandlerSpan.attributes['http.request.header.x-charly']?.value).toBe('gomez'); }); test('Should create a span for edge route handlers', async ({ request }) => { @@ -34,7 +34,7 @@ test('Should create a span for edge route handlers', async ({ request }) => { expect(routehandlerSpan.status).toBe('ok'); expect(getSpanOp(routehandlerSpan)).toBe('http.server'); - expect(routehandlerSpan.attributes['http.request.header.x_charly']?.value).toBe('gomez'); + expect(routehandlerSpan.attributes['http.request.header.x-charly']?.value).toBe('gomez'); }); test('Should report an error with a parameterized span name for a throwing route handler', async ({ request }) => { diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts index add97c2c6b78..29b4bcbb8dac 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/route-handlers.test.ts @@ -13,7 +13,7 @@ test('Should create a span for route handlers', async ({ request }) => { expect(routehandlerSpan.status).toBe('ok'); expect(getSpanOp(routehandlerSpan)).toBe('http.server'); - expect(routehandlerSpan.attributes['http.request.header.x_yeet']?.value).toBe('test-value'); + expect(routehandlerSpan.attributes['http.request.header.x-yeet']?.value).toBe('test-value'); }); test('Should create a span for route handlers and correctly set span status depending on http status', async ({ diff --git a/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts index ebbc1c9cb648..37c782f5f34c 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-static/tests/transactions.test.ts @@ -40,12 +40,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_text': 'OK', 'http.route': '/test-transaction', 'http.request.header.accept': '*/*', - 'http.request.header.accept_encoding': 'gzip, deflate', - 'http.request.header.accept_language': '*', + 'http.request.header.accept-encoding': 'gzip, deflate', + 'http.request.header.accept-language': '*', 'http.request.header.connection': 'keep-alive', 'http.request.header.host': expect.any(String), - 'http.request.header.sec_fetch_mode': 'cors', - 'http.request.header.user_agent': 'node', + 'http.request.header.sec-fetch-mode': 'cors', + 'http.request.header.user-agent': 'node', }, op: 'http.server', span_id: expect.stringMatching(/[a-f0-9]{16}/), @@ -268,11 +268,11 @@ test('Extracts HTTP request headers as span attributes', async ({ baseURL }) => expect(transactionEvent.contexts?.trace?.data).toEqual( expect.objectContaining({ - 'http.request.header.user_agent': 'Custom-Agent/1.0 (Test)', - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_custom_header': 'test-value', + 'http.request.header.user-agent': 'Custom-Agent/1.0 (Test)', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-custom-header': 'test-value', 'http.request.header.accept': 'application/json, text/plain', - 'http.request.header.x_request_id': 'req-123', + 'http.request.header.x-request-id': 'req-123', }), ); }); 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 31ac4c790568..8b8c2a5b6b2d 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 @@ -128,7 +128,7 @@ test('Extracts HTTP request headers as streamed span attributes', async ({ baseU span.name === 'GET /test-transaction' && getSpanOp(span) === 'http.server' && span.is_segment && - span.attributes['http.request.header.user_agent']?.value === 'Custom-Agent/1.0 (Test)' + span.attributes['http.request.header.user-agent']?.value === 'Custom-Agent/1.0 (Test)' ); }); @@ -144,9 +144,9 @@ test('Extracts HTTP request headers as streamed span attributes', async ({ baseU const rootSpan = await rootSpanPromise; - expect(rootSpan.attributes['http.request.header.user_agent']?.value).toBe('Custom-Agent/1.0 (Test)'); - expect(rootSpan.attributes['http.request.header.content_type']?.value).toBe('application/json'); - expect(rootSpan.attributes['http.request.header.x_custom_header']?.value).toBe('test-value'); + expect(rootSpan.attributes['http.request.header.user-agent']?.value).toBe('Custom-Agent/1.0 (Test)'); + expect(rootSpan.attributes['http.request.header.content-type']?.value).toBe('application/json'); + expect(rootSpan.attributes['http.request.header.x-custom-header']?.value).toBe('test-value'); expect(rootSpan.attributes['http.request.header.accept']?.value).toBe('application/json, text/plain'); - expect(rootSpan.attributes['http.request.header.x_request_id']?.value).toBe('req-123'); + expect(rootSpan.attributes['http.request.header.x-request-id']?.value).toBe('req-123'); }); diff --git a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/spans.test.ts index b1212fd518b7..519332ae945f 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/spans.test.ts index b17ccdad59d7..46ca784f61b3 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -277,11 +277,11 @@ test('Extracts HTTP request headers as span attributes', async ({ baseURL }) => expect(segmentEvent.attributes).toEqual( expect.objectContaining({ - 'http.request.header.user_agent': { value: 'Custom-Agent/1.0 (Test)', type: 'string' }, - 'http.request.header.content_type': { value: 'application/json', type: 'string' }, - 'http.request.header.x_custom_header': { value: 'test-value', type: 'string' }, + 'http.request.header.user-agent': { value: 'Custom-Agent/1.0 (Test)', type: 'string' }, + 'http.request.header.content-type': { value: 'application/json', type: 'string' }, + 'http.request.header.x-custom-header': { value: 'test-value', type: 'string' }, 'http.request.header.accept': { value: 'application/json, text/plain', type: 'string' }, - 'http.request.header.x_request_id': { value: 'req-123', type: 'string' }, + 'http.request.header.x-request-id': { value: 'req-123', type: 'string' }, }), ); }); 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 af1db58e2532..ff130a1261fd 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 @@ -93,12 +93,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-http/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -135,7 +135,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, @@ -235,12 +235,12 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -276,17 +276,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'user_agent.original': { value: 'node', type: 'string' }, 'http.route': { value: '/test-inbound-headers/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/spans.test.ts index 9c7927242db5..ea264ee9f841 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -139,8 +139,8 @@ test('Captures request metadata', async ({ baseURL }) => { expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/), ); expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST'); - expect(segmentEvent.attributes['http.request.header.user_agent']?.value).toEqual(expect.stringContaining('')); - expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json'); + expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining('')); + expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json'); expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 })); expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1'); 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 0e41a9ce84cf..811a8ac6c17c 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 @@ -93,12 +93,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-http/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -135,7 +135,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, @@ -235,12 +235,12 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -276,17 +276,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': { value: '/test-inbound-headers/:id', type: 'string' }, 'user_agent.original': { value: 'node', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/spans.test.ts index b0fc71f7ea19..8da2eb18a882 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -139,8 +139,8 @@ test('Captures request metadata', async ({ baseURL }) => { expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/), ); expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST'); - expect(segmentEvent.attributes['http.request.header.user_agent']?.value).toEqual(expect.stringContaining('')); - expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json'); + expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining('')); + expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json'); expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 })); expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1'); 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 7e111ca46dd6..504d06efd221 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 @@ -93,12 +93,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-http/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: 'localhost:3030', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -135,7 +135,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, @@ -235,12 +235,12 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -276,17 +276,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'user_agent.original': { value: 'node', type: 'string' }, 'http.route': { value: '/test-inbound-headers/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.baggage': { value: expect.any(String), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/spans.test.ts index 2e9c3ba18e40..71fecfdd9984 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -139,8 +139,8 @@ test('Captures request metadata', async ({ baseURL }) => { expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/), ); expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST'); - expect(segmentEvent.attributes['http.request.header.user_agent']?.value).toEqual(expect.stringContaining('')); - expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json'); + expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining('')); + expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json'); expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 })); expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1'); diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/spans.test.ts index 86b65ac3eb32..553b8fcaddaf 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends successful span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-success', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); 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 fcb898828ed0..e8c903379177 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 @@ -92,12 +92,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-http/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -134,7 +134,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.request.header.baggage': { value: expect.stringContaining(traceId!), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, @@ -234,12 +234,12 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: 'localhost:3030', type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -275,17 +275,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': { value: '/test-inbound-headers/:id', type: 'string' }, 'user_agent.original': { value: 'node', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.baggage': { value: expect.stringContaining(traceId!), type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.sentry_trace': { + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.sentry-trace': { value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/), type: 'string', }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/spans.test.ts index fbf2ceaaf621..f2e127be64cf 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); @@ -146,8 +146,8 @@ test('Captures request metadata', async ({ baseURL }) => { expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/), ); expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST'); - expect(segmentEvent.attributes['http.request.header.user_agent']?.value).toEqual(expect.stringContaining('')); - expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json'); + expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining('')); + expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json'); expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 })); expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1'); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.server.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.server.test.ts index 0c68bd63a607..51ad935bcf47 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.server.test.ts @@ -57,11 +57,11 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => const serverSpan = await serverSpanPromise; expect(serverSpan.attributes).toMatchObject({ - 'http.request.header.user_agent': { type: 'string', value: 'Custom-Nuxt-Agent/3.0' }, - 'http.request.header.content_type': { type: 'string', value: 'application/json' }, - 'http.request.header.x_nuxt_test': { type: 'string', value: 'nuxt-header-value' }, + 'http.request.header.user-agent': { type: 'string', value: 'Custom-Nuxt-Agent/3.0' }, + 'http.request.header.content-type': { type: 'string', value: 'application/json' }, + 'http.request.header.x-nuxt-test': { type: 'string', value: 'nuxt-header-value' }, 'http.request.header.accept': { type: 'string', value: 'application/json, text/html' }, - 'http.request.header.x_framework': { type: 'string', value: 'Nuxt' }, - 'http.request.header.x_request_id': { type: 'string', value: 'nuxt-456' }, + 'http.request.header.x-framework': { type: 'string', value: 'Nuxt' }, + 'http.request.header.x-request-id': { type: 'string', value: 'nuxt-456' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.server.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.server.test.ts index 9200bddf2b2a..4c625738eeca 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/tests/tracing.server.test.ts @@ -21,7 +21,7 @@ test('server pageload request span has nested request span for sub request', asy 'sveltekit.tracing.original_name': { value: 'sveltekit.handle.root', type: 'string' }, 'url.full': { value: 'http://localhost:3030/server-load-fetch', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); const spans = getSegmentChildSpans(serverTraceSpans, serverSpan); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.server.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.server.test.ts index 6933bb98d6e4..1fa63c4f5408 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-static/tests/performance.server.test.ts @@ -53,12 +53,12 @@ test('extracts HTTP request headers as span attributes', async ({ page, baseURL expect(serverTxnEvent.contexts?.trace?.data).toEqual( expect.objectContaining({ - 'http.request.header.user_agent': 'Custom-SvelteKit-Agent/1.0', - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_test_header': 'sveltekit-test-value', + 'http.request.header.user-agent': 'Custom-SvelteKit-Agent/1.0', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-test-header': 'sveltekit-test-value', 'http.request.header.accept': 'application/json', - 'http.request.header.x_framework': 'SvelteKit', - 'http.request.header.x_request_id': 'sveltekit-123', + 'http.request.header.x-framework': 'SvelteKit', + 'http.request.header.x-request-id': 'sveltekit-123', }), ); }); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.server.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.server.test.ts index f3a583a2a426..2bf341ee709b 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-svelte-5/tests/performance.server.test.ts @@ -16,7 +16,7 @@ test('server pageload request span has nested request span for sub request', asy 'http.request.method': { value: 'GET', type: 'string' }, 'url.path': { value: '/server-load-fetch', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); expect(serverTraceSpans).toEqual( diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.server.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.server.test.ts index efcead78da71..1818cb311dd7 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/performance.server.test.ts @@ -52,11 +52,11 @@ test('extracts HTTP request headers as span attributes', async ({ baseURL }) => const serverSpan = await serverSpanPromise; expect(serverSpan.attributes).toMatchObject({ - 'http.request.header.user_agent': { value: 'Custom-SvelteKit-Agent/1.0', type: 'string' }, - 'http.request.header.content_type': { value: 'application/json', type: 'string' }, - 'http.request.header.x_test_header': { value: 'sveltekit-test-value', type: 'string' }, + 'http.request.header.user-agent': { value: 'Custom-SvelteKit-Agent/1.0', type: 'string' }, + 'http.request.header.content-type': { value: 'application/json', type: 'string' }, + 'http.request.header.x-test-header': { value: 'sveltekit-test-value', type: 'string' }, 'http.request.header.accept': { value: 'application/json', type: 'string' }, - 'http.request.header.x_framework': { value: 'SvelteKit', type: 'string' }, - 'http.request.header.x_request_id': { value: 'sveltekit-123', type: 'string' }, + 'http.request.header.x-framework': { value: 'SvelteKit', type: 'string' }, + 'http.request.header.x-request-id': { value: 'sveltekit-123', type: 'string' }, }); }); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.server.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.server.test.ts index b066b394d438..0ca667dda716 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-3/tests/tracing.server.test.ts @@ -21,7 +21,7 @@ test('server pageload request span has nested request span for sub request', asy 'sveltekit.tracing.original_name': { value: 'sveltekit.handle.root', type: 'string' }, 'url.full': { value: 'https://localhost:3030/server-load-fetch', type: 'string' }, 'http.request.header.accept': { value: expect.any(String), type: 'string' }, - 'http.request.header.user_agent': { value: expect.any(String), type: 'string' }, + 'http.request.header.user-agent': { value: expect.any(String), type: 'string' }, }); const spans = getSegmentChildSpans(serverTraceSpans, serverSpan); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-static/tests/db-drivers.test.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-static/tests/db-drivers.test.ts index 32858b1c2eb0..eca0a81362c4 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-static/tests/db-drivers.test.ts +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react-static/tests/db-drivers.test.ts @@ -67,11 +67,11 @@ test('Instruments mysql automatically', async ({ baseURL }) => { expect.objectContaining({ op: 'db', origin: 'auto.db.mysql', - description: 'SELECT 1 + 1 AS solution', + description: 'SELECT ? + ? AS solution', status: 'ok', data: expect.objectContaining({ 'db.system.name': 'mysql', - 'db.query.text': 'SELECT 1 + 1 AS solution', + 'db.query.text': 'SELECT ? + ? AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/tsx-express/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/tsx-express/tests/spans.test.ts index d4d15f67c6c6..704d6e00bf83 100644 --- a/dev-packages/e2e-tests/test-applications/tsx-express/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/tsx-express/tests/spans.test.ts @@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => { 'http.response.status_text': { value: 'OK', type: 'string' }, 'http.route': { value: '/test-transaction', type: 'string' }, 'http.request.header.accept': { value: '*/*', type: 'string' }, - 'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' }, - 'http.request.header.accept_language': { value: '*', type: 'string' }, + 'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' }, + 'http.request.header.accept-language': { value: '*', type: 'string' }, 'http.request.header.connection': { value: 'keep-alive', type: 'string' }, 'http.request.header.host': { value: expect.any(String), type: 'string' }, - 'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' }, - 'http.request.header.user_agent': { value: 'node', type: 'string' }, + 'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' }, + 'http.request.header.user-agent': { value: 'node', type: 'string' }, }), }), ); 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 9700fa29a07c..a769453b1718 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -6,12 +6,12 @@ import { cleanupChildProcesses, createEsmAndCjsTests, createRunner } from '../.. function getCommonHttpRequestHeaders(): Record { return { 'http.request.header.accept': '*/*', - 'http.request.header.accept_encoding': 'gzip, deflate', - 'http.request.header.accept_language': '*', + 'http.request.header.accept-encoding': 'gzip, deflate', + 'http.request.header.accept-language': '*', 'http.request.header.connection': 'keep-alive', 'http.request.header.host': expect.any(String), - 'http.request.header.sec_fetch_mode': 'cors', - 'http.request.header.user_agent': 'node', + 'http.request.header.sec-fetch-mode': 'cors', + 'http.request.header.user-agent': 'node', }; } @@ -160,8 +160,8 @@ describe('httpIntegration', () => { 'sentry.segment.name.source': 'route', [URL_FULL]: `http://localhost:${port}/test?a=1&b=2`, [URL_PATH]: '/test', - 'http.request.header.content_length': '9', - 'http.request.header.content_type': 'text/plain;charset=UTF-8', + 'http.request.header.content-length': '9', + 'http.request.header.content-type': 'text/plain;charset=UTF-8', ...getCommonHttpRequestHeaders(), }); }, diff --git a/packages/bun/test/integrations/bunserver.test.ts b/packages/bun/test/integrations/bunserver.test.ts index c1362865cd98..b96d5f5d68c8 100644 --- a/packages/bun/test/integrations/bunserver.test.ts +++ b/packages/bun/test/integrations/bunserver.test.ts @@ -70,10 +70,10 @@ describe('Bun Serve Integration', () => { 'url.scheme': 'http:', 'url.domain': 'localhost', 'http.request.header.accept': '*/*', - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', 'http.request.header.connection': 'keep-alive', 'http.request.header.host': expect.any(String), - 'http.request.header.user_agent': expect.stringContaining('Bun'), + 'http.request.header.user-agent': expect.stringContaining('Bun'), }), name: 'GET', }, @@ -81,7 +81,7 @@ describe('Bun Serve Integration', () => { ); expect(setAttributesSpy).toHaveBeenCalledWith({ - 'http.response.header.x_custom': 'value', + 'http.response.header.x-custom': 'value', }); }); @@ -113,11 +113,11 @@ describe('Bun Serve Integration', () => { 'url.scheme': 'http:', 'url.domain': 'localhost', 'http.request.header.accept': '*/*', - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', 'http.request.header.connection': 'keep-alive', - 'http.request.header.content_length': '0', + 'http.request.header.content-length': '0', 'http.request.header.host': expect.any(String), - 'http.request.header.user_agent': expect.stringContaining('Bun'), + 'http.request.header.user-agent': expect.stringContaining('Bun'), }), name: 'POST', }, @@ -232,16 +232,16 @@ describe('Bun Serve Integration', () => { 'url.scheme': 'http:', 'url.domain': 'localhost', // HTTP headers as span attributes following OpenTelemetry semantic conventions - 'http.request.header.user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_custom_header': 'custom-value', + 'http.request.header.user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-custom-header': 'custom-value', 'http.request.header.accept': 'application/json, text/plain', - 'http.request.header.accept_encoding': 'gzip, deflate, br, zstd', + 'http.request.header.accept-encoding': 'gzip, deflate, br, zstd', 'http.request.header.connection': 'keep-alive', - 'http.request.header.content_length': '15', + 'http.request.header.content-length': '15', 'http.request.header.host': expect.any(String), 'http.request.header.baggage': expect.any(String), - 'http.request.header.sentry_trace': expect.any(String), + 'http.request.header.sentry-trace': expect.any(String), }), name: 'POST', }), @@ -538,7 +538,7 @@ describe('Bun Serve Integration', () => { expect(startSpanSpy).toHaveBeenCalledTimes(1); const attributes = startSpanSpy.mock.calls[0]?.[0]?.attributes; - expect(attributes?.['http.request.header.x_forwarded_for']).toBe('203.0.113.7'); + expect(attributes?.['http.request.header.x-forwarded-for']).toBe('203.0.113.7'); }); test('filters request headers according to the dataCollection deny list', async () => { @@ -561,8 +561,8 @@ describe('Bun Serve Integration', () => { expect(startSpanSpy).toHaveBeenCalledTimes(1); const attributes = startSpanSpy.mock.calls[0]?.[0]?.attributes; - expect(attributes?.['http.request.header.x_internal']).toBe('[Filtered]'); - expect(attributes?.['http.request.header.x_public']).toBe('public-value'); + expect(attributes?.['http.request.header.x-internal']).toBe('[Filtered]'); + expect(attributes?.['http.request.header.x-public']).toBe('public-value'); }); test('filters always-sensitive request headers even when collection is permissive', async () => { @@ -604,8 +604,8 @@ describe('Bun Serve Integration', () => { expect(setAttributesSpy).toHaveBeenCalledTimes(1); const responseAttributes = setAttributesSpy.mock.calls[0]?.[0]; - expect(responseAttributes?.['http.response.header.x_internal']).toBe('[Filtered]'); - expect(responseAttributes?.['http.response.header.x_public']).toBe('public-value'); + expect(responseAttributes?.['http.response.header.x-internal']).toBe('[Filtered]'); + expect(responseAttributes?.['http.response.header.x-public']).toBe('public-value'); }); }); }); diff --git a/packages/cloudflare/test/request.test.ts b/packages/cloudflare/test/request.test.ts index adfd8c5f848b..95d482a6fd3f 100644 --- a/packages/cloudflare/test/request.test.ts +++ b/packages/cloudflare/test/request.test.ts @@ -637,7 +637,7 @@ describe('withSentry', () => { 'sentry.sample_rate': 1, 'http.response.status_code': 200, 'http.request.body.size': 10, - 'http.request.header.content_length': '10', + 'http.request.header.content-length': '10', }, op: 'http.server', origin: 'auto.http.cloudflare', diff --git a/packages/core/src/utils/request.ts b/packages/core/src/utils/request.ts index b013f09e8ce6..3911b97678ec 100644 --- a/packages/core/src/utils/request.ts +++ b/packages/core/src/utils/request.ts @@ -265,7 +265,7 @@ function getAbsoluteUrl({ /** * Converts incoming HTTP request or response headers to OpenTelemetry span attributes following semantic conventions. * Header names are converted to the format: http..header. - * where is the header name in lowercase with dashes converted to underscores. + * where is the header name in lowercase. * * @param lifecycle - The lifecycle of the headers, either 'request' or 'response' * @@ -307,11 +307,10 @@ export function httpHeadersToSpanAttributes( const parsed = parseCookieHeader(value, lowerKey === 'set-cookie'); const filtered = filterKeyValueData(parsed, cookieBehavior, SENSITIVE_COOKIE_NAME_SNIPPETS); for (const [cookieKey, cookieValue] of Object.entries(filtered)) { - spanAttributes[`${prefix}${normalizeAttributeKey(lowerKey)}.${normalizeAttributeKey(cookieKey)}`] = - cookieValue; + spanAttributes[`${prefix}${lowerKey}.${cookieKey}`] = cookieValue; } } else { - spanAttributes[`${prefix}${normalizeAttributeKey(lowerKey)}`] = FILTERED_VALUE; + spanAttributes[`${prefix}${lowerKey}`] = FILTERED_VALUE; } } else { if (headerBehavior === false) { @@ -329,7 +328,7 @@ export function httpHeadersToSpanAttributes( if (headerBehavior !== false) { const filtered = filterKeyValueData(regularHeaders, headerBehavior); for (const [headerKey, headerValue] of Object.entries(filtered)) { - spanAttributes[`${prefix}${normalizeAttributeKey(headerKey)}`] = headerValue; + spanAttributes[`${prefix}${headerKey}`] = headerValue; } } } catch { @@ -339,10 +338,6 @@ export function httpHeadersToSpanAttributes( return spanAttributes; } -function normalizeAttributeKey(key: string): string { - return key.replace(/-/g, '_'); -} - function parseCookieHeader(value: string, isSetCookie: boolean): Record { // Set-Cookie: single cookie with attributes ("name=value; HttpOnly; Secure") // Cookie: multiple cookies separated by "; " ("cookie1=value1; cookie2=value2") diff --git a/packages/core/test/lib/integrations/requestdata.test.ts b/packages/core/test/lib/integrations/requestdata.test.ts index 63282281abf8..98ce1529e0f8 100644 --- a/packages/core/test/lib/integrations/requestdata.test.ts +++ b/packages/core/test/lib/integrations/requestdata.test.ts @@ -889,7 +889,7 @@ describe('requestDataIntegration processSegmentSpan', () => { 'url.full': 'https://example.com/api/users', 'http.request.method': 'GET', 'url.query': 'page=1&limit=10', - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', 'http.request.header.accept': 'application/json', }); }); @@ -1097,7 +1097,7 @@ describe('requestDataIntegration processSegmentSpan', () => { integration.processSegmentSpan!(span, mockClient({ userInfo: false })); - expect(span.attributes).not.toHaveProperty('http.request.header.content_type'); + expect(span.attributes).not.toHaveProperty('http.request.header.content-type'); }); it('strips cookie header when include.cookies is false', () => { @@ -1111,7 +1111,7 @@ describe('requestDataIntegration processSegmentSpan', () => { integration.processSegmentSpan!(span, mockClient({ userInfo: false })); expect(span.attributes).toMatchObject({ - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', }); expect(span.attributes).not.toHaveProperty('http.request.header.cookie.theme'); }); @@ -1127,9 +1127,9 @@ describe('requestDataIntegration processSegmentSpan', () => { integration.processSegmentSpan!(span, mockClient({ userInfo: false })); expect(span.attributes).toMatchObject({ - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', }); - expect(span.attributes).not.toHaveProperty('http.request.header.x_forwarded_for'); + expect(span.attributes).not.toHaveProperty('http.request.header.x-forwarded-for'); expect(span.attributes).not.toHaveProperty('user.ip_address'); }); @@ -1177,7 +1177,7 @@ describe('requestDataIntegration processSegmentSpan', () => { integration.processSegmentSpan!(span, mockClient({ httpHeaders: { request: false, response: false } })); expect(span.attributes).toMatchObject({ - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', 'http.request.header.accept': 'text/html', }); }); @@ -1194,7 +1194,7 @@ describe('requestDataIntegration processSegmentSpan', () => { ); expect(span.attributes?.['http.request.header.accept']).toBe('application/json'); - expect(span.attributes?.['http.request.header.x_request_id']).toBe('[Filtered]'); + expect(span.attributes?.['http.request.header.x-request-id']).toBe('[Filtered]'); }); it('include.cookies overrides dataCollection.cookies=false on spans', () => { @@ -1289,8 +1289,8 @@ describe('requestDataIntegration userInfo collection', () => { expect(span.attributes).toMatchObject({ 'user.ip_address': '203.0.113.50', - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_forwarded_for': '203.0.113.50', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-forwarded-for': '203.0.113.50', }); }); }); diff --git a/packages/core/test/lib/utils/request.test.ts b/packages/core/test/lib/utils/request.test.ts index 4db75d5a96ff..92cdefdf04af 100644 --- a/packages/core/test/lib/utils/request.test.ts +++ b/packages/core/test/lib/utils/request.test.ts @@ -453,8 +453,8 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.user_agent': 'test-agent', + 'http.request.header.content-type': 'application/json', + 'http.request.header.user-agent': 'test-agent', }); }); @@ -467,7 +467,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.custom_header': 'value1;value2', + 'http.request.header.custom-header': 'value1;value2', 'http.request.header.accept': 'application/json;text/html', }); }); @@ -481,8 +481,8 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.valid_header': 'valid-value', - 'http.request.header.undefined_values': ';', + 'http.request.header.valid-header': 'valid-value', + 'http.request.header.undefined-values': ';', }); }); @@ -495,7 +495,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.valid_header': 'valid-value', + 'http.request.header.valid-header': 'valid-value', }); }); @@ -508,12 +508,12 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.empty_header': '', - 'http.request.header.valid_header': 'valid-value', + 'http.request.header.empty-header': '', + 'http.request.header.valid-header': 'valid-value', }); }); - it('converts header names to lowercase and replaces dashes with underscores', () => { + it('converts header names to lowercase and preserves dashes', () => { const headers = { 'Content-Type': 'application/json', 'X-CUSTOM-HEADER': 'custom-value', @@ -524,9 +524,9 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_custom_header': 'custom-value', - 'http.request.header.user_agent': 'test-agent', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-custom-header': 'custom-value', + 'http.request.header.user-agent': 'test-agent', 'http.request.header.accept': 'text/html', }); }); @@ -548,14 +548,14 @@ describe('request utils', () => { expect(result).toEqual({ 'http.request.header.host': 'example.com', - 'http.request.header.user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'http.request.header.user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', 'http.request.header.accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'http.request.header.accept_language': 'en-US,en;q=0.5', - 'http.request.header.accept_encoding': 'gzip, deflate', + 'http.request.header.accept-language': 'en-US,en;q=0.5', + 'http.request.header.accept-encoding': 'gzip, deflate', 'http.request.header.connection': 'keep-alive', - 'http.request.header.upgrade_insecure_requests': '1', - 'http.request.header.cache_control': 'no-cache', - 'http.request.header.x_forwarded_for': '192.168.1.1', + 'http.request.header.upgrade-insecure-requests': '1', + 'http.request.header.cache-control': 'no-cache', + 'http.request.header.x-forwarded-for': '192.168.1.1', }); }); @@ -568,7 +568,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.x_random_header': 'test=abc123;preferences=dark-mode;number=three', + 'http.request.header.x-random-header': 'test=abc123;preferences=dark-mode;number=three', 'http.request.header.accept': 'application/json;text/html', }); }); @@ -582,8 +582,8 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.empty_header': '', - 'http.request.header.valid_header': 'valid-value', + 'http.request.header.empty-header': '', + 'http.request.header.valid-header': 'valid-value', }); }); @@ -609,7 +609,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.mixed_types': 'string-value;123;true;', + 'http.request.header.mixed-types': 'string-value;123;true;', }); }); @@ -625,7 +625,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.string_header': 'valid-value', + 'http.request.header.string-header': 'valid-value', }); }); @@ -641,9 +641,9 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', 'http.request.header.cookie.session': '[Filtered]', - 'http.request.header.x_api_key': '[Filtered]', + 'http.request.header.x-api-key': '[Filtered]', 'http.request.header.authorization': '[Filtered]', }); }); @@ -662,7 +662,7 @@ describe('request utils', () => { 'http.request.header.cookie.theme': 'dark', 'http.request.header.cookie.lang': 'en', 'http.request.header.cookie.user_session': '[Filtered]', - 'http.request.header.cookie.cookie_authentication_key_without_value': '[Filtered]', + 'http.request.header.cookie.cookie-authentication-key-without-value': '[Filtered]', 'http.request.header.cookie.pref': '1', }); }); @@ -680,7 +680,7 @@ describe('request utils', () => { 'http.request.header.cookie.express.sid': '[Filtered]', 'http.request.header.cookie.phpsessid': '[Filtered]', 'http.request.header.cookie.theme': 'light', - 'http.request.header.cookie.sb_access_token': '[Filtered]', + 'http.request.header.cookie.sb-access-token': '[Filtered]', 'http.request.header.cookie.__stripe_mid': '[Filtered]', }); }); @@ -718,15 +718,15 @@ describe('request utils', () => { }); it.each([ - ['preferred-color-mode=light', { 'http.request.header.set_cookie.preferred_color_mode': 'light' }], - ['theme=dark; HttpOnly', { 'http.request.header.set_cookie.theme': 'dark' }], - ['session=abc123; Domain=example.com; HttpOnly', { 'http.request.header.set_cookie.session': '[Filtered]' }], - ['lang=en; Expires=Wed, 21 Oct 2025 07:28:00 GMT', { 'http.request.header.set_cookie.lang': 'en' }], - ['pref=1; Max-Age=3600', { 'http.request.header.set_cookie.pref': '1' }], - ['color=blue; Path=/dashboard', { 'http.request.header.set_cookie.color': 'blue' }], - ['token=eyJhbGc=.eyJzdWI=.SflKxw; Secure', { 'http.request.header.set_cookie.token': '[Filtered]' }], - ['auth_required; HttpOnly', { 'http.request.header.set_cookie.auth_required': '[Filtered]' }], - ['empty=; Secure', { 'http.request.header.set_cookie.empty': '' }], + ['preferred-color-mode=light', { 'http.request.header.set-cookie.preferred-color-mode': 'light' }], + ['theme=dark; HttpOnly', { 'http.request.header.set-cookie.theme': 'dark' }], + ['session=abc123; Domain=example.com; HttpOnly', { 'http.request.header.set-cookie.session': '[Filtered]' }], + ['lang=en; Expires=Wed, 21 Oct 2025 07:28:00 GMT', { 'http.request.header.set-cookie.lang': 'en' }], + ['pref=1; Max-Age=3600', { 'http.request.header.set-cookie.pref': '1' }], + ['color=blue; Path=/dashboard', { 'http.request.header.set-cookie.color': 'blue' }], + ['token=eyJhbGc=.eyJzdWI=.SflKxw; Secure', { 'http.request.header.set-cookie.token': '[Filtered]' }], + ['auth_required; HttpOnly', { 'http.request.header.set-cookie.auth_required': '[Filtered]' }], + ['empty=; Secure', { 'http.request.header.set-cookie.empty': '' }], ])('should parse and filter Set-Cookie header: %s', (setCookieValue, expected) => { const headers = { 'Set-Cookie': setCookieValue }; const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); @@ -736,7 +736,7 @@ describe('request utils', () => { it('only splits cookies once between key and value, even when more equals signs are present', () => { const headers = { Cookie: 'random-string=eyJhbGc=.eyJzdWI=.SflKxw' }; const result = httpHeadersToSpanAttributes(headers, resolveDataCollectionOptions({})); - expect(result).toEqual({ 'http.request.header.cookie.random_string': 'eyJhbGc=.eyJzdWI=.SflKxw' }); + expect(result).toEqual({ 'http.request.header.cookie.random-string': 'eyJhbGc=.eyJzdWI=.SflKxw' }); }); it.each([ @@ -747,23 +747,23 @@ describe('request utils', () => { }, }), expected: { - 'http.request.header.content_type': 'application/json', - 'http.request.header.user_agent': 'Mozilla/5.0', - 'http.request.header.x_user': '[Filtered]', - 'http.request.header.x_forwarded_for': '[Filtered]', - 'http.request.header.x_forwarded_host': '[Filtered]', - 'http.request.header.x_forwarded_proto': '[Filtered]', + 'http.request.header.content-type': 'application/json', + 'http.request.header.user-agent': 'Mozilla/5.0', + 'http.request.header.x-user': '[Filtered]', + 'http.request.header.x-forwarded-for': '[Filtered]', + 'http.request.header.x-forwarded-host': '[Filtered]', + 'http.request.header.x-forwarded-proto': '[Filtered]', }, }, { dataCollection: resolveDataCollectionOptions({}), expected: { - 'http.request.header.content_type': 'application/json', - 'http.request.header.user_agent': 'Mozilla/5.0', - 'http.request.header.x_user': 'my-personal-username', - 'http.request.header.x_forwarded_for': '192.168.1.1', - 'http.request.header.x_forwarded_host': 'example.com', - 'http.request.header.x_forwarded_proto': 'https', + 'http.request.header.content-type': 'application/json', + 'http.request.header.user-agent': 'Mozilla/5.0', + 'http.request.header.x-user': 'my-personal-username', + 'http.request.header.x-forwarded-for': '192.168.1.1', + 'http.request.header.x-forwarded-host': 'example.com', + 'http.request.header.x-forwarded-proto': 'https', }, }, ])('filters PII headers according to dataCollection.httpHeaders', ({ dataCollection, expected }) => { @@ -814,31 +814,31 @@ describe('request utils', () => { // Security-sensitive headers remain redacted with permissive collection defaults. expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.user_agent': 'test-agent', + 'http.request.header.content-type': 'application/json', + 'http.request.header.user-agent': 'test-agent', 'http.request.header.accept': 'application/json', 'http.request.header.host': 'example.com', 'http.request.header.authorization': '[Filtered]', 'http.request.header.cookie.session': '[Filtered]', - 'http.request.header.set_cookie.session': '[Filtered]', - 'http.request.header.x_api_key': '[Filtered]', - 'http.request.header.x_auth_token': '[Filtered]', - 'http.request.header.x_secret': '[Filtered]', - 'http.request.header.x_secret_key': '[Filtered]', - 'http.request.header.www_authenticate': '[Filtered]', - 'http.request.header.proxy_authorization': '[Filtered]', - 'http.request.header.x_access_token': '[Filtered]', - 'http.request.header.x_csrf': '[Filtered]', - 'http.request.header.x_xsrf': '[Filtered]', - 'http.request.header.x_session_token': '[Filtered]', - 'http.request.header.x_password': '[Filtered]', - 'http.request.header.x_private_key': '[Filtered]', - 'http.request.header.x_forwarded_user': 'user', - 'http.request.header.x_forwarded_authorization': '[Filtered]', - 'http.request.header.x_jwt_token': '[Filtered]', - 'http.request.header.x_bearer_token': '[Filtered]', - 'http.request.header.x_sso_token': '[Filtered]', - 'http.request.header.x_saml_token': '[Filtered]', + 'http.request.header.set-cookie.session': '[Filtered]', + 'http.request.header.x-api-key': '[Filtered]', + 'http.request.header.x-auth-token': '[Filtered]', + 'http.request.header.x-secret': '[Filtered]', + 'http.request.header.x-secret-key': '[Filtered]', + 'http.request.header.www-authenticate': '[Filtered]', + 'http.request.header.proxy-authorization': '[Filtered]', + 'http.request.header.x-access-token': '[Filtered]', + 'http.request.header.x-csrf': '[Filtered]', + 'http.request.header.x-xsrf': '[Filtered]', + 'http.request.header.x-session-token': '[Filtered]', + 'http.request.header.x-password': '[Filtered]', + 'http.request.header.x-private-key': '[Filtered]', + 'http.request.header.x-forwarded-user': 'user', + 'http.request.header.x-forwarded-authorization': '[Filtered]', + 'http.request.header.x-jwt-token': '[Filtered]', + 'http.request.header.x-bearer-token': '[Filtered]', + 'http.request.header.x-sso-token': '[Filtered]', + 'http.request.header.x-saml-token': '[Filtered]', }); }); @@ -865,19 +865,19 @@ describe('request utils', () => { expect(result).toEqual({ 'http.response.header.host': 'example.com', - 'http.response.header.user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'http.response.header.user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', 'http.response.header.accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'http.response.header.accept_language': 'en-US,en;q=0.5', - 'http.response.header.accept_encoding': 'gzip, deflate', + 'http.response.header.accept-language': 'en-US,en;q=0.5', + 'http.response.header.accept-encoding': 'gzip, deflate', 'http.response.header.connection': 'keep-alive', - 'http.response.header.upgrade_insecure_requests': '1', - 'http.response.header.cache_control': 'no-cache', - 'http.response.header.x_forwarded_for': '192.168.1.1', + 'http.response.header.upgrade-insecure-requests': '1', + 'http.response.header.cache-control': 'no-cache', + 'http.response.header.x-forwarded-for': '192.168.1.1', 'http.response.header.authorization': '[Filtered]', - 'http.response.header.x_bearer_token': '[Filtered]', - 'http.response.header.x_saml_token': '[Filtered]', - 'http.response.header.x_sso_token': '[Filtered]', - 'http.response.header.set_cookie.session': '[Filtered]', + 'http.response.header.x-bearer-token': '[Filtered]', + 'http.response.header.x-saml-token': '[Filtered]', + 'http.response.header.x-sso-token': '[Filtered]', + 'http.response.header.set-cookie.session': '[Filtered]', 'http.response.header.cookie.session': '[Filtered]', }); }); @@ -916,10 +916,10 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, dc); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_request_id': 'abc-123', - 'http.request.header.x_trace_id': '[Filtered]', - 'http.request.header.user_agent': '[Filtered]', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-request-id': 'abc-123', + 'http.request.header.x-trace-id': '[Filtered]', + 'http.request.header.user-agent': '[Filtered]', }); }); @@ -942,9 +942,9 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, dc); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_custom_secret': '[Filtered]', - 'http.request.header.x_forwarded_for': '192.168.1.1', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-custom-secret': '[Filtered]', + 'http.request.header.x-forwarded-for': '192.168.1.1', 'http.request.header.accept': 'text/html', }); }); @@ -982,7 +982,7 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, dc); expect(result).toEqual({ - 'http.request.header.content_type': 'application/json', + 'http.request.header.content-type': 'application/json', }); }); @@ -1022,8 +1022,8 @@ describe('request utils', () => { const result = httpHeadersToSpanAttributes(headers, dc, 'response'); expect(result).toEqual({ - 'http.response.header.content_type': 'application/json', - 'http.response.header.x_custom': '[Filtered]', + 'http.response.header.content-type': 'application/json', + 'http.response.header.x-custom': '[Filtered]', }); }); @@ -1045,7 +1045,7 @@ describe('request utils', () => { expect(result).toEqual({ 'http.request.header.authorization': '[Filtered]', - 'http.request.header.x_request_id': 'abc-123', + 'http.request.header.x-request-id': 'abc-123', }); }); }); diff --git a/packages/deno/test/deno-serve.test.ts b/packages/deno/test/deno-serve.test.ts index 146267664d3d..f56fca764b99 100644 --- a/packages/deno/test/deno-serve.test.ts +++ b/packages/deno/test/deno-serve.test.ts @@ -513,8 +513,8 @@ Deno.test('Deno.serve should capture request headers and set response context', // Check response context assertEquals(transaction?.contexts?.response?.status_code, 201); - assertEquals(transaction?.contexts?.trace?.data?.['http.response.header.content_type'], 'text/plain'); - assertEquals(transaction?.contexts?.trace?.data?.['http.response.header.x_custom_header'], 'test'); + assertEquals(transaction?.contexts?.trace?.data?.['http.response.header.content-type'], 'text/plain'); + assertEquals(transaction?.contexts?.trace?.data?.['http.response.header.x-custom-header'], 'test'); }); Deno.test('Deno.serve should capture client address and port by default', async () => { @@ -621,7 +621,7 @@ Deno.test('Deno.serve should keep PII request headers by default', async () => { assertEquals(transactionEvents.length, 1); const [transaction] = transactionEvents; - assertEquals(transaction?.contexts?.trace?.data?.['http.request.header.x_forwarded_for'], '203.0.113.7'); + assertEquals(transaction?.contexts?.trace?.data?.['http.request.header.x-forwarded-for'], '203.0.113.7'); }); Deno.test('Deno.serve should filter PII request headers when configured', async () => { @@ -658,7 +658,7 @@ Deno.test('Deno.serve should filter PII request headers when configured', async assertEquals(transactionEvents.length, 1); const [transaction] = transactionEvents; - assertEquals(transaction?.contexts?.trace?.data?.['http.request.header.x_forwarded_for'], '[Filtered]'); + assertEquals(transaction?.contexts?.trace?.data?.['http.request.header.x-forwarded-for'], '[Filtered]'); }); Deno.test('Deno.serve should support distributed tracing with sentry-trace header', async () => { diff --git a/packages/nextjs/test/utils/addHeadersAsAttributes.test.ts b/packages/nextjs/test/utils/addHeadersAsAttributes.test.ts index 12dd97c2a6be..d122cd9ef2dc 100644 --- a/packages/nextjs/test/utils/addHeadersAsAttributes.test.ts +++ b/packages/nextjs/test/utils/addHeadersAsAttributes.test.ts @@ -31,8 +31,8 @@ describe('addHeadersAsAttributes', () => { }); expect(result).toMatchObject({ - 'http.request.header.content_type': 'application/json', - 'http.request.header.x_forwarded_for': '127.0.0.1', + 'http.request.header.content-type': 'application/json', + 'http.request.header.x-forwarded-for': '127.0.0.1', }); }); @@ -48,7 +48,7 @@ describe('addHeadersAsAttributes', () => { 'x-forwarded-for': '127.0.0.1', }); - expect(result['http.request.header.content_type']).toBe('application/json'); - expect(result['http.request.header.x_forwarded_for']).toBe('[Filtered]'); + expect(result['http.request.header.content-type']).toBe('application/json'); + expect(result['http.request.header.x-forwarded-for']).toBe('[Filtered]'); }); }); diff --git a/packages/nuxt/test/runtime/hooks/wrapMiddlewareHandler.test.ts b/packages/nuxt/test/runtime/hooks/wrapMiddlewareHandler.test.ts index 04d61994579e..0507fe631d5a 100644 --- a/packages/nuxt/test/runtime/hooks/wrapMiddlewareHandler.test.ts +++ b/packages/nuxt/test/runtime/hooks/wrapMiddlewareHandler.test.ts @@ -62,7 +62,7 @@ describe('wrapMiddlewareHandlerWithSentry', () => { frameContextLines: 5, }), }); - (SentryCore.httpHeadersToSpanAttributes as any).mockReturnValue({ 'http.request.header.user_agent': 'test-agent' }); + (SentryCore.httpHeadersToSpanAttributes as any).mockReturnValue({ 'http.request.header.user-agent': 'test-agent' }); (SentryCoreServer.flushIfServerless as any).mockResolvedValue(undefined); });