From 43ead4645112c528a6abddc37556be2fa74f5bc5 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:09:19 +0200 Subject: [PATCH 1/8] feat: Rename deprecated `net.` span attributes --- .../suites/orchestrion-mongo/test.ts | 4 +- .../suites/orchestrion-mongoose/test.ts | 4 +- .../suites/orchestrion-mysql/test.ts | 4 +- .../suites/orchestrion-mysql2/test.ts | 4 +- .../suites/orchestrion-postgres/test.ts | 4 +- .../suites/orchestrion-tedious/test.ts | 4 +- .../astro-6-cf-workers/tests/db.test.ts | 4 +- .../astro-7-orchestrion/tests/db.test.ts | 8 ++-- .../bun-mysql/tests/mysql.test.ts | 2 +- .../cloudflare-mcp/tests/index.test.ts | 3 +- .../tests/mysql.test.ts | 4 +- .../create-remix-app-v2/tests/db.test.ts | 8 ++-- .../deno-mysql/tests/mysql.test.ts | 2 +- .../deno-pg/tests/pg.test.ts | 2 +- .../hono-4/tests/tracing.test.ts | 15 +++--- .../nestjs-11/tests/transactions.test.ts | 12 ++--- .../nestjs-8/tests/transactions.test.ts | 12 ++--- .../nestjs-basic/tests/transactions.test.ts | 12 ++--- .../tests/propagation.test.ts | 48 +++++++++---------- .../nestjs-fastify/tests/transactions.test.ts | 12 ++--- .../tests/transactions.test.ts | 12 ++--- .../tests/transactions.test.ts | 12 ++--- .../nextjs-16-orchestrion/tests/knex.test.ts | 4 +- .../nextjs-16-orchestrion/tests/mysql.test.ts | 8 ++-- .../tests/mysql2.test.ts | 4 +- .../nextjs-16-orchestrion/tests/pg.test.ts | 8 ++-- .../tests/server.test.ts | 12 ++--- .../tests/transactions.test.ts | 12 ++--- .../tests/transactions.test.ts | 12 ++--- .../tests/transactions.test.ts | 12 ++--- .../node-express/tests/transactions.test.ts | 12 ++--- .../node-fastify-3/tests/propagation.test.ts | 48 +++++++++---------- .../node-fastify-3/tests/transactions.test.ts | 12 ++--- .../node-fastify-4/tests/propagation.test.ts | 48 +++++++++---------- .../node-fastify-4/tests/transactions.test.ts | 12 ++--- .../node-fastify-5/tests/propagation.test.ts | 48 +++++++++---------- .../node-fastify-5/tests/transactions.test.ts | 12 ++--- .../node-hapi/tests/transactions.test.ts | 12 ++--- .../node-koa/tests/propagation.test.ts | 48 +++++++++---------- .../node-koa/tests/transactions.test.ts | 12 ++--- .../nuxt-4-cloudflare/tests/db.test.ts | 4 +- .../nuxt-4/tests/db-drivers.test.ts | 8 ++-- .../tests/performance/db.server.test.ts | 8 ++-- .../tests/db.test.ts | 4 +- .../solidstart/tests/db.test.ts | 8 ++-- .../sveltekit-2-orchestrion/tests/db.test.ts | 8 ++-- .../tests/db.test.ts | 4 +- .../tests/db-drivers.test.ts | 8 ++-- .../tsx-express/tests/transactions.test.ts | 12 ++--- .../suites/tracing/amqplib/test.ts | 4 +- .../http-strip-query/test.ts | 8 ++-- .../suites/tracing/httpIntegration/test.ts | 24 +++++----- .../suites/tracing/knex/mysql2/test.ts | 8 ++-- .../suites/tracing/knex/pg/test.ts | 8 ++-- .../suites/tracing/mongodb/test.ts | 20 ++++---- .../suites/tracing/mysql/test.ts | 8 ++-- .../suites/tracing/mysql2/test.ts | 8 ++-- .../suites/tracing/postgres-streamed/test.ts | 6 +-- .../suites/tracing/redis-cache/test.ts | 8 ++-- .../suites/tracing/redis/test.ts | 12 ++--- .../suites/tracing/tedious/test.ts | 4 +- docs/migration/v11-end-state.md | 43 +++++++++++++---- packages/cloudflare/src/request.ts | 5 +- packages/cloudflare/test/request.test.ts | 3 +- packages/core/src/fetch.ts | 12 ++++- .../http/get-outgoing-span-data.ts | 31 +++++++----- .../integrations/http/server-subscription.ts | 35 +++++++++++--- .../http/get-outgoing-span-data.test.ts | 38 +++++++++------ .../http/server-subscription.test.ts | 27 ++++++++++- .../deno/src/wrap-deno-request-handler.ts | 16 ++++--- .../http/httpServerSpansIntegration.ts | 45 ++++++++++------- .../src/integrations/tracing/redis/cache.ts | 4 +- .../integrations/tracing-channel/amqplib.ts | 12 ----- .../integrations/tracing-channel/ioredis.ts | 6 +-- .../src/integrations/tracing-channel/knex.ts | 17 +++---- .../src/integrations/tracing-channel/mysql.ts | 8 ++-- .../integrations/tracing-channel/mysql2.ts | 8 ++-- .../integrations/tracing-channel/postgres.ts | 12 ++--- .../src/integrations/tracing-channel/redis.ts | 16 +++---- .../integrations/tracing-channel/tedious.ts | 8 ++-- .../server-utils/src/mongodb/mongodb-span.ts | 8 ++-- .../src/mongoose/mongoose-legacy-span.ts | 8 ++-- .../tracing-channel/ioredis.test.ts | 4 +- .../test/orchestrion/postgres.test.ts | 12 ++--- 84 files changed, 589 insertions(+), 499 deletions(-) diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts index fdc762a7e54b..a07c5ab8171b 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts @@ -60,7 +60,7 @@ Deno.test('mongodb instrumentation: orchestrion:mongodb:command channel produces assertEquals(mongoSpan!.data?.['db.name'], 'mydb'); assertEquals(mongoSpan!.data?.['db.mongodb.collection'], 'users'); assertEquals(mongoSpan!.data?.['db.operation'], 'find'); - assertEquals(mongoSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(mongoSpan!.data?.['net.peer.port'], 27017); + assertEquals(mongoSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(mongoSpan!.data?.['network.peer.port'], 27017); assertEquals(mongoSpan!.data?.['sentry.origin'], 'auto.db.mongo'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts index 863b87f6b048..cb50dc894fdf 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts @@ -61,7 +61,7 @@ Deno.test('mongoose instrumentation: orchestrion:mongoose:model_save channel pro assertEquals(mongooseSpan!.data?.['db.mongodb.collection'], 'blogposts'); assertEquals(mongooseSpan!.data?.['db.operation'], 'save'); assertEquals(mongooseSpan!.data?.['db.user'], 'root'); - assertEquals(mongooseSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(mongooseSpan!.data?.['net.peer.port'], 27017); + assertEquals(mongooseSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(mongooseSpan!.data?.['network.peer.port'], 27017); assertEquals(mongooseSpan!.data?.['sentry.origin'], 'auto.db.mongoose'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts index 7f70b33e1a08..5721fe4598e1 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts @@ -92,8 +92,8 @@ Deno.test('mysql instrumentation: orchestrion:mysql:query channel produces a nes assertEquals(mysqlSpan!.description, 'SELECT 1 AS solution'); assertEquals(mysqlSpan!.data?.['db.system'], 'mysql'); assertEquals(mysqlSpan!.data?.['db.statement'], 'SELECT 1 AS solution'); - assertEquals(mysqlSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(mysqlSpan!.data?.['net.peer.port'], 3306); + assertEquals(mysqlSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(mysqlSpan!.data?.['network.peer.port'], 3306); assertEquals(mysqlSpan!.data?.['db.user'], 'root'); assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts index e17ad8c833e9..6e006a018acb 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts @@ -55,7 +55,7 @@ Deno.test('mysql2 instrumentation: orchestrion:mysql2:query channel produces a n assertEquals(mysqlSpan!.data?.['db.statement'], 'SELECT 1 AS solution'); assertEquals(mysqlSpan!.data?.['db.name'], 'mydb'); assertEquals(mysqlSpan!.data?.['db.user'], 'root'); - assertEquals(mysqlSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(mysqlSpan!.data?.['net.peer.port'], 3306); + assertEquals(mysqlSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(mysqlSpan!.data?.['network.peer.port'], 3306); assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql2'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts index f74d3876f373..1bb99d528321 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts @@ -92,8 +92,8 @@ Deno.test('pg instrumentation: orchestrion:pg:query channel produces a nested db assertEquals(pgSpan!.description, 'SELECT 1 AS solution'); assertEquals(pgSpan!.data?.['db.system'], 'postgresql'); assertEquals(pgSpan!.data?.['db.statement'], 'SELECT 1 AS solution'); - assertEquals(pgSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(pgSpan!.data?.['net.peer.port'], 5432); + assertEquals(pgSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(pgSpan!.data?.['network.peer.port'], 5432); assertEquals(pgSpan!.data?.['db.user'], 'root'); assertEquals(pgSpan!.data?.['sentry.origin'], 'auto.db.postgres'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts index ec78613fbf97..45fcce814cb9 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts @@ -58,7 +58,7 @@ Deno.test('tedious instrumentation: orchestrion:tedious:execSql channel produces assertEquals(tediousSpan!.data?.['db.name'], 'mydb'); assertEquals(tediousSpan!.data?.['db.user'], 'sa'); assertEquals(tediousSpan!.data?.['db.statement'], 'SELECT 1'); - assertEquals(tediousSpan!.data?.['net.peer.name'], '127.0.0.1'); - assertEquals(tediousSpan!.data?.['net.peer.port'], 1433); + assertEquals(tediousSpan!.data?.['server.address'], '127.0.0.1'); + assertEquals(tediousSpan!.data?.['network.peer.port'], 1433); assertEquals(tediousSpan!.data?.['sentry.origin'], 'auto.db.tedious'); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts index 5c4041ea0728..1b531ed75f6b 100644 --- a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts @@ -20,8 +20,8 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.name']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts index 5090e42f65aa..f758ccd2a1e9 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts @@ -63,8 +63,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -79,8 +79,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts index cfcf60f8657c..793c06e943e4 100644 --- a/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts @@ -26,7 +26,7 @@ test('mysql queries emit a db span with orchestrion-channel attributes', async ( expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); 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 22098b605de8..84236339babf 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 @@ -94,7 +94,8 @@ test('sends spans for MCP 2026-07-28 tool calls', async ({ baseURL }) => { expect(requestTrace?.data?.['http.request.body.size']).toBe(341); expect(requestTrace?.data?.['user_agent.original']).toBe('node'); expect(requestTrace?.data?.['http.request.header.content_type']).toBe('application/json'); - expect(requestTrace?.data?.['network.protocol.name']).toBe('HTTP/1.1'); + expect(requestTrace?.data?.['network.protocol.name']).toBe('http'); + expect(requestTrace?.data?.['network.protocol.version']).toBe('1.1'); expect(requestTrace?.data?.['http.response.status_code']).toBe(200); expect(requestTrace?.data?.['mcp.server.extra']).toBe(' /|\ ^._.^ /|\ '); expect(mcpTrace?.trace_id).toBe(requestTrace?.trace_id); diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts index f8d057422554..f7d2ffb4e7e7 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts @@ -27,8 +27,8 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.name']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts index 8aebe04a9c5b..a107f0d38845 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts @@ -69,8 +69,8 @@ test.describe('orchestrion DB instrumentation', () => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -85,8 +85,8 @@ test.describe('orchestrion DB instrumentation', () => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts index 5067b8015e1e..28496e7e3407 100644 --- a/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts @@ -25,7 +25,7 @@ test('mysql queries emit a db span with orchestrion-channel attributes', async ( expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts b/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts index 87a9c660f563..48effaa0f94a 100644 --- a/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts @@ -25,7 +25,7 @@ test('pg queries emit a db span with orchestrion-channel attributes', async ({ b expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.postgres'); expect(firstQuery!.data?.['db.system']).toBe('postgresql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.port']).toBe(5432); + expect(firstQuery!.data?.['network.peer.port']).toBe(5432); expect(firstQuery!.data?.['db.user']).toBe('postgres'); }); diff --git a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts index 5f159ec2dbf8..04351805667f 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts @@ -88,15 +88,16 @@ test("preserves the baseline client.* and network.* server span attributes that const data = transaction.contexts?.trace?.data ?? {}; if (RUNTIME === 'node') { - expect(data['net.host.name']).toBe('localhost'); - expect(data['net.transport']).toBe('ip_tcp'); - expect(data['net.host.ip']).toEqual(expect.any(String)); - expect(data['net.peer.ip']).toEqual(expect.any(String)); - expect(data['net.peer.port']).toEqual(expect.any(Number)); + expect(data['server.address']).toBe('localhost'); + expect(data['network.transport']).toBe('tcp'); + expect(data['network.local.address']).toEqual(expect.any(String)); + expect(data['network.peer.address']).toEqual(expect.any(String)); + expect(data['network.peer.port']).toEqual(expect.any(Number)); } else if (RUNTIME === 'bun') { - // Doesn't set net.*, network.*, or client.* attributes + // Doesn't expose connection metadata through Bun.serve } else if (RUNTIME === 'cloudflare') { - expect(data['network.protocol.name']).toBe('HTTP/1.1'); + expect(data['network.protocol.name']).toBe('http'); + expect(data['network.protocol.version']).toBe('1.1'); } else if (RUNTIME === 'deno') { expect(data['client.address']).toEqual(expect.any(String)); expect(data['client.port']).toEqual(expect.any(Number)); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts index b6eac56cc0a0..f3fcea646f3e 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts index 03593be28685..4eab7487ab1a 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts index 5f1a79b1d8eb..523dce299e0a 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts @@ -50,17 +50,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 fba209a9b966..e18926f6e457 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 @@ -65,17 +65,17 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': expect.any(String), 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -104,16 +104,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -194,17 +194,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': expect.any(String), 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -233,16 +233,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts index 723c2befcdaa..9d6eaa546928 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts @@ -28,17 +28,17 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'http.response.status_code': 200, 'url.full': 'http://localhost:3030/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts index 27a666af610c..854e463f9a88 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/example-module/transaction', 'url.path': '/example-module/transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/example-module/transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/example-module/transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts index 1d29fdfad9a7..2fec9d229065 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/example-module/transaction', 'url.path': '/example-module/transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/example-module/transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/example-module/transaction', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts index 214167efd873..ca9c93e5e423 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts @@ -23,8 +23,8 @@ test('Instruments knex automatically via orchestrion', async ({ baseURL }) => { 'db.name': 'postgres', 'sentry.origin': 'auto.db.knex', 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 5432, + 'server.address': 'localhost', + 'network.peer.port': 5432, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts index d47566286a03..591717453a79 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts @@ -30,8 +30,8 @@ test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -46,8 +46,8 @@ test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts index 82bbe87a7fc6..356ef80d55f0 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts @@ -24,8 +24,8 @@ test('Instruments mysql2 automatically via orchestrion', async ({ baseURL }) => 'db.system': 'mysql', 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts index 16f7305e3a32..4c53cce3b4e9 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts @@ -24,8 +24,8 @@ test('Instruments pg automatically via orchestrion', async ({ baseURL }) => { 'db.user': 'postgres', 'db.name': 'postgres', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 5432, + 'server.address': expect.any(String), + 'network.peer.port': 5432, }), }), ); @@ -41,8 +41,8 @@ test('Instruments pg automatically via orchestrion', async ({ baseURL }) => { 'db.user': 'postgres', 'db.name': 'postgres', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 5432, + 'server.address': expect.any(String), + 'network.peer.port': 5432, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts index 427c9f334910..21106f6b0969 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts @@ -45,12 +45,12 @@ test('Should record a transaction for route with parameters', async ({ request } 'http.target': '/test-transaction/1', 'url.full': 'http://localhost:3030/test-transaction/1', 'http.user_agent': expect.any(String), - 'net.host.ip': expect.any(String), - 'net.host.name': 'localhost', - 'net.host.port': 3030, - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), - 'net.transport': 'ip_tcp', + 'network.local.address': expect.any(String), + 'server.address': 'localhost', + 'network.local.port': 3030, + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), + 'network.transport': 'tcp', 'sentry.kind': 'server', 'sentry.op': 'http.server', 'sentry.origin': 'auto.http.otel.http', diff --git a/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts index 024b5efa126d..f07acd0431e0 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts index 4a45adad7839..02bc3f0e9588 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts index e3a7944dc28a..397b59eff129 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts index 8629fefe2efb..51ca94a8c389 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 abda01da852d..ee4ebf32680f 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 @@ -65,17 +65,17 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -104,16 +104,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -194,17 +194,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -233,16 +233,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.user_agent': 'node', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts index 281d1028678c..4fd1e880b9ea 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts @@ -29,17 +29,17 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 63c198a954bb..ef69f704893a 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 @@ -65,17 +65,17 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -104,16 +104,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -194,17 +194,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -233,16 +233,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts index 662ece5f348a..72a86064016c 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 94014c521af5..8421d70708e2 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 @@ -65,17 +65,17 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -104,16 +104,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -194,17 +194,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -233,16 +233,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.user_agent': 'node', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts index ec871f134b42..505d0224ab08 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts index 69c7c470db20..3393ba9f2d22 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts @@ -23,17 +23,17 @@ test('Sends successful transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-success', 'url.path': '/test-success', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-success', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-success', 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 b86df1bcfa7c..0bacb4645388 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 @@ -64,17 +64,17 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-http/${id}`, 'url.path': `/test-outgoing-http/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -103,16 +103,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -193,17 +193,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`, 'url.path': `/test-outgoing-fetch/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -232,16 +232,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'url.full': `http://localhost:3030/test-inbound-headers/${id}`, 'url.path': `/test-inbound-headers/${id}`, 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts index 4749feefddb1..dd82d22efe28 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts index 7597a8baacbc..ec7c7cdea632 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts @@ -20,8 +20,8 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.name']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts index 464850a116dd..11b033e63af9 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts @@ -75,8 +75,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -91,8 +91,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts b/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts index 7812077a547d..c6d37d21951b 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts @@ -89,8 +89,8 @@ test.describe('server - orchestrion build-time db instrumentation', () => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -105,8 +105,8 @@ test.describe('server - orchestrion build-time db instrumentation', () => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts index 5b2acfe85b61..55b5f14f9c36 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts @@ -20,8 +20,8 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.name']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts index 31d3569c77c5..8dd43bad15d0 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts @@ -62,8 +62,8 @@ test('Instruments mysql automatically via build-time orchestrion', async ({ base 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -78,8 +78,8 @@ test('Instruments mysql automatically via build-time orchestrion', async ({ base 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts index c9928586cd23..459922276f69 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts @@ -63,8 +63,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -79,8 +79,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts index df6c1593bde0..a3a94e3b3280 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts @@ -25,8 +25,8 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.peer.name']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['net.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); + expect(firstQuery!.data?.['network.peer.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts index 7fb3242a165a..4869a37d64bd 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts @@ -72,8 +72,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); @@ -88,8 +88,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.statement': 'SELECT NOW()', 'db.user': 'root', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': 3306, + 'server.address': expect.any(String), + 'network.peer.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts index b86a86f6adc8..ba31c2240283 100644 --- a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts @@ -24,17 +24,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'url.full': 'http://localhost:3030/test-transaction', 'url.path': '/test-transaction', 'http.host': 'localhost:3030', - 'net.host.name': 'localhost', + 'server.address': 'localhost', 'http.method': 'GET', 'http.scheme': 'http', 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', - 'net.transport': 'ip_tcp', - 'net.host.ip': expect.any(String), - 'net.host.port': expect.any(Number), - 'net.peer.ip': expect.any(String), - 'net.peer.port': expect.any(Number), + 'network.transport': 'tcp', + 'network.local.address': expect.any(String), + 'network.local.port': expect.any(Number), + 'network.peer.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts b/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts index 90b6a7c932b9..cb0791f9397d 100644 --- a/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts @@ -18,14 +18,12 @@ const expectedProducerSpan = (routingKey: string) => 'messaging.url': 'amqp://sentry:***@localhost:5672/', 'messaging.protocol': 'AMQP', 'messaging.protocol_version': '0.9.1', - 'net.peer.name': 'localhost', - 'net.peer.port': 5672, + 'server.address': 'localhost', 'messaging.operation.type': 'send', 'messaging.destination.name': '', 'messaging.rabbitmq.destination.routing_key': routingKey, 'network.protocol.name': 'AMQP', 'network.protocol.version': '0.9.1', - 'server.address': 'localhost', 'server.port': 5672, 'url.full': 'amqp://sentry:***@localhost:5672/', 'sentry.kind': 'producer', diff --git a/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts b/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts index 89b93622cce1..901c4d9229c1 100644 --- a/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/http-client-spans/http-strip-query/test.ts @@ -36,10 +36,10 @@ describe('outgoing http spans - strip query', () => { 'http.response_content_length_uncompressed': 0, 'http.status_code': 200, 'http.status_text': 'OK', - 'net.peer.ip': '::1', - 'net.peer.name': 'localhost', - 'net.peer.port': expect.any(Number), - 'net.transport': 'ip_tcp', + 'network.peer.address': '::1', + 'server.address': 'localhost', + 'network.peer.port': expect.any(Number), + 'network.transport': 'tcp', 'sentry.kind': 'client', 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.client', 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 c3b6cd63ec9f..a42f693a8850 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -118,12 +118,12 @@ describe('httpIntegration', () => { 'http.status_text': 'OK', 'http.target': '/test?a=1&b=2', 'http.user_agent': 'node', - 'net.host.ip': '::1', - 'net.host.name': 'localhost', - 'net.host.port': port, - 'net.peer.ip': '::1', - 'net.peer.port': expect.any(Number), - 'net.transport': 'ip_tcp', + 'network.local.address': '::1', + 'server.address': 'localhost', + 'network.local.port': port, + 'network.peer.address': '::1', + 'network.peer.port': expect.any(Number), + 'network.transport': 'tcp', 'sentry.kind': 'server', 'sentry.op': 'http.server', 'sentry.origin': 'auto.http.otel.http', @@ -160,12 +160,12 @@ describe('httpIntegration', () => { 'http.status_text': 'OK', 'http.target': '/test?a=1&b=2', 'http.user_agent': 'node', - 'net.host.ip': '::1', - 'net.host.name': 'localhost', - 'net.host.port': port, - 'net.peer.ip': '::1', - 'net.peer.port': expect.any(Number), - 'net.transport': 'ip_tcp', + 'network.local.address': '::1', + 'server.address': 'localhost', + 'network.local.port': port, + 'network.peer.address': '::1', + 'network.peer.port': expect.any(Number), + 'network.transport': 'tcp', 'sentry.kind': 'server', 'sentry.op': 'http.server', 'sentry.origin': 'auto.http.otel.http', diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts index 61135dae2cdd..52fd2722624d 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts @@ -21,8 +21,8 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di 'db.user': 'root', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 3307, + 'server.address': 'localhost', + 'network.peer.port': 3307, }), status: 'ok', description: @@ -37,8 +37,8 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di 'db.user': 'root', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 3307, + 'server.address': 'localhost', + 'network.peer.port': 3307, }), status: 'ok', description: 'insert into `User` (`email`, `name`) values (?, ?)', diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts index 32f25c3d54a4..aaee0b3bb328 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts @@ -20,8 +20,8 @@ describe('knex auto instrumentation', () => { 'db.name': 'tests', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 5445, + 'server.address': 'localhost', + 'network.peer.port': 5445, }), status: 'ok', description: @@ -35,8 +35,8 @@ describe('knex auto instrumentation', () => { 'db.name': 'tests', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 5445, + 'server.address': 'localhost', + 'network.peer.port': 5445, }), status: 'ok', // In the knex-otel spans, the placeholders (e.g., `$1`) are replaced by a `?`. diff --git a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts index 88880902a20a..95270f32d219 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts @@ -30,8 +30,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.mongodb.collection': 'movies', 'db.operation': 'find', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'db.statement': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -49,8 +49,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.mongodb.collection': 'movies', 'db.operation': 'insert', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'db.statement': '{"title":"?","_id":{"_bsontype":"?","id":"?"}}', 'sentry.kind': 'client', }, @@ -68,8 +68,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.mongodb.collection': '$cmd', 'db.operation': 'isMaster', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'db.statement': '{"ismaster":"?","client":{"driver":{"name":"?","version":"?"},"os":{"type":"?","name":"?","architecture":"?","version":"?"},"platform":"?"},"compression":[],"helloOk":"?"}', 'sentry.kind': 'client', @@ -89,8 +89,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.mongodb.collection': 'movies', 'db.operation': 'update', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'db.statement': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -123,8 +123,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.name': 'admin', 'db.mongodb.collection': '$cmd', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'network.peer.port': expect.any(Number), 'db.statement': '{"endSessions":[{"id":{"_bsontype":"?","sub_type":"?","position":"?","buffer":"?"}}]}', 'sentry.kind': 'client', }, diff --git a/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts b/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts index c437f385049f..34f4d27cb71c 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts @@ -46,8 +46,8 @@ describe('mysql auto instrumentation', () => { data: expect.objectContaining({ ...(origin ? { 'sentry.origin': origin } : {}), 'db.system': 'mysql', - 'net.peer.name': 'localhost', - 'net.peer.port': port, + 'server.address': 'localhost', + 'network.peer.port': port, 'db.user': 'root', }), status: 'ok', @@ -196,11 +196,11 @@ describe('mysql auto instrumentation', () => { type: 'string', value: 'root', }, - 'net.peer.name': { + 'server.address': { type: 'string', value: 'localhost', }, - 'net.peer.port': { + 'network.peer.port': { type: 'integer', value: expect.any(Number), }, diff --git a/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts index 1ce08680762a..7f91bb36627a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts @@ -21,8 +21,8 @@ describeWithDockerCompose('mysql2 auto instrumentation', { workingDirectory: [__ data: expect.objectContaining({ 'db.system': 'mysql', 'db.statement': 'SELECT 1 + 1 AS solution', - 'net.peer.name': 'localhost', - 'net.peer.port': 3306, + 'server.address': 'localhost', + 'network.peer.port': 3306, 'db.user': 'root', }), }), @@ -34,8 +34,8 @@ describeWithDockerCompose('mysql2 auto instrumentation', { workingDirectory: [__ data: expect.objectContaining({ 'db.system': 'mysql', 'db.statement': 'SELECT ? as a, ? as b, NOW() as c', - 'net.peer.name': 'localhost', - 'net.peer.port': 3306, + 'server.address': 'localhost', + 'network.peer.port': 3306, 'db.user': 'root', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts b/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts index 480d5168d7c3..a71b1081dd02 100644 --- a/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts @@ -28,11 +28,11 @@ const COMMON_DB_ATTRIBUTES = { type: 'string', value: 'test', }, - 'net.peer.name': { + 'server.address': { type: 'string', value: 'localhost', }, - 'net.peer.port': { + 'network.peer.port': { type: 'integer', value: expect.any(Number), }, @@ -102,7 +102,7 @@ function expectedDbSpan({ }): unknown { const attributes: Record = { ...COMMON_DB_ATTRIBUTES, - 'net.peer.name': { + 'server.address': { type: 'string', value: host, }, diff --git a/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts b/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts index d877a66b512e..17d77234b4b4 100644 --- a/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts @@ -20,8 +20,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory data: expect.objectContaining({ 'sentry.op': 'db', 'db.system': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6383, + 'server.address': 'localhost', + 'network.peer.port': 6383, 'db.statement': 'set test-key [1 other arguments]', }), }), @@ -32,8 +32,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory data: expect.objectContaining({ 'sentry.op': 'db', 'db.system': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6383, + 'server.address': 'localhost', + 'network.peer.port': 6383, 'db.statement': 'get test-key', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/redis/test.ts b/dev-packages/node-integration-tests/suites/tracing/redis/test.ts index a3d6a8702052..92a30f85add5 100644 --- a/dev-packages/node-integration-tests/suites/tracing/redis/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/redis/test.ts @@ -23,8 +23,8 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.op': 'db', 'sentry.origin': origin, 'db.system': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'network.peer.port': 6380, 'db.statement': 'set test-key [1 other arguments]', }), }), @@ -36,8 +36,8 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.op': 'db', 'sentry.origin': origin, 'db.system': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'network.peer.port': 6380, 'db.statement': 'get test-key', }), }), @@ -51,8 +51,8 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.op': 'db', 'sentry.origin': origin, 'db.system': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'network.peer.port': 6380, 'db.statement': 'incr test-key', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts b/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts index d5ff036297d8..19da4a2c035b 100644 --- a/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts @@ -19,8 +19,8 @@ describeWithDockerCompose('tedious auto instrumentation', { workingDirectory: [_ 'db.system': 'mssql', 'db.name': 'master', 'db.user': 'sa', - 'net.peer.name': '127.0.0.1', - 'net.peer.port': 1433, + 'server.address': '127.0.0.1', + 'network.peer.port': 1433, }), ...overrides, }); diff --git a/docs/migration/v11-end-state.md b/docs/migration/v11-end-state.md index 617a84f20726..95f7f4932ae2 100644 --- a/docs/migration/v11-end-state.md +++ b/docs/migration/v11-end-state.md @@ -524,9 +524,36 @@ String and regular-expression matching for `tracePropagationTargets` is now case Affected SDKs: All SDKs. -- The `http.query` and `http.fragment` span attributes were renamed to `url.query` and `url.fragment`. -- `network.*` span attributes were aligned across SDKs. -- Legacy messaging (`messaging.*`) and database (`db.statement`, …) span attributes on the AMQP and Redis instrumentations were replaced by their current semantic-convention equivalents. +If you reference these attributes in custom instrumentation, `beforeSendSpan`, dashboards, or alerts, update them to the new names. + +#### URL attributes + +The `http.query` and `http.fragment` span attributes were renamed to `url.query` and `url.fragment`. + +#### Network attributes + +Network-related span attributes now use the current Sentry semantic conventions. If you query, transform, or alert on the legacy `net.*` fields, update those references: + +| v10 attribute | v11 attribute | +| --------------- | ----------------------- | +| `net.host.name` | `server.address` | +| `net.host.ip` | `network.local.address` | +| `net.host.port` | `network.local.port` | +| `net.peer.name` | `server.address` | +| `net.peer.ip` | `network.peer.address` | +| `net.peer.port` | `network.peer.port` | +| `net.transport` | `network.transport` | + +Transport values also change from `ip_tcp` and `ip_udp` to `tcp` and `udp`. HTTP instrumentation reports the application protocol as `network.protocol.name: "http"` and reports its version separately in `network.protocol.version`. + +Attribute availability remains runtime-dependent. For example, browser and Worker APIs do not expose socket peer details, so those spans only include the network information their runtime provides. Client IP address collection remains controlled by `dataCollection.userInfo` where the runtime exposes it. + +#### Messaging and database attributes + +Legacy messaging (`messaging.*`) and database (`db.statement`, …) span attributes on the AMQP and Redis instrumentations were replaced by their current semantic-convention equivalents. + +#### GenAI attributes + - The gen_ai cache token attributes `gen_ai.usage.cache_creation_input_tokens` and `gen_ai.usage.cache_read_input_tokens` were renamed to `gen_ai.usage.cache_creation.input_tokens` and `gen_ai.usage.cache_read.input_tokens`. - The `gen_ai.system` span attribute was renamed to `gen_ai.provider.name` across all AI integrations. - The `gen_ai.request.available_tools` span attribute was renamed to `gen_ai.tool.definitions` across all AI integrations. @@ -534,9 +561,11 @@ Affected SDKs: All SDKs. - The `gen_ai.tool.output` span attribute was renamed to `gen_ai.tool.call.result` across all AI integrations. - The Vercel AI token attributes `gen_ai.usage.input_tokens.cached`, `gen_ai.usage.input_tokens.cache_write`, and `gen_ai.usage.output_tokens.reasoning` were renamed to `gen_ai.usage.cache_read.input_tokens`, `gen_ai.usage.cache_creation.input_tokens`, and `gen_ai.usage.reasoning.output_tokens`. - The deprecated `gen_ai.tool.type` span attribute is no longer set on tool spans. -- Span attributes now use the shared `@sentry/conventions` package under the hood. -If you reference these attributes in custom instrumentation, `beforeSendSpan`, dashboards, or alerts, update them to the new names. +#### Attribute constants + +Span attributes now use the shared `@sentry/conventions` package under the hood. +The deprecated `semanticAttributes` re-export was removed. Import span attribute constants from `@sentry/core` directly. ### Span operation (`op`) changes @@ -837,10 +866,6 @@ Sentry.init({ - `getSentryResource` was removed. - OpenTelemetry resources are no longer collected, and `contexts.otel.resource` was dropped from events. As a result, the `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES` environment variables are no longer read by the SDK. -### `@sentry/core` span attributes - -- The deprecated `semanticAttributes` re-export was removed. Import span attribute constants from `@sentry/core` directly. - ### AI integrations - The `enableTruncation` and `streamGenAiSpans` flags were removed. The new default is no truncation and to always stream gen AI spans. diff --git a/packages/cloudflare/src/request.ts b/packages/cloudflare/src/request.ts index 4f7e2fbbe916..07d5435e4084 100644 --- a/packages/cloudflare/src/request.ts +++ b/packages/cloudflare/src/request.ts @@ -1,4 +1,5 @@ import type { CfProperties, IncomingRequestCfProperties } from '@cloudflare/workers-types'; +import { NETWORK_PROTOCOL_NAME, NETWORK_PROTOCOL_VERSION } from '@sentry/conventions/attributes'; import { captureException, continueTrace, @@ -121,7 +122,9 @@ export function wrapRequestHandlerWithInit( addCultureContext(isolationScope, request.cf); if (typeof request.cf.httpProtocol === 'string') { - attributes['network.protocol.name'] = request.cf.httpProtocol; + const [protocolName, protocolVersion] = request.cf.httpProtocol.toLowerCase().split('/'); + attributes[NETWORK_PROTOCOL_NAME] = protocolName; + attributes[NETWORK_PROTOCOL_VERSION] = protocolVersion; } } diff --git a/packages/cloudflare/test/request.test.ts b/packages/cloudflare/test/request.test.ts index 61f43e7c91e7..44587f6224de 100644 --- a/packages/cloudflare/test/request.test.ts +++ b/packages/cloudflare/test/request.test.ts @@ -598,7 +598,8 @@ describe('withSentry', () => { 'http.request.method': 'GET', 'url.full': 'https://example.com/', 'server.address': 'example.com', - 'network.protocol.name': 'HTTP/1.1', + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', 'url.scheme': 'https:', 'url.path': '/', 'sentry.sample_rate': 1, diff --git a/packages/core/src/fetch.ts b/packages/core/src/fetch.ts index cfcba668dac5..1e414aa9c226 100644 --- a/packages/core/src/fetch.ts +++ b/packages/core/src/fetch.ts @@ -1,5 +1,12 @@ /* eslint-disable max-lines */ -import { HTTP_METHOD, SERVER_ADDRESS, URL_FRAGMENT, URL_FULL, URL_QUERY } from '@sentry/conventions/attributes'; +import { + HTTP_METHOD, + SERVER_ADDRESS, + SERVER_PORT, + URL_FRAGMENT, + URL_FULL, + URL_QUERY, +} from '@sentry/conventions/attributes'; import type { Client } from './client'; import { getClient } from './currentScopes'; import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes'; @@ -365,7 +372,8 @@ function getFetchSpanAttributes( if (parsedUrl) { if (!isURLObjectRelative(parsedUrl)) { attributes[URL_FULL] = filterCollectedUrl(stripDataUrlContent(parsedUrl.href), client); - attributes[SERVER_ADDRESS] = parsedUrl.host; + attributes[SERVER_ADDRESS] = parsedUrl.hostname; + attributes[SERVER_PORT] = parsedUrl.port ? Number(parsedUrl.port) : undefined; } attributes[URL_QUERY] = filterCollectedUrlQuery(getUrlQuery(parsedUrl.search), client); attributes[URL_FRAGMENT] = getUrlFragment(parsedUrl.hash); diff --git a/packages/core/src/integrations/http/get-outgoing-span-data.ts b/packages/core/src/integrations/http/get-outgoing-span-data.ts index 96a6d8812919..ff400f1b138e 100644 --- a/packages/core/src/integrations/http/get-outgoing-span-data.ts +++ b/packages/core/src/integrations/http/get-outgoing-span-data.ts @@ -9,7 +9,15 @@ import { HTTP_HOST, HTTP_METHOD, HTTP_TARGET, - NET_PEER_NAME, + NETWORK_LOCAL_ADDRESS, + NETWORK_LOCAL_PORT, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_PROTOCOL_NAME, + NETWORK_PROTOCOL_VERSION, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_KIND, URL_FULL, USER_AGENT_ORIGINAL, @@ -41,7 +49,8 @@ export function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpa /* eslint-disable typescript/no-deprecated */ [HTTP_METHOD]: request.method, [HTTP_TARGET]: filterCollectedUrl(request.path || '/'), - [NET_PEER_NAME]: request.host, + [SERVER_ADDRESS]: request.host, + [SERVER_PORT]: typeof request.port === 'number' ? request.port : undefined, [HTTP_HOST]: request.getHeader('host') as string | undefined, /* eslint-enable typescript/no-deprecated */ [USER_AGENT_ORIGINAL]: userAgent || undefined, @@ -56,16 +65,16 @@ export function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpa */ export function setIncomingResponseSpanData(response: HttpIncomingMessage, span: Span): void { const { statusCode, statusMessage, httpVersion, socket } = response; - const transport = httpVersion?.toUpperCase() !== 'QUIC' ? 'ip_tcp' : 'ip_udp'; + const transport = httpVersion?.toUpperCase() !== 'QUIC' ? 'tcp' : 'udp'; span.setAttributes({ 'http.response.status_code': statusCode, - 'network.protocol.version': httpVersion, + [NETWORK_PROTOCOL_NAME]: 'http', + [NETWORK_PROTOCOL_VERSION]: httpVersion, // TODO(v11): Update these to the Sentry semantic attributes for urls. // https://getsentry.github.io/sentry-conventions/attributes/ 'http.flavor': httpVersion, - 'network.transport': transport, - 'net.transport': transport, + [NETWORK_TRANSPORT]: transport, 'http.status_text': statusMessage?.toUpperCase(), 'http.status_code': statusCode, ...getResponseContentLengthAttributes(response), @@ -75,12 +84,12 @@ export function setIncomingResponseSpanData(response: HttpIncomingMessage, span: function getSocketAttrs(socket: HttpIncomingMessage['socket']): SpanAttributes { if (!socket) return {}; - const { remoteAddress, remotePort } = socket; + const { localAddress, localPort, remoteAddress, remotePort } = socket; return { - 'network.peer.address': remoteAddress, - 'network.peer.port': remotePort, - 'net.peer.ip': remoteAddress, - 'net.peer.port': remotePort, + [NETWORK_LOCAL_ADDRESS]: localAddress, + [NETWORK_LOCAL_PORT]: localPort, + [NETWORK_PEER_ADDRESS]: remoteAddress, + [NETWORK_PEER_PORT]: remotePort, }; } diff --git a/packages/core/src/integrations/http/server-subscription.ts b/packages/core/src/integrations/http/server-subscription.ts index ee7f09ab47d4..9c898ed4fc91 100644 --- a/packages/core/src/integrations/http/server-subscription.ts +++ b/packages/core/src/integrations/http/server-subscription.ts @@ -40,7 +40,22 @@ import { import { safeMathRandom } from '../../utils/randomSafeContext'; import type { SpanAttributes } from '../../types/span'; import type { SpanStatus } from '../../types/spanStatus'; -import { URL_FULL, URL_PATH, SENTRY_KIND } from '@sentry/conventions/attributes'; +import { + CLIENT_ADDRESS, + CLIENT_PORT, + NETWORK_LOCAL_ADDRESS, + NETWORK_LOCAL_PORT, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_PROTOCOL_NAME, + NETWORK_PROTOCOL_VERSION, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, + URL_FULL, + URL_PATH, + SENTRY_KIND, +} from '@sentry/conventions/attributes'; import { filterCollectedUrl } from '../../utils/data-collection/filterCollectedUrl'; // Tree-shakable guard to remove all code related to tracing @@ -282,6 +297,7 @@ function buildServerSpanWrap( const scheme = fullUrl.startsWith('https') ? 'https' : 'http'; const { socket } = request; const { localAddress, localPort, remoteAddress, remotePort } = socket ?? {}; + const collectClientAddress = client.getDataCollectionOptions().userInfo; return startSpanManual( { @@ -293,10 +309,14 @@ function buildServerSpanWrap( [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', [SENTRY_KIND]: 'server', // Network attributes - 'net.host.ip': localAddress, - 'net.host.port': localPort, - 'net.peer.ip': remoteAddress, - 'net.peer.port': remotePort, + [SERVER_ADDRESS]: hostname, + [SERVER_PORT]: localPort, + [NETWORK_LOCAL_ADDRESS]: localAddress, + [NETWORK_LOCAL_PORT]: localPort, + [CLIENT_ADDRESS]: collectClientAddress ? remoteAddress : undefined, + [CLIENT_PORT]: remotePort, + [NETWORK_PEER_ADDRESS]: collectClientAddress ? remoteAddress : undefined, + [NETWORK_PEER_PORT]: remotePort, 'sentry.http.prefetch': isKnownPrefetchRequest(request) || undefined, // Old Semantic Conventions attributes for compatibility [URL_FULL]: filterCollectedUrl(fullUrl, client), @@ -307,12 +327,13 @@ function buildServerSpanWrap( client, ), 'http.host': host, - 'net.host.name': hostname, + [NETWORK_PROTOCOL_NAME]: 'http', + [NETWORK_PROTOCOL_VERSION]: httpVersion, 'http.client_ip': typeof ips === 'string' ? ips.split(',')[0] : undefined, 'http.user_agent': userAgent, 'http.scheme': scheme, 'http.flavor': httpVersion, - 'net.transport': httpVersion?.toUpperCase() === 'QUIC' ? 'ip_udp' : 'ip_tcp', + [NETWORK_TRANSPORT]: httpVersion?.toUpperCase() === 'QUIC' ? 'udp' : 'tcp', ...getRequestContentLengthAttribute(request), ...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, dataCollectionOptions), }, diff --git a/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts b/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts index 90b3b1e06744..72c8b22aa0e6 100644 --- a/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts +++ b/packages/core/test/lib/integrations/http/get-outgoing-span-data.test.ts @@ -5,7 +5,18 @@ import { } from '../../../../src/integrations/http/get-outgoing-span-data'; import type { HttpClientRequest, HttpIncomingMessage } from '../../../../src/integrations/http/types'; import type { Span } from '../../../../src/types/span'; -import { HTTP_METHOD, HTTP_TARGET, NET_PEER_NAME, URL_FULL } from '@sentry/conventions/attributes'; +import { + HTTP_METHOD, + HTTP_TARGET, + NETWORK_LOCAL_ADDRESS, + NETWORK_LOCAL_PORT, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, + URL_FULL, +} from '@sentry/conventions/attributes'; function makeMockRequest(overrides: Partial> = {}): HttpClientRequest { return { @@ -65,13 +76,14 @@ describe('getOutgoingRequestSpanData', () => { expect(result.name).toMatch(/^POST /); }); - it('includes URL_FULL, HTTP_METHOD, HTTP_TARGET, NET_PEER_NAME', () => { + it('includes URL_FULL, HTTP_METHOD, HTTP_TARGET, and server endpoint attributes', () => { const result = getOutgoingRequestSpanData(makeMockRequest()); expect(result.attributes).toMatchObject({ [URL_FULL]: 'http://example.com/api/test', [HTTP_METHOD]: 'GET', [HTTP_TARGET]: '/api/test', - [NET_PEER_NAME]: 'example.com', + [SERVER_ADDRESS]: 'example.com', + [SERVER_PORT]: 80, }); }); @@ -124,20 +136,16 @@ describe('setIncomingResponseSpanData', () => { expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ 'http.status_text': 'CREATED' })); }); - it('uses ip_tcp transport for non-QUIC connections', () => { + it('uses tcp transport for non-QUIC connections', () => { const span = makeMockSpan(); setIncomingResponseSpanData(makeMockResponse({ httpVersion: '1.1' }), span); - expect(span.setAttributes).toHaveBeenCalledWith( - expect.objectContaining({ 'network.transport': 'ip_tcp', 'net.transport': 'ip_tcp' }), - ); + expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ [NETWORK_TRANSPORT]: 'tcp' })); }); - it('uses ip_udp transport for QUIC connections', () => { + it('uses udp transport for QUIC connections', () => { const span = makeMockSpan(); setIncomingResponseSpanData(makeMockResponse({ httpVersion: 'QUIC' }), span); - expect(span.setAttributes).toHaveBeenCalledWith( - expect.objectContaining({ 'network.transport': 'ip_udp', 'net.transport': 'ip_udp' }), - ); + expect(span.setAttributes).toHaveBeenCalledWith(expect.objectContaining({ [NETWORK_TRANSPORT]: 'udp' })); }); it('includes socket address and port attributes when socket is present', () => { @@ -148,10 +156,10 @@ describe('setIncomingResponseSpanData', () => { setIncomingResponseSpanData(response, span); expect(span.setAttributes).toHaveBeenCalledWith( expect.objectContaining({ - 'network.peer.address': '1.2.3.4', - 'network.peer.port': 12345, - 'net.peer.ip': '1.2.3.4', - 'net.peer.port': 12345, + [NETWORK_LOCAL_ADDRESS]: undefined, + [NETWORK_LOCAL_PORT]: undefined, + [NETWORK_PEER_ADDRESS]: '1.2.3.4', + [NETWORK_PEER_PORT]: 12345, }), ); }); diff --git a/packages/core/test/lib/integrations/http/server-subscription.test.ts b/packages/core/test/lib/integrations/http/server-subscription.test.ts index 153e853ce56b..19179b12a8e1 100644 --- a/packages/core/test/lib/integrations/http/server-subscription.test.ts +++ b/packages/core/test/lib/integrations/http/server-subscription.test.ts @@ -1,4 +1,18 @@ -import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; +import { + CLIENT_ADDRESS, + CLIENT_PORT, + NETWORK_LOCAL_ADDRESS, + NETWORK_LOCAL_PORT, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_PROTOCOL_NAME, + NETWORK_PROTOCOL_VERSION, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, + URL_FULL, + URL_PATH, +} from '@sentry/conventions/attributes'; import * as http from 'node:http'; import type { AddressInfo } from 'node:net'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -109,6 +123,17 @@ describe('getHttpServerSubscriptions', () => { 'sentry.source': 'url', [URL_FULL]: expect.stringMatching(/\/users\/42\?foo=bar$/), [URL_PATH]: '/users/42', + [SERVER_ADDRESS]: '127.0.0.1', + [SERVER_PORT]: expect.any(Number), + [NETWORK_LOCAL_ADDRESS]: '127.0.0.1', + [NETWORK_LOCAL_PORT]: expect.any(Number), + [CLIENT_ADDRESS]: '127.0.0.1', + [CLIENT_PORT]: expect.any(Number), + [NETWORK_PEER_ADDRESS]: '127.0.0.1', + [NETWORK_PEER_PORT]: expect.any(Number), + [NETWORK_PROTOCOL_NAME]: 'http', + [NETWORK_PROTOCOL_VERSION]: '1.1', + [NETWORK_TRANSPORT]: 'tcp', }), }), ); diff --git a/packages/deno/src/wrap-deno-request-handler.ts b/packages/deno/src/wrap-deno-request-handler.ts index c71c950b3d30..4d45be9d096a 100644 --- a/packages/deno/src/wrap-deno-request-handler.ts +++ b/packages/deno/src/wrap-deno-request-handler.ts @@ -1,3 +1,4 @@ +import { CLIENT_ADDRESS, CLIENT_PORT, NETWORK_PROTOCOL_NAME } from '@sentry/conventions/attributes'; import type { Integration, MaxRequestBodySize } from '@sentry/core'; import { captureBodyFromWinterCGRequest, @@ -73,14 +74,17 @@ export const wrapDenoRequestHandler = ( assignIfSet(attributes, 'user_agent.original', request.headers.get('user-agent')); const dataCollection = client.getDataCollectionOptions(); + const clientAddress = (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path; + const clientPort = (info?.remoteAddr as Deno.NetAddr)?.port; if (dataCollection.userInfo) { - assignIfSet( - attributes, - 'client.address', - (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path, - ); - assignIfSet(attributes, 'client.port', (info?.remoteAddr as Deno.NetAddr)?.port); + assignIfSet(attributes, CLIENT_ADDRESS, clientAddress); + assignIfSet(attributes, CLIENT_PORT, clientPort); } + assignIfSet( + attributes, + NETWORK_PROTOCOL_NAME, + urlObject && !('isRelative' in urlObject) ? urlObject.protocol.slice(0, -1) : undefined, + ); Object.assign(attributes, httpHeadersToSpanAttributes(winterCGHeadersToDict(request.headers), dataCollection)); attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] = 'http.server'; diff --git a/packages/node/src/integrations/http/httpServerSpansIntegration.ts b/packages/node/src/integrations/http/httpServerSpansIntegration.ts index cf0bd2846420..4b0945d0fdc3 100644 --- a/packages/node/src/integrations/http/httpServerSpansIntegration.ts +++ b/packages/node/src/integrations/http/httpServerSpansIntegration.ts @@ -11,12 +11,17 @@ import { HTTP_STATUS_CODE, HTTP_TARGET, HTTP_USER_AGENT, - NET_HOST_IP, - NET_HOST_NAME, - NET_HOST_PORT, - NET_PEER_IP, - NET_PEER_PORT, - NET_TRANSPORT, + CLIENT_ADDRESS, + CLIENT_PORT, + NETWORK_LOCAL_ADDRESS, + NETWORK_LOCAL_PORT, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + NETWORK_PROTOCOL_NAME, + NETWORK_PROTOCOL_VERSION, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_HTTP_PREFETCH, URL_FRAGMENT, URL_FULL, @@ -191,12 +196,14 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions client, ), [HTTP_HOST]: host, - [NET_HOST_NAME]: hostname, + [SERVER_ADDRESS]: hostname, + [NETWORK_PROTOCOL_NAME]: 'http', + [NETWORK_PROTOCOL_VERSION]: httpVersion, [HTTP_CLIENT_IP]: typeof ips === 'string' ? ips.split(',')[0] : undefined, [HTTP_USER_AGENT]: userAgent, [HTTP_SCHEME]: scheme, [HTTP_FLAVOR]: httpVersion, - [NET_TRANSPORT]: httpVersion?.toUpperCase() === 'QUIC' ? 'ip_udp' : 'ip_tcp', + [NETWORK_TRANSPORT]: httpVersion?.toUpperCase() === 'QUIC' ? 'udp' : 'tcp', /* eslint-enable typescript/no-deprecated */ ...getRequestContentLengthAttribute(request), ...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, client.getDataCollectionOptions()), @@ -223,7 +230,11 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions isEnded = true; - const newAttributes = getIncomingRequestAttributesOnResponse(request, response); + const newAttributes = getIncomingRequestAttributesOnResponse( + request, + response, + client.getDataCollectionOptions().userInfo, + ); span.setAttributes(newAttributes); span.setStatus(status); span.end(); @@ -399,6 +410,7 @@ function isCompressed(headers: IncomingHttpHeaders): boolean { function getIncomingRequestAttributesOnResponse( request: HttpIncomingMessage, response: HttpServerResponse, + collectClientAddress: boolean, ): SpanAttributes { // take socket from the request, // since it may be detached from the response object in keep-alive mode @@ -414,14 +426,13 @@ function getIncomingRequestAttributesOnResponse( if (socket) { const { localAddress, localPort, remoteAddress, remotePort } = socket; - // eslint-disable-next-line typescript/no-deprecated - newAttributes[NET_HOST_IP] = localAddress; - // eslint-disable-next-line typescript/no-deprecated - newAttributes[NET_HOST_PORT] = localPort; - // eslint-disable-next-line typescript/no-deprecated - newAttributes[NET_PEER_IP] = remoteAddress; - // oxlint-disable-next-line typescript/no-deprecated - newAttributes[NET_PEER_PORT] = remotePort; + newAttributes[SERVER_PORT] = localPort; + newAttributes[NETWORK_LOCAL_ADDRESS] = localAddress; + newAttributes[NETWORK_LOCAL_PORT] = localPort; + newAttributes[CLIENT_ADDRESS] = collectClientAddress ? remoteAddress : undefined; + newAttributes[CLIENT_PORT] = remotePort; + newAttributes[NETWORK_PEER_ADDRESS] = collectClientAddress ? remoteAddress : undefined; + newAttributes[NETWORK_PEER_PORT] = remotePort; } return newAttributes; diff --git a/packages/node/src/integrations/tracing/redis/cache.ts b/packages/node/src/integrations/tracing/redis/cache.ts index 826f1e4e9465..483549a9eeb4 100644 --- a/packages/node/src/integrations/tracing/redis/cache.ts +++ b/packages/node/src/integrations/tracing/redis/cache.ts @@ -75,8 +75,8 @@ export const cacheResponseHook: IORedisResponseCustomAttributeFunction = ( // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database // set for node-redis v4/v5. const spanData = spanToJSON(span).data; - const networkPeerAddress = spanData['net.peer.name'] ?? spanData['server.address']; - const networkPeerPort = spanData['net.peer.port'] ?? spanData['server.port']; + const networkPeerAddress = spanData['server.address']; + const networkPeerPort = spanData['server.port']; if (networkPeerPort && networkPeerAddress) { span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort }); } diff --git a/packages/server-utils/src/integrations/tracing-channel/amqplib.ts b/packages/server-utils/src/integrations/tracing-channel/amqplib.ts index 4ca0c8342ee2..7e6bbf938cf8 100644 --- a/packages/server-utils/src/integrations/tracing-channel/amqplib.ts +++ b/packages/server-utils/src/integrations/tracing-channel/amqplib.ts @@ -11,14 +11,11 @@ import { startInactiveSpan, timestampInSeconds, } from '@sentry/core'; -// eslint-disable-next-line typescript/no-deprecated -- NET_PEER_* emitted alongside SERVER_* for backwards compatibility (TODO(v11): remove) import { MESSAGING_SYSTEM, MESSAGING_MESSAGE_ID, MESSAGING_OPERATION_TYPE, MESSAGING_DESTINATION_NAME, - NET_PEER_NAME, - NET_PEER_PORT, NETWORK_PROTOCOL_NAME, NETWORK_PROTOCOL_VERSION, SENTRY_KIND, @@ -568,11 +565,6 @@ function getConnectionAttributesFromUrl(url: unknown): SpanAttributes { attributes[SERVER_ADDRESS] = hostname; attributes[SERVER_PORT] = port; - // TODO(v11): remove deprecated options - // eslint-disable-next-line typescript/no-deprecated -- emitted alongside SERVER_ADDRESS/SERVER_PORT for backwards compatibility - attributes[NET_PEER_NAME] = hostname; - // eslint-disable-next-line typescript/no-deprecated -- emitted alongside SERVER_ADDRESS/SERVER_PORT for backwards compatibility - attributes[NET_PEER_PORT] = port; } else if (typeof resolvedUrl === 'string') { const censoredUrl = censorPassword(resolvedUrl); attributes[ATTR_MESSAGING_URL] = censoredUrl; // todo(v11) remove this attribute @@ -590,10 +582,6 @@ function getConnectionAttributesFromUrl(url: unknown): SpanAttributes { attributes[SERVER_ADDRESS] = hostname; attributes[SERVER_PORT] = port; - // eslint-disable-next-line typescript/no-deprecated -- emitted alongside SERVER_ADDRESS/SERVER_PORT for backwards compatibility - attributes[NET_PEER_NAME] = hostname; - // eslint-disable-next-line typescript/no-deprecated -- emitted alongside SERVER_ADDRESS/SERVER_PORT for backwards compatibility - attributes[NET_PEER_PORT] = port; } catch { // best-effort: a malformed url simply yields fewer connection attributes } diff --git a/packages/server-utils/src/integrations/tracing-channel/ioredis.ts b/packages/server-utils/src/integrations/tracing-channel/ioredis.ts index 0acf0d00096e..c84298071606 100644 --- a/packages/server-utils/src/integrations/tracing-channel/ioredis.ts +++ b/packages/server-utils/src/integrations/tracing-channel/ioredis.ts @@ -3,7 +3,7 @@ `db.statement`). TODO(v11): switch to the non-deprecated `db.system.name`/`db.query.text`/ `server.address`/`server.port` conventions and drop this disable. */ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { DB_STATEMENT, DB_SYSTEM, NET_PEER_NAME, NET_PEER_PORT } from '@sentry/conventions/attributes'; +import { DB_STATEMENT, DB_SYSTEM, SERVER_ADDRESS, SERVER_PORT } from '@sentry/conventions/attributes'; import type { IntegrationFn, Span } from '@sentry/core'; import { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; import { CHANNELS } from '../../orchestrion/channels'; @@ -56,8 +56,8 @@ function connectionAttributes(host: string | undefined, port: number | undefined return { [DB_SYSTEM]: 'redis', [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`, - [NET_PEER_NAME]: host, - [NET_PEER_PORT]: port, + [SERVER_ADDRESS]: host, + [SERVER_PORT]: port, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, }; } diff --git a/packages/server-utils/src/integrations/tracing-channel/knex.ts b/packages/server-utils/src/integrations/tracing-channel/knex.ts index 8e781b460f0f..74fd96f3bbfc 100644 --- a/packages/server-utils/src/integrations/tracing-channel/knex.ts +++ b/packages/server-utils/src/integrations/tracing-channel/knex.ts @@ -1,7 +1,4 @@ -// The `@sentry/conventions` db/net attribute keys are deprecated (superseded by newer semconv), but we -// emit them deliberately to preserve parity with what `@opentelemetry/instrumentation-knex` produced. -/* oxlint-disable typescript/no-deprecated */ - +/* oxlint-disable typescript/no-deprecated -- legacy database attributes remain for compatibility. */ import * as diagnosticsChannel from 'node:diagnostics_channel'; import type { IntegrationFn, Span, SpanAttributes } from '@sentry/core'; import { @@ -20,9 +17,9 @@ import { DB_STATEMENT, DB_SYSTEM, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, - NET_TRANSPORT, + NETWORK_TRANSPORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_KIND, } from '@sentry/conventions/attributes'; import { DEBUG_BUILD } from '../../debug-build'; @@ -176,9 +173,9 @@ function subscribeQuery(): void { [DB_OPERATION]: operation, [DB_USER]: connection?.user, [DB_NAME]: name, - [NET_PEER_NAME]: connection?.host ?? extractHostFromConnectionString(connectionString), - [NET_PEER_PORT]: connection?.port ?? extractPortFromConnectionString(connectionString), - [NET_TRANSPORT]: connection?.filename === ':memory:' ? 'inproc' : undefined, + [SERVER_ADDRESS]: connection?.host ?? extractHostFromConnectionString(connectionString), + [SERVER_PORT]: connection?.port ?? extractPortFromConnectionString(connectionString), + [NETWORK_TRANSPORT]: connection?.filename === ':memory:' ? 'inproc' : undefined, [DB_STATEMENT]: dbStatement, }; diff --git a/packages/server-utils/src/integrations/tracing-channel/mysql.ts b/packages/server-utils/src/integrations/tracing-channel/mysql.ts index f62aff730943..364ca2891105 100644 --- a/packages/server-utils/src/integrations/tracing-channel/mysql.ts +++ b/packages/server-utils/src/integrations/tracing-channel/mysql.ts @@ -1,5 +1,5 @@ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { SENTRY_KIND } from '@sentry/conventions/attributes'; +import { SERVER_ADDRESS, SERVER_PORT, SENTRY_KIND } from '@sentry/conventions/attributes'; import type { IntegrationFn, Scope } from '@sentry/core'; import { isObjectLike, @@ -26,8 +26,6 @@ const ATTR_DB_CONNECTION_STRING = 'db.connection_string'; const ATTR_DB_NAME = 'db.name'; const ATTR_DB_USER = 'db.user'; const ATTR_DB_STATEMENT = 'db.statement'; -const ATTR_NET_PEER_NAME = 'net.peer.name'; -const ATTR_NET_PEER_PORT = 'net.peer.port'; /** * The shape orchestrion's transform attaches to the tracing-channel `context` object. Documented here @@ -90,8 +88,8 @@ function instrumentMysql(): void { ...(database ? { [ATTR_DB_NAME]: database } : {}), ...(user ? { [ATTR_DB_USER]: user } : {}), ...(sql ? { [ATTR_DB_STATEMENT]: sql } : {}), - ...(host ? { [ATTR_NET_PEER_NAME]: host } : {}), - ...(portIsNumber ? { [ATTR_NET_PEER_PORT]: portNumber } : {}), + ...(host ? { [SERVER_ADDRESS]: host } : {}), + ...(portIsNumber ? { [SERVER_PORT]: portNumber } : {}), }, }); }, diff --git a/packages/server-utils/src/integrations/tracing-channel/mysql2.ts b/packages/server-utils/src/integrations/tracing-channel/mysql2.ts index 4fdefcdc80b6..f009909e8843 100644 --- a/packages/server-utils/src/integrations/tracing-channel/mysql2.ts +++ b/packages/server-utils/src/integrations/tracing-channel/mysql2.ts @@ -19,8 +19,8 @@ import { DB_STATEMENT, DB_SYSTEM, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_KIND, } from '@sentry/conventions/attributes'; @@ -127,9 +127,9 @@ function getConnectionAttributes(config: Mysql2ConnectionConfig | undefined): Sp [DB_NAME]: database || undefined, [DB_USER]: user || undefined, // oxlint-disable-next-line typescript/no-deprecated - [NET_PEER_NAME]: host || undefined, + [SERVER_ADDRESS]: host || undefined, // oxlint-disable-next-line typescript/no-deprecated - [NET_PEER_PORT]: portIsNumber ? portNumber : undefined, + [SERVER_PORT]: portIsNumber ? portNumber : undefined, }; } diff --git a/packages/server-utils/src/integrations/tracing-channel/postgres.ts b/packages/server-utils/src/integrations/tracing-channel/postgres.ts index b0a067a15073..33cbc7696a15 100644 --- a/packages/server-utils/src/integrations/tracing-channel/postgres.ts +++ b/packages/server-utils/src/integrations/tracing-channel/postgres.ts @@ -1,5 +1,5 @@ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { SENTRY_KIND } from '@sentry/conventions/attributes'; +import { SERVER_ADDRESS, SERVER_PORT, SENTRY_KIND } from '@sentry/conventions/attributes'; import type { IntegrationFn, Scope, SpanAttributes } from '@sentry/core'; import { isObjectLike, @@ -29,8 +29,6 @@ const ATTR_DB_NAME = 'db.name'; const ATTR_DB_CONNECTION_STRING = 'db.connection_string'; const ATTR_DB_USER = 'db.user'; const ATTR_DB_STATEMENT = 'db.statement'; -const ATTR_NET_PEER_NAME = 'net.peer.name'; -const ATTR_NET_PEER_PORT = 'net.peer.port'; const ATTR_PG_PLAN = 'db.postgresql.plan'; const ATTR_PG_IDLE_TIMEOUT = 'db.postgresql.idle.timeout.millis'; const ATTR_PG_MAX_CLIENT = 'db.postgresql.max.client'; @@ -220,8 +218,8 @@ function getConnectionAttributes(params: PgConnectionParams): SpanAttributes { [ATTR_DB_CONNECTION_STRING]: getConnectionString(params), [ATTR_DB_NAME]: params.database, [ATTR_DB_USER]: params.user, - [ATTR_NET_PEER_NAME]: params.host, - [ATTR_NET_PEER_PORT]: Number.isInteger(params.port) ? params.port : undefined, + [SERVER_ADDRESS]: params.host, + [SERVER_PORT]: Number.isInteger(params.port) ? params.port : undefined, }; } @@ -245,9 +243,9 @@ function getPoolConnectionAttributes(opts: PgPoolOptions): SpanAttributes { [ATTR_PG_IDLE_TIMEOUT]: opts.idleTimeoutMillis, [ATTR_PG_MAX_CLIENT]: opts.max, [ATTR_DB_NAME]: database, - [ATTR_NET_PEER_PORT]: port, + [SERVER_PORT]: port, // these two come from a url parse and slice, can be '' - [ATTR_NET_PEER_NAME]: host || undefined, + [SERVER_ADDRESS]: host || undefined, [ATTR_DB_USER]: user || undefined, }; } diff --git a/packages/server-utils/src/integrations/tracing-channel/redis.ts b/packages/server-utils/src/integrations/tracing-channel/redis.ts index e76fe8b18832..dbb032a7e6a6 100644 --- a/packages/server-utils/src/integrations/tracing-channel/redis.ts +++ b/packages/server-utils/src/integrations/tracing-channel/redis.ts @@ -1,17 +1,13 @@ -/* eslint-disable @typescript-eslint/no-deprecated -- we intentionally emit the OLD db/net semconv - to match `@opentelemetry/instrumentation-redis`. TODO(v11): switch to the non-deprecated - `db.system.name`/`db.query.text`/`server.address`/`server.port` conventions and drop this disable. */ +/* oxlint-disable typescript/no-deprecated -- legacy database attributes remain for compatibility. */ import * as diagnosticsChannel from 'node:diagnostics_channel'; import { DB_OPERATION_BATCH_SIZE, DB_STATEMENT, DB_SYSTEM, DB_SYSTEM_NAME, - NET_PEER_NAME, - NET_PEER_PORT, - SENTRY_KIND, SERVER_ADDRESS, SERVER_PORT, + SENTRY_KIND, SENTRY_OP, } from '@sentry/conventions/attributes'; import { DATABASE_DB_QUERY_SPAN_OP, DATABASE_DB_SPAN_OP } from '@sentry/conventions/op'; @@ -135,8 +131,8 @@ function removeCredentialsFromConnectionString(url: string | undefined): string function nodeRedisAttributes(options: NodeRedisClientOptions | undefined): SpanAttributes { return { [DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS, - [NET_PEER_NAME]: options?.socket?.host, - [NET_PEER_PORT]: options?.socket?.port, + [SERVER_ADDRESS]: options?.socket?.host, + [SERVER_PORT]: options?.socket?.port, [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromConnectionString(options?.url), [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, }; @@ -183,8 +179,8 @@ function subscribeLegacyRedisCommand(responseHook: RedisResponseHook | undefined [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, }; - attributes[NET_PEER_NAME] = client?.connection_options?.host; - attributes[NET_PEER_PORT] = client?.connection_options?.port; + attributes[SERVER_ADDRESS] = client?.connection_options?.host; + attributes[SERVER_PORT] = client?.connection_options?.port; if (client?.address) { attributes[ATTR_DB_CONNECTION_STRING] = `redis://${client.address}`; diff --git a/packages/server-utils/src/integrations/tracing-channel/tedious.ts b/packages/server-utils/src/integrations/tracing-channel/tedious.ts index 007f6b32bfad..3453be37bfe5 100644 --- a/packages/server-utils/src/integrations/tracing-channel/tedious.ts +++ b/packages/server-utils/src/integrations/tracing-channel/tedious.ts @@ -16,8 +16,8 @@ import { DB_STATEMENT, DB_SYSTEM, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_KIND, } from '@sentry/conventions/attributes'; import { CHANNELS } from '../../orchestrion/channels'; @@ -136,8 +136,8 @@ function subscribeQuery(channelName: string, operation: string): void { [DB_USER]: connection.config?.userName ?? connection.config?.authentication?.options?.userName, [DB_STATEMENT]: sql, [ATTR_DB_SQL_TABLE]: request.table, - [NET_PEER_NAME]: connection.config?.server, - [NET_PEER_PORT]: connection.config?.options?.port, + [SERVER_ADDRESS]: connection.config?.server, + [SERVER_PORT]: connection.config?.options?.port, }; const span = startInactiveSpan({ diff --git a/packages/server-utils/src/mongodb/mongodb-span.ts b/packages/server-utils/src/mongodb/mongodb-span.ts index ac4a242128de..59014a1f88e2 100644 --- a/packages/server-utils/src/mongodb/mongodb-span.ts +++ b/packages/server-utils/src/mongodb/mongodb-span.ts @@ -7,8 +7,8 @@ import { DB_OPERATION, DB_STATEMENT, DB_SYSTEM, - NET_PEER_NAME, - NET_PEER_PORT, + SERVER_ADDRESS, + SERVER_PORT, SENTRY_KIND, } from '@sentry/conventions/attributes'; import type { Span, SpanAttributes } from '@sentry/core'; @@ -132,10 +132,10 @@ export function getSpanAttributes( }; if (host && port) { - attributes[NET_PEER_NAME] = host; + attributes[SERVER_ADDRESS] = host; const portNumber = parseInt(port, 10); if (!isNaN(portNumber)) { - attributes[NET_PEER_PORT] = portNumber; + attributes[SERVER_PORT] = portNumber; } } diff --git a/packages/server-utils/src/mongoose/mongoose-legacy-span.ts b/packages/server-utils/src/mongoose/mongoose-legacy-span.ts index 9254d6d704fb..03b1e5eed30b 100644 --- a/packages/server-utils/src/mongoose/mongoose-legacy-span.ts +++ b/packages/server-utils/src/mongoose/mongoose-legacy-span.ts @@ -1,4 +1,4 @@ -import { SENTRY_KIND } from '@sentry/conventions/attributes'; +import { SERVER_ADDRESS, SERVER_PORT, SENTRY_KIND } from '@sentry/conventions/attributes'; import type { Span, SpanAttributes } from '@sentry/core'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; @@ -8,8 +8,6 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/cor const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; const ATTR_DB_NAME = 'db.name'; const ATTR_DB_USER = 'db.user'; -const ATTR_NET_PEER_NAME = 'net.peer.name'; -const ATTR_NET_PEER_PORT = 'net.peer.port'; const ATTR_DB_OPERATION = 'db.operation'; const ATTR_DB_SYSTEM = 'db.system'; @@ -47,8 +45,8 @@ export function startMongooseLegacySpan({ [ATTR_DB_MONGODB_COLLECTION]: collection?.name, [ATTR_DB_NAME]: collection?.conn?.name, [ATTR_DB_USER]: collection?.conn?.user, - [ATTR_NET_PEER_NAME]: collection?.conn?.host, - [ATTR_NET_PEER_PORT]: collection?.conn?.port, + [SERVER_ADDRESS]: collection?.conn?.host, + [SERVER_PORT]: collection?.conn?.port, [ATTR_DB_OPERATION]: operation, [ATTR_DB_SYSTEM]: 'mongoose', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, diff --git a/packages/server-utils/test/integrations/tracing-channel/ioredis.test.ts b/packages/server-utils/test/integrations/tracing-channel/ioredis.test.ts index c7d6008b3de5..bbc63ed0e125 100644 --- a/packages/server-utils/test/integrations/tracing-channel/ioredis.test.ts +++ b/packages/server-utils/test/integrations/tracing-channel/ioredis.test.ts @@ -30,8 +30,8 @@ describe('startIORedisCommandSpan', () => { attributes: expect.objectContaining({ 'db.system': 'redis', 'db.connection_string': 'redis://localhost:6379', - 'net.peer.name': 'localhost', - 'net.peer.port': 6379, + 'server.address': 'localhost', + 'server.port': 6379, 'db.statement': 'set test-key [1 other arguments]', 'sentry.origin': 'auto.db.redis', }), diff --git a/packages/server-utils/test/orchestrion/postgres.test.ts b/packages/server-utils/test/orchestrion/postgres.test.ts index 785d151da74b..c819ca9efcd4 100644 --- a/packages/server-utils/test/orchestrion/postgres.test.ts +++ b/packages/server-utils/test/orchestrion/postgres.test.ts @@ -125,8 +125,8 @@ describe('postgresIntegration', () => { 'db.system': 'postgresql', 'db.name': 'tests', 'db.user': 'tim', - 'net.peer.name': 'localhost', - 'net.peer.port': 5432, + 'server.address': 'localhost', + 'server.port': 5432, 'db.connection_string': 'postgresql://localhost:5432/tests', 'db.statement': 'SELECT * FROM "User"', 'sentry.origin': 'auto.db.postgres', @@ -212,8 +212,8 @@ describe('postgresIntegration', () => { 'db.system': 'postgresql', 'db.name': 'tests', 'db.user': 'user', - 'net.peer.name': 'localhost', - 'net.peer.port': 5494, + 'server.address': 'localhost', + 'server.port': 5494, // Credentials masked out of the connection string. 'db.connection_string': 'postgresql://localhost:5494/tests', 'db.postgresql.idle.timeout.millis': 10_000, @@ -242,8 +242,8 @@ describe('postgresIntegration', () => { expect(startInactiveSpanSpy).toHaveBeenCalledWith( expect.objectContaining({ attributes: expect.objectContaining({ - 'net.peer.name': 'localhost', - 'net.peer.port': 5433, + 'server.address': 'localhost', + 'server.port': 5433, }), }), ); From 3f7115a48ddc9c8b7c395744150284215f79d340 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:45:13 +0200 Subject: [PATCH 2/8] fix test assertions --- .../suites/orchestrion-mongo/test.ts | 2 +- .../suites/orchestrion-mongoose/test.ts | 2 +- .../suites/orchestrion-mysql/test.ts | 2 +- .../suites/orchestrion-mysql2/test.ts | 2 +- .../suites/orchestrion-postgres/test.ts | 2 +- .../suites/orchestrion-tedious/test.ts | 2 +- .../astro-6-cf-workers/tests/db.test.ts | 2 +- .../astro-7-orchestrion/tests/db.test.ts | 4 +-- .../bun-mysql/tests/mysql.test.ts | 2 +- .../tests/mysql.test.ts | 2 +- .../create-remix-app-v2/tests/db.test.ts | 4 +-- .../deno-mysql/tests/mysql.test.ts | 2 +- .../deno-pg/tests/pg.test.ts | 2 +- .../nextjs-16-orchestrion/tests/knex.test.ts | 2 +- .../nextjs-16-orchestrion/tests/mysql.test.ts | 4 +-- .../tests/mysql2.test.ts | 2 +- .../nextjs-16-orchestrion/tests/pg.test.ts | 4 +-- .../nuxt-4-cloudflare/tests/db.test.ts | 2 +- .../nuxt-4/tests/db-drivers.test.ts | 4 +-- .../tests/performance/db.server.test.ts | 4 +-- .../tests/db.test.ts | 2 +- .../solidstart/tests/db.test.ts | 4 +-- .../sveltekit-2-orchestrion/tests/db.test.ts | 4 +-- .../tests/db.test.ts | 2 +- .../tests/db-drivers.test.ts | 4 +-- .../suites/tracing/knex/mysql2/test.ts | 4 +-- .../suites/tracing/knex/pg/test.ts | 4 +-- .../suites/tracing/mongodb/test.ts | 10 +++--- .../suites/tracing/mysql/test.ts | 4 +-- .../suites/tracing/mysql2/test.ts | 4 +-- .../suites/tracing/postgres-streamed/test.ts | 2 +- .../suites/tracing/redis-cache/test.ts | 32 +++++++++---------- .../suites/tracing/redis/test.ts | 6 ++-- .../suites/tracing/tedious/test.ts | 2 +- .../src/integrations/tracing/redis/cache.ts | 13 -------- 35 files changed, 68 insertions(+), 81 deletions(-) diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts index a07c5ab8171b..3c9af8cba908 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mongo/test.ts @@ -61,6 +61,6 @@ Deno.test('mongodb instrumentation: orchestrion:mongodb:command channel produces assertEquals(mongoSpan!.data?.['db.mongodb.collection'], 'users'); assertEquals(mongoSpan!.data?.['db.operation'], 'find'); assertEquals(mongoSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(mongoSpan!.data?.['network.peer.port'], 27017); + assertEquals(mongoSpan!.data?.['server.port'], 27017); assertEquals(mongoSpan!.data?.['sentry.origin'], 'auto.db.mongo'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts index cb50dc894fdf..b7671fc8be8b 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mongoose/test.ts @@ -62,6 +62,6 @@ Deno.test('mongoose instrumentation: orchestrion:mongoose:model_save channel pro assertEquals(mongooseSpan!.data?.['db.operation'], 'save'); assertEquals(mongooseSpan!.data?.['db.user'], 'root'); assertEquals(mongooseSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(mongooseSpan!.data?.['network.peer.port'], 27017); + assertEquals(mongooseSpan!.data?.['server.port'], 27017); assertEquals(mongooseSpan!.data?.['sentry.origin'], 'auto.db.mongoose'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts index 5721fe4598e1..01fb45202b64 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mysql/test.ts @@ -93,7 +93,7 @@ Deno.test('mysql instrumentation: orchestrion:mysql:query channel produces a nes assertEquals(mysqlSpan!.data?.['db.system'], 'mysql'); assertEquals(mysqlSpan!.data?.['db.statement'], 'SELECT 1 AS solution'); assertEquals(mysqlSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(mysqlSpan!.data?.['network.peer.port'], 3306); + assertEquals(mysqlSpan!.data?.['server.port'], 3306); assertEquals(mysqlSpan!.data?.['db.user'], 'root'); assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts index 6e006a018acb..d0ef2c0db4e2 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-mysql2/test.ts @@ -56,6 +56,6 @@ Deno.test('mysql2 instrumentation: orchestrion:mysql2:query channel produces a n assertEquals(mysqlSpan!.data?.['db.name'], 'mydb'); assertEquals(mysqlSpan!.data?.['db.user'], 'root'); assertEquals(mysqlSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(mysqlSpan!.data?.['network.peer.port'], 3306); + assertEquals(mysqlSpan!.data?.['server.port'], 3306); assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql2'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts index 1bb99d528321..38595f4636af 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-postgres/test.ts @@ -93,7 +93,7 @@ Deno.test('pg instrumentation: orchestrion:pg:query channel produces a nested db assertEquals(pgSpan!.data?.['db.system'], 'postgresql'); assertEquals(pgSpan!.data?.['db.statement'], 'SELECT 1 AS solution'); assertEquals(pgSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(pgSpan!.data?.['network.peer.port'], 5432); + assertEquals(pgSpan!.data?.['server.port'], 5432); assertEquals(pgSpan!.data?.['db.user'], 'root'); assertEquals(pgSpan!.data?.['sentry.origin'], 'auto.db.postgres'); }); diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts index 45fcce814cb9..eb247c580298 100644 --- a/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts +++ b/dev-packages/deno-integration-tests/suites/orchestrion-tedious/test.ts @@ -59,6 +59,6 @@ Deno.test('tedious instrumentation: orchestrion:tedious:execSql channel produces assertEquals(tediousSpan!.data?.['db.user'], 'sa'); assertEquals(tediousSpan!.data?.['db.statement'], 'SELECT 1'); assertEquals(tediousSpan!.data?.['server.address'], '127.0.0.1'); - assertEquals(tediousSpan!.data?.['network.peer.port'], 1433); + assertEquals(tediousSpan!.data?.['server.port'], 1433); assertEquals(tediousSpan!.data?.['sentry.origin'], 'auto.db.tedious'); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts index 1b531ed75f6b..1b60ee764f2f 100644 --- a/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/db.test.ts @@ -21,7 +21,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts index f758ccd2a1e9..45142e9ca85c 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7-orchestrion/tests/db.test.ts @@ -64,7 +64,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -80,7 +80,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts index 793c06e943e4..a53e88620cdc 100644 --- a/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/bun-mysql/tests/mysql.test.ts @@ -26,7 +26,7 @@ test('mysql queries emit a db span with orchestrion-channel attributes', async ( expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts index f7d2ffb4e7e7..c9946c0c5cfd 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-orchestrion-mysql/tests/mysql.test.ts @@ -28,7 +28,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts index a107f0d38845..ab35a4a12ea5 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts @@ -70,7 +70,7 @@ test.describe('orchestrion DB instrumentation', () => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -86,7 +86,7 @@ test.describe('orchestrion DB instrumentation', () => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts index 28496e7e3407..b591b1366fd8 100644 --- a/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno-mysql/tests/mysql.test.ts @@ -25,7 +25,7 @@ test('mysql queries emit a db span with orchestrion-channel attributes', async ( expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.mysql'); expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts b/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts index 48effaa0f94a..f5f84828a469 100644 --- a/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno-pg/tests/pg.test.ts @@ -25,7 +25,7 @@ test('pg queries emit a db span with orchestrion-channel attributes', async ({ b expect(firstQuery!.data?.['sentry.origin']).toBe('auto.db.postgres'); expect(firstQuery!.data?.['db.system']).toBe('postgresql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['network.peer.port']).toBe(5432); + expect(firstQuery!.data?.['server.port']).toBe(5432); expect(firstQuery!.data?.['db.user']).toBe('postgres'); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts index ca9c93e5e423..7939ffc3316c 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/knex.test.ts @@ -24,7 +24,7 @@ test('Instruments knex automatically via orchestrion', async ({ baseURL }) => { 'sentry.origin': 'auto.db.knex', 'sentry.op': 'db', 'server.address': 'localhost', - 'network.peer.port': 5432, + 'server.port': 5432, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts index 591717453a79..82a3261b376c 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql.test.ts @@ -31,7 +31,7 @@ test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -47,7 +47,7 @@ test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts index 356ef80d55f0..ff8d4657686b 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/mysql2.test.ts @@ -25,7 +25,7 @@ test('Instruments mysql2 automatically via orchestrion', async ({ baseURL }) => 'db.statement': 'SELECT 1 + 1 AS solution', 'db.user': 'root', 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts index 4c53cce3b4e9..ca5f615e8698 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-orchestrion/tests/pg.test.ts @@ -25,7 +25,7 @@ test('Instruments pg automatically via orchestrion', async ({ baseURL }) => { 'db.name': 'postgres', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 5432, + 'server.port': 5432, }), }), ); @@ -42,7 +42,7 @@ test('Instruments pg automatically via orchestrion', async ({ baseURL }) => { 'db.name': 'postgres', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 5432, + 'server.port': 5432, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts index ec7c7cdea632..cb782c6609b7 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts @@ -21,7 +21,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts index 11b033e63af9..d1df7136e026 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts @@ -76,7 +76,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -92,7 +92,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts b/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts index c6d37d21951b..bd2b857c937c 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/db.server.test.ts @@ -90,7 +90,7 @@ test.describe('server - orchestrion build-time db instrumentation', () => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -106,7 +106,7 @@ test.describe('server - orchestrion build-time db instrumentation', () => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts index 55b5f14f9c36..d3dacfab3c14 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-8-cloudflare/tests/db.test.ts @@ -21,7 +21,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts index 8dd43bad15d0..6175c248756a 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/tests/db.test.ts @@ -63,7 +63,7 @@ test('Instruments mysql automatically via build-time orchestrion', async ({ base 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -79,7 +79,7 @@ test('Instruments mysql automatically via build-time orchestrion', async ({ base 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts index 459922276f69..7f9368fee00d 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2-orchestrion/tests/db.test.ts @@ -64,7 +64,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -80,7 +80,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts index a3a94e3b3280..2c335e3177b1 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/tests/db.test.ts @@ -26,7 +26,7 @@ test('a real mysql query emits a db span with orchestrion-channel attributes', a expect(firstQuery!.data?.['db.system']).toBe('mysql'); expect(firstQuery!.data?.['db.statement']).toBe('SELECT 1 + 1 AS solution'); expect(firstQuery!.data?.['server.address']).toBe('127.0.0.1'); - expect(firstQuery!.data?.['network.peer.port']).toBe(3306); + expect(firstQuery!.data?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts index 4869a37d64bd..75794562136d 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts @@ -73,7 +73,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); @@ -89,7 +89,7 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.user': 'root', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': 3306, + 'server.port': 3306, }), }), ); diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts index 52fd2722624d..7d11f071b6ac 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts @@ -22,7 +22,7 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di 'sentry.origin': ORIGIN, 'sentry.op': 'db', 'server.address': 'localhost', - 'network.peer.port': 3307, + 'server.port': 3307, }), status: 'ok', description: @@ -38,7 +38,7 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di 'sentry.origin': ORIGIN, 'sentry.op': 'db', 'server.address': 'localhost', - 'network.peer.port': 3307, + 'server.port': 3307, }), status: 'ok', description: 'insert into `User` (`email`, `name`) values (?, ?)', diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts index aaee0b3bb328..21bbd3cf88ce 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts @@ -21,7 +21,7 @@ describe('knex auto instrumentation', () => { 'sentry.origin': ORIGIN, 'sentry.op': 'db', 'server.address': 'localhost', - 'network.peer.port': 5445, + 'server.port': 5445, }), status: 'ok', description: @@ -36,7 +36,7 @@ describe('knex auto instrumentation', () => { 'sentry.origin': ORIGIN, 'sentry.op': 'db', 'server.address': 'localhost', - 'network.peer.port': 5445, + 'server.port': 5445, }), status: 'ok', // In the knex-otel spans, the placeholders (e.g., `$1`) are replaced by a `?`. diff --git a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts index 95270f32d219..8fe15ced7340 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mongodb/test.ts @@ -31,7 +31,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.operation': 'find', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': expect.any(Number), + 'server.port': expect.any(Number), 'db.statement': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -50,7 +50,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.operation': 'insert', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': expect.any(Number), + 'server.port': expect.any(Number), 'db.statement': '{"title":"?","_id":{"_bsontype":"?","id":"?"}}', 'sentry.kind': 'client', }, @@ -69,7 +69,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.operation': 'isMaster', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': expect.any(Number), + 'server.port': expect.any(Number), 'db.statement': '{"ismaster":"?","client":{"driver":{"name":"?","version":"?"},"os":{"type":"?","name":"?","architecture":"?","version":"?"},"platform":"?"},"compression":[],"helloOk":"?"}', 'sentry.kind': 'client', @@ -90,7 +90,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.operation': 'update', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': expect.any(Number), + 'server.port': expect.any(Number), 'db.statement': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -124,7 +124,7 @@ describe('MongoDB auto-instrumentation', () => { 'db.mongodb.collection': '$cmd', 'db.connection_string': expect.any(String), 'server.address': expect.any(String), - 'network.peer.port': expect.any(Number), + 'server.port': expect.any(Number), 'db.statement': '{"endSessions":[{"id":{"_bsontype":"?","sub_type":"?","position":"?","buffer":"?"}}]}', 'sentry.kind': 'client', }, diff --git a/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts b/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts index 34f4d27cb71c..c76954340978 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mysql/test.ts @@ -47,7 +47,7 @@ describe('mysql auto instrumentation', () => { ...(origin ? { 'sentry.origin': origin } : {}), 'db.system': 'mysql', 'server.address': 'localhost', - 'network.peer.port': port, + 'server.port': port, 'db.user': 'root', }), status: 'ok', @@ -200,7 +200,7 @@ describe('mysql auto instrumentation', () => { type: 'string', value: 'localhost', }, - 'network.peer.port': { + 'server.port': { type: 'integer', value: expect.any(Number), }, diff --git a/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts index 7f91bb36627a..cc2634ca7adc 100644 --- a/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/mysql2/test.ts @@ -22,7 +22,7 @@ describeWithDockerCompose('mysql2 auto instrumentation', { workingDirectory: [__ 'db.system': 'mysql', 'db.statement': 'SELECT 1 + 1 AS solution', 'server.address': 'localhost', - 'network.peer.port': 3306, + 'server.port': 3306, 'db.user': 'root', }), }), @@ -35,7 +35,7 @@ describeWithDockerCompose('mysql2 auto instrumentation', { workingDirectory: [__ 'db.system': 'mysql', 'db.statement': 'SELECT ? as a, ? as b, NOW() as c', 'server.address': 'localhost', - 'network.peer.port': 3306, + 'server.port': 3306, 'db.user': 'root', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts b/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts index a71b1081dd02..c71f72ac0232 100644 --- a/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts @@ -32,7 +32,7 @@ const COMMON_DB_ATTRIBUTES = { type: 'string', value: 'localhost', }, - 'network.peer.port': { + 'server.port': { type: 'integer', value: expect.any(Number), }, diff --git a/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts b/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts index 17d77234b4b4..ac37582d4534 100644 --- a/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/redis-cache/test.ts @@ -21,7 +21,7 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'sentry.op': 'db', 'db.system': 'redis', 'server.address': 'localhost', - 'network.peer.port': 6383, + 'server.port': 6383, 'db.statement': 'set test-key [1 other arguments]', }), }), @@ -33,7 +33,7 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'sentry.op': 'db', 'db.system': 'redis', 'server.address': 'localhost', - 'network.peer.port': 6383, + 'server.port': 6383, 'db.statement': 'get test-key', }), }), @@ -61,8 +61,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'db.statement': 'set ioredis-cache:test-key [1 other arguments]', 'cache.key': ['ioredis-cache:test-key'], 'cache.item_size': 2, - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // SET (with EX) @@ -75,8 +75,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'db.statement': 'set ioredis-cache:test-key-set-EX [3 other arguments]', 'cache.key': ['ioredis-cache:test-key-set-EX'], 'cache.item_size': 2, - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // SETEX @@ -89,8 +89,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'db.statement': 'setex ioredis-cache:test-key-setex [2 other arguments]', 'cache.key': ['ioredis-cache:test-key-setex'], 'cache.item_size': 2, - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // GET @@ -104,8 +104,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'cache.hit': true, 'cache.key': ['ioredis-cache:test-key'], 'cache.item_size': 10, - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // GET (unavailable - no cache hit) @@ -118,8 +118,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'db.statement': 'get ioredis-cache:unavailable-data', 'cache.hit': false, 'cache.key': ['ioredis-cache:unavailable-data'], - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // MGET @@ -132,8 +132,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'db.statement': 'mget [3 other arguments]', 'cache.hit': true, 'cache.key': ['test-key', 'ioredis-cache:test-key', 'ioredis-cache:unavailable-data'], - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), // DEL @@ -145,8 +145,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory 'sentry.origin': redisOrigin, 'db.statement': 'del ioredis-cache:test-key', 'cache.key': ['ioredis-cache:test-key'], - 'network.peer.address': 'localhost', - 'network.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, }), }), ]), diff --git a/dev-packages/node-integration-tests/suites/tracing/redis/test.ts b/dev-packages/node-integration-tests/suites/tracing/redis/test.ts index 92a30f85add5..ad329374243c 100644 --- a/dev-packages/node-integration-tests/suites/tracing/redis/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/redis/test.ts @@ -24,7 +24,7 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.origin': origin, 'db.system': 'redis', 'server.address': 'localhost', - 'network.peer.port': 6380, + 'server.port': 6380, 'db.statement': 'set test-key [1 other arguments]', }), }), @@ -37,7 +37,7 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.origin': origin, 'db.system': 'redis', 'server.address': 'localhost', - 'network.peer.port': 6380, + 'server.port': 6380, 'db.statement': 'get test-key', }), }), @@ -52,7 +52,7 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.origin': origin, 'db.system': 'redis', 'server.address': 'localhost', - 'network.peer.port': 6380, + 'server.port': 6380, 'db.statement': 'incr test-key', }), }), diff --git a/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts b/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts index 19da4a2c035b..84ac0e224daa 100644 --- a/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/tedious/test.ts @@ -20,7 +20,7 @@ describeWithDockerCompose('tedious auto instrumentation', { workingDirectory: [_ 'db.name': 'master', 'db.user': 'sa', 'server.address': '127.0.0.1', - 'network.peer.port': 1433, + 'server.port': 1433, }), ...overrides, }); diff --git a/packages/node/src/integrations/tracing/redis/cache.ts b/packages/node/src/integrations/tracing/redis/cache.ts index 483549a9eeb4..9221284f9fdc 100644 --- a/packages/node/src/integrations/tracing/redis/cache.ts +++ b/packages/node/src/integrations/tracing/redis/cache.ts @@ -5,7 +5,6 @@ import { SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, - spanToJSON, truncate, } from '@sentry/core'; import type { IORedisCommandArgs } from '../../../utils/redisCache'; @@ -69,18 +68,6 @@ export const cacheResponseHook: IORedisResponseCustomAttributeFunction = ( return; } - // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199 - // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/ - // Fall back to stable semconv attributes (server.address/server.port) when - // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database - // set for node-redis v4/v5. - const spanData = spanToJSON(span).data; - const networkPeerAddress = spanData['server.address']; - const networkPeerPort = spanData['server.port']; - if (networkPeerPort && networkPeerAddress) { - span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort }); - } - // A remove response is a delete-count, not a cached value, so its size is meaningless. const cacheItemSize = isInCommands(REMOVE_COMMANDS, redisCommand) ? undefined : calculateCacheItemSize(response); From 920294d3ac1e9487853b255efefaac412c59ad20 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Aug 2026 10:58:07 +0200 Subject: [PATCH 3/8] fix tests --- .../public-api/startSpan-streamed/test.ts | 6 +++++- .../hono-4/tests/tracing.test.ts | 10 ++++++---- .../nestjs-11/tests/transactions.test.ts | 5 +++++ .../nestjs-8/tests/transactions.test.ts | 5 +++++ .../nestjs-basic/tests/transactions.test.ts | 5 +++++ .../tests/propagation.test.ts | 20 +++++++++++++++++++ .../nestjs-fastify/tests/transactions.test.ts | 5 +++++ .../tests/transactions.test.ts | 5 +++++ .../tests/transactions.test.ts | 5 +++++ .../nextjs-pages-dir/tests/middleware.test.ts | 3 ++- .../tests/transactions.test.ts | 5 +++++ .../tests/transactions.test.ts | 5 +++++ .../tests/transactions.test.ts | 5 +++++ .../node-express/tests/transactions.test.ts | 5 +++++ .../node-fastify-3/tests/propagation.test.ts | 20 +++++++++++++++++++ .../node-fastify-3/tests/transactions.test.ts | 5 +++++ .../node-fastify-4/tests/propagation.test.ts | 20 +++++++++++++++++++ .../node-fastify-4/tests/transactions.test.ts | 5 +++++ .../node-fastify-5/tests/propagation.test.ts | 20 +++++++++++++++++++ .../node-fastify-5/tests/transactions.test.ts | 5 +++++ .../node-hapi/tests/transactions.test.ts | 5 +++++ .../node-koa/tests/propagation.test.ts | 20 +++++++++++++++++++ .../node-koa/tests/transactions.test.ts | 5 +++++ .../tsx-express/tests/transactions.test.ts | 5 +++++ .../suites/tracing/httpIntegration/test.ts | 10 ++++++++++ 25 files changed, 203 insertions(+), 6 deletions(-) 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 b106a4236344..f4c5334f8ab6 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 @@ -276,7 +276,11 @@ it('sends a streamed span envelope with correct spans for a manually started spa }, 'network.protocol.name': { type: 'string', - value: 'HTTP/1.1', + value: 'http', + }, + 'network.protocol.version': { + type: 'string', + value: '1.1', }, }, is_segment: true, diff --git a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts index 04351805667f..b57b4a88449b 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts @@ -89,10 +89,12 @@ test("preserves the baseline client.* and network.* server span attributes that if (RUNTIME === 'node') { expect(data['server.address']).toBe('localhost'); - expect(data['network.transport']).toBe('tcp'); - expect(data['network.local.address']).toEqual(expect.any(String)); - expect(data['network.peer.address']).toEqual(expect.any(String)); - expect(data['network.peer.port']).toEqual(expect.any(Number)); + // `@hono/node-server` converts requests to Fetch before the SDK receives them, + // so its baseline spans do not expose socket metadata. `getConnInfo` adds it above. + expect(data['network.transport']).toBeUndefined(); + expect(data['network.local.address']).toBeUndefined(); + expect(data['network.peer.address']).toBeUndefined(); + expect(data['network.peer.port']).toBeUndefined(); } else if (RUNTIME === 'bun') { // Doesn't expose connection metadata through Bun.serve } else if (RUNTIME === 'cloudflare') { diff --git a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts index f3fcea646f3e..d1e96aa3250e 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-11/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts index 4eab7487ab1a..fe325e4408fb 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts index 523dce299e0a..bce6acc1589a 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts @@ -56,11 +56,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 e18926f6e457..aae5014d3366 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 @@ -71,11 +71,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': expect.any(String), 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -109,11 +114,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -200,11 +210,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': expect.any(String), 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -238,11 +253,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts index 9d6eaa546928..b2e6183942b6 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts @@ -34,11 +34,16 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts index 854e463f9a88..63acafb5f5c7 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.target': '/example-module/transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/example-module/transaction', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts index 2fec9d229065..6027586c497f 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.target': '/example-module/transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/example-module/transaction', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts index c822c7ffaef9..e45fa3547f49 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/middleware.test.ts @@ -74,7 +74,8 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru 'http.response.status_code': 200, type: 'fetch', 'url.full': 'http://localhost:3030/', - 'server.address': 'localhost:3030', + 'server.address': 'localhost', + 'server.port': 3030, 'sentry.op': 'http.client', 'sentry.origin': 'auto.http.wintercg_fetch', }, diff --git a/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts index f07acd0431e0..ca1906477923 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-orchestrion-cjs/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts index 02bc3f0e9588..6e6e47651e93 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-orchestrion/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts index 397b59eff129..092667f79a4b 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-v5/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts index 51ca94a8c389..231e64954da4 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 ee4ebf32680f..34dc29cb8b6d 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 @@ -71,11 +71,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -109,11 +114,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -200,11 +210,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -238,11 +253,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.user_agent': 'node', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts index 4fd1e880b9ea..9fb13b3e6973 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts @@ -35,11 +35,16 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 ef69f704893a..8ee2382eab61 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 @@ -71,11 +71,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -109,11 +114,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -200,11 +210,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -238,11 +253,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts index 72a86064016c..4156910cd152 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 8421d70708e2..fb5dab4a0dcb 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 @@ -71,11 +71,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -109,11 +114,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -200,11 +210,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -238,11 +253,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.user_agent': 'node', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts index 505d0224ab08..37243a793771 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts index 3393ba9f2d22..8eea53d68454 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts @@ -29,11 +29,16 @@ test('Sends successful transaction', async ({ baseURL }) => { 'http.target': '/test-success', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-success', 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 0bacb4645388..fe65fde61d4c 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 @@ -70,11 +70,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-http/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-http/:id', @@ -108,11 +113,16 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', @@ -199,11 +209,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.target': `/test-outgoing-fetch/${id}`, 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-outgoing-fetch/:id', @@ -237,11 +252,16 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.scheme': 'http', 'http.target': `/test-inbound-headers/${id}`, 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-inbound-headers/:id', diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts index dd82d22efe28..c32dd76dbbfe 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', diff --git a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts index ba31c2240283..49f520d27707 100644 --- a/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/tsx-express/tests/transactions.test.ts @@ -30,11 +30,16 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.target': '/test-transaction', 'http.user_agent': 'node', 'http.flavor': '1.1', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.transport': 'tcp', 'network.local.address': expect.any(String), 'network.local.port': expect.any(Number), 'network.peer.address': expect.any(String), 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', + 'server.port': 3030, 'http.status_code': 200, 'http.status_text': 'OK', 'http.route': '/test-transaction', 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 a42f693a8850..de56cf0b4454 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -118,11 +118,16 @@ describe('httpIntegration', () => { 'http.status_text': 'OK', 'http.target': '/test?a=1&b=2', 'http.user_agent': 'node', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.local.address': '::1', 'server.address': 'localhost', + 'server.port': port, 'network.local.port': port, 'network.peer.address': '::1', 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', 'network.transport': 'tcp', 'sentry.kind': 'server', 'sentry.op': 'http.server', @@ -160,11 +165,16 @@ describe('httpIntegration', () => { 'http.status_text': 'OK', 'http.target': '/test?a=1&b=2', 'http.user_agent': 'node', + 'client.address': '::1', + 'client.port': expect.any(Number), 'network.local.address': '::1', 'server.address': 'localhost', + 'server.port': port, 'network.local.port': port, 'network.peer.address': '::1', 'network.peer.port': expect.any(Number), + 'network.protocol.name': 'http', + 'network.protocol.version': '1.1', 'network.transport': 'tcp', 'sentry.kind': 'server', 'sentry.op': 'http.server', From 133f0e8e05733043bbd0c3c9e3e597ba6a7dbdef Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Aug 2026 11:57:01 +0200 Subject: [PATCH 4/8] fix deno http --- packages/deno/src/wrap-deno-request-handler.ts | 8 +++----- packages/deno/test/deno-http.test.ts | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/deno/src/wrap-deno-request-handler.ts b/packages/deno/src/wrap-deno-request-handler.ts index 4d45be9d096a..c3b8bafe3570 100644 --- a/packages/deno/src/wrap-deno-request-handler.ts +++ b/packages/deno/src/wrap-deno-request-handler.ts @@ -80,11 +80,9 @@ export const wrapDenoRequestHandler = ( assignIfSet(attributes, CLIENT_ADDRESS, clientAddress); assignIfSet(attributes, CLIENT_PORT, clientPort); } - assignIfSet( - attributes, - NETWORK_PROTOCOL_NAME, - urlObject && !('isRelative' in urlObject) ? urlObject.protocol.slice(0, -1) : undefined, - ); + + // describes the OSI application-layer protocol (http), not the scheme (might be https) + attributes[NETWORK_PROTOCOL_NAME] = 'http'; Object.assign(attributes, httpHeadersToSpanAttributes(winterCGHeadersToDict(request.headers), dataCollection)); attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] = 'http.server'; diff --git a/packages/deno/test/deno-http.test.ts b/packages/deno/test/deno-http.test.ts index 9b44f6509198..eaf61bc2f5c5 100644 --- a/packages/deno/test/deno-http.test.ts +++ b/packages/deno/test/deno-http.test.ts @@ -107,6 +107,8 @@ Deno.test({ assertEquals(txn.transaction, 'GET /users/42'); assertEquals(txn.contexts?.trace?.data?.['http.method'], 'GET'); assertEquals(txn.contexts?.trace?.data?.['http.response.status_code'], 200); + assertEquals(txn.contexts?.trace?.data?.['network.protocol.name'], 'http'); + assertEquals(txn.contexts?.trace?.data?.['network.protocol.version'], '1.1'); }, }); From 545401f744a721b518385a88e51fafdffcfdc6a2 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Aug 2026 13:34:49 +0200 Subject: [PATCH 5/8] add deno dependency --- packages/deno/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/deno/package.json b/packages/deno/package.json index af49fbb46874..30a68d5e2a68 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -28,6 +28,7 @@ ], "dependencies": { "@opentelemetry/api": "^1.9.1", + "@sentry/conventions": "^0.19.0", "@sentry/core": "10.67.0", "@sentry/server-utils": "10.67.0" }, From 67449567ee79490f71582585cf154a2006910ef6 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:56:27 +0200 Subject: [PATCH 6/8] fix tests again --- .../deno-streamed/tests/spans.test.ts | 4 +++ .../hono-4/tests/constants.ts | 2 +- .../hono-4/tests/tracing.test.ts | 31 ++++++++++++++----- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/deno-streamed/tests/spans.test.ts b/dev-packages/e2e-tests/test-applications/deno-streamed/tests/spans.test.ts index e79589dcac76..cb765ed3f41d 100644 --- a/dev-packages/e2e-tests/test-applications/deno-streamed/tests/spans.test.ts +++ b/dev-packages/e2e-tests/test-applications/deno-streamed/tests/spans.test.ts @@ -67,6 +67,10 @@ const SEGMENT_SPAN = { type: 'integer', value: expect.any(Number), }, + 'network.protocol.name': { + type: 'string', + value: 'http', + }, 'os.name': { type: 'string', value: expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/hono-4/tests/constants.ts b/dev-packages/e2e-tests/test-applications/hono-4/tests/constants.ts index bb58543dc06f..0bd38ea85aa3 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/tests/constants.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/tests/constants.ts @@ -1,5 +1,5 @@ export type Runtime = 'cloudflare' | 'node' | 'bun' | 'deno'; -export const RUNTIME = (process.env.RUNTIME || 'deno') as Runtime; +export const RUNTIME = (process.env.RUNTIME || 'node') as Runtime; export const APP_NAME = 'hono-4'; diff --git a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts index b57b4a88449b..2e2d8aa02c85 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/tests/tracing.test.ts @@ -74,7 +74,7 @@ test('attaches HTTP connection info to the server transaction', async ({ baseURL // Regression guard against connection info attributes. // The conninfo middleware must only *add* attributes, never replace or clear existing ones. // These are the baseline attributes the server transaction carries *without* the conninfo feature -test("preserves the baseline client.* and network.* server span attributes that the SDK sends without Hono's conninfo", async ({ +test("preserves the baseline server.*, client.* and network.* server span attributes that the SDK sends without Hono's conninfo", async ({ baseURL, }) => { const transactionPromise = waitForTransaction(APP_NAME, event => { @@ -89,20 +89,37 @@ test("preserves the baseline client.* and network.* server span attributes that if (RUNTIME === 'node') { expect(data['server.address']).toBe('localhost'); - // `@hono/node-server` converts requests to Fetch before the SDK receives them, - // so its baseline spans do not expose socket metadata. `getConnInfo` adds it above. + expect(data['server.port']).toBe(Number(new URL(baseURL!).port)); + expect(data['client.address']).toEqual(expect.any(String)); + expect(data['client.port']).toEqual(expect.any(Number)); + expect(data['network.type']).toMatch(/^ipv[46]$/); + expect(data['network.protocol.name']).toBe('http'); + expect(data['network.protocol.version']).toBe('1.1'); expect(data['network.transport']).toBeUndefined(); - expect(data['network.local.address']).toBeUndefined(); - expect(data['network.peer.address']).toBeUndefined(); - expect(data['network.peer.port']).toBeUndefined(); + expect(data['network.local.port']).toBe(data['server.port']); + expect(data['network.local.address']).toEqual(expect.any(String)); + expect(data['network.peer.address']).toBe(data['client.address']); + expect(data['network.peer.port']).toBe(data['client.port']); } else if (RUNTIME === 'bun') { - // Doesn't expose connection metadata through Bun.serve + expect(data['client.address']).toEqual(expect.any(String)); + expect(data['client.port']).toEqual(expect.any(Number)); + expect(data['network.peer.address']).toBe(data['client.address']); + expect(data['network.peer.port']).toBe(data['client.port']); + expect(data['network.type']).toMatch(/^ipv[46]$/); } else if (RUNTIME === 'cloudflare') { + expect(data['server.address']).toBe('localhost'); + expect(data['client.address']).toBe('::1'); + expect(data['network.peer.address']).toBe(data['client.address']); expect(data['network.protocol.name']).toBe('http'); expect(data['network.protocol.version']).toBe('1.1'); } else if (RUNTIME === 'deno') { + expect(data['server.address']).toBe('localhost'); expect(data['client.address']).toEqual(expect.any(String)); expect(data['client.port']).toEqual(expect.any(Number)); + expect(data['network.peer.address']).toBe(data['client.address']); + expect(data['network.peer.port']).toBe(data['client.port']); + expect(data['network.transport']).toBe('tcp'); + expect(data['network.protocol.name']).toBe('http'); } else { throw new Error(`No tests for runtime: ${RUNTIME}`); } From e233d617777c56b984cc2a369195ee580014327f Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:57:04 +0200 Subject: [PATCH 7/8] review suggestions --- packages/core/src/integrations/http/get-outgoing-span-data.ts | 2 +- packages/deno/src/wrap-deno-request-handler.ts | 4 ++-- packages/server-utils/src/integrations/mysql.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/integrations/http/get-outgoing-span-data.ts b/packages/core/src/integrations/http/get-outgoing-span-data.ts index ff400f1b138e..7ca1a4f64f17 100644 --- a/packages/core/src/integrations/http/get-outgoing-span-data.ts +++ b/packages/core/src/integrations/http/get-outgoing-span-data.ts @@ -50,7 +50,7 @@ export function getOutgoingRequestSpanData(request: HttpClientRequest): StartSpa [HTTP_METHOD]: request.method, [HTTP_TARGET]: filterCollectedUrl(request.path || '/'), [SERVER_ADDRESS]: request.host, - [SERVER_PORT]: typeof request.port === 'number' ? request.port : undefined, + [SERVER_PORT]: typeof request.port === 'number' && !isNaN(request.port) ? request.port : undefined, [HTTP_HOST]: request.getHeader('host') as string | undefined, /* eslint-enable typescript/no-deprecated */ [USER_AGENT_ORIGINAL]: userAgent || undefined, diff --git a/packages/deno/src/wrap-deno-request-handler.ts b/packages/deno/src/wrap-deno-request-handler.ts index c3b8bafe3570..c6a59e9f089d 100644 --- a/packages/deno/src/wrap-deno-request-handler.ts +++ b/packages/deno/src/wrap-deno-request-handler.ts @@ -74,9 +74,9 @@ export const wrapDenoRequestHandler = ( assignIfSet(attributes, 'user_agent.original', request.headers.get('user-agent')); const dataCollection = client.getDataCollectionOptions(); - const clientAddress = (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path; - const clientPort = (info?.remoteAddr as Deno.NetAddr)?.port; if (dataCollection.userInfo) { + const clientAddress = (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path; + const clientPort = (info?.remoteAddr as Deno.NetAddr)?.port; assignIfSet(attributes, CLIENT_ADDRESS, clientAddress); assignIfSet(attributes, CLIENT_PORT, clientPort); } diff --git a/packages/server-utils/src/integrations/mysql.ts b/packages/server-utils/src/integrations/mysql.ts index fc2d4ff69dd1..69ced51b5dac 100644 --- a/packages/server-utils/src/integrations/mysql.ts +++ b/packages/server-utils/src/integrations/mysql.ts @@ -91,8 +91,8 @@ function instrumentMysql(): void { ...(database ? { [DB_NAMESPACE]: database } : {}), ...(user ? { [DB_USER]: user } : {}), ...(sql ? { [DB_QUERY_TEXT]: sql } : {}), - ...(host ? { [SERVER_ADDRESS]: host } : {}), - ...(portIsNumber ? { [SERVER_PORT]: portNumber } : {}), + [SERVER_ADDRESS]: host, + [SERVER_PORT]: portIsNumber ? portNumber : undefined, }, }); }, From 6842701932b0bb129dcc64c59cbfb4afd95b5a34 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:03:44 +0200 Subject: [PATCH 8/8] forwarding header wins over the socket value --- .../integrations/http/server-subscription.ts | 15 ++++- .../http/server-subscription.test.ts | 62 ++++++++++++++++++- .../deno/src/wrap-deno-request-handler.ts | 7 ++- .../http/httpServerSpansIntegration.ts | 18 +++++- 4 files changed, 94 insertions(+), 8 deletions(-) diff --git a/packages/core/src/integrations/http/server-subscription.ts b/packages/core/src/integrations/http/server-subscription.ts index 9c898ed4fc91..b4d3839c877d 100644 --- a/packages/core/src/integrations/http/server-subscription.ts +++ b/packages/core/src/integrations/http/server-subscription.ts @@ -298,6 +298,9 @@ function buildServerSpanWrap( const { socket } = request; const { localAddress, localPort, remoteAddress, remotePort } = socket ?? {}; const collectClientAddress = client.getDataCollectionOptions().userInfo; + // `client.address` is the originating client, so a forwarding header wins over the socket, which + // behind a proxy holds the proxy's address. `network.peer.address` keeps the socket value. + const clientAddress = getForwardedClientAddress(ips) ?? remoteAddress; return startSpanManual( { @@ -313,7 +316,7 @@ function buildServerSpanWrap( [SERVER_PORT]: localPort, [NETWORK_LOCAL_ADDRESS]: localAddress, [NETWORK_LOCAL_PORT]: localPort, - [CLIENT_ADDRESS]: collectClientAddress ? remoteAddress : undefined, + [CLIENT_ADDRESS]: collectClientAddress ? clientAddress : undefined, [CLIENT_PORT]: remotePort, [NETWORK_PEER_ADDRESS]: collectClientAddress ? remoteAddress : undefined, [NETWORK_PEER_PORT]: remotePort, @@ -329,7 +332,7 @@ function buildServerSpanWrap( 'http.host': host, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, - 'http.client_ip': typeof ips === 'string' ? ips.split(',')[0] : undefined, + 'http.client_ip': collectClientAddress ? getForwardedClientAddress(ips) : undefined, 'http.user_agent': userAgent, 'http.scheme': scheme, 'http.flavor': httpVersion, @@ -380,6 +383,14 @@ function buildServerSpanWrap( }; } +/** + * First entry of `X-Forwarded-For`: the client as seen by the outermost proxy. + * https://opentelemetry.io/docs/specs/semconv/registry/attributes/client/#client-address + */ +function getForwardedClientAddress(forwardedFor: string | string[] | undefined): string | undefined { + return typeof forwardedFor === 'string' ? forwardedFor.split(',')[0]?.trim() || undefined : undefined; +} + function shouldIgnoreSpansForIncomingRequest( request: HttpIncomingMessage, { diff --git a/packages/core/test/lib/integrations/http/server-subscription.test.ts b/packages/core/test/lib/integrations/http/server-subscription.test.ts index 19179b12a8e1..f957422885b0 100644 --- a/packages/core/test/lib/integrations/http/server-subscription.test.ts +++ b/packages/core/test/lib/integrations/http/server-subscription.test.ts @@ -55,7 +55,11 @@ describe('getHttpServerSubscriptions', () => { await new Promise(resolve => server.close(() => resolve())); }); - async function makeRequest(path: string, method: 'GET' | 'HEAD' | 'OPTIONS' = 'GET'): Promise { + async function makeRequest( + path: string, + method: 'GET' | 'HEAD' | 'OPTIONS' = 'GET', + extraHeaders: Record = {}, + ): Promise { const { port } = server.address() as AddressInfo; return new Promise((resolve, reject) => { // Connection: close so the server-side `response.once('close', ...)` @@ -67,7 +71,7 @@ describe('getHttpServerSubscriptions', () => { port, path, method, - headers: { Connection: 'close' }, + headers: { Connection: 'close', ...extraHeaders }, }, res => { // throw away response body @@ -139,6 +143,60 @@ describe('getHttpServerSubscriptions', () => { ); }); + it('prefers the forwarded client over the socket for `client.address`', async () => { + server = http.createServer((_req, res) => res.end('ok')); + await new Promise(resolve => server.listen(0, '127.0.0.1', () => resolve())); + instrument(true); + + await makeRequest('/users/42', 'GET', { 'X-Forwarded-For': '203.0.113.7, 198.51.100.1' }); + const transaction = await waitForTransaction(); + + expect(transaction.contexts?.trace?.data).toEqual( + expect.objectContaining({ + // the originating client, as reported by the outermost proxy + [CLIENT_ADDRESS]: '203.0.113.7', + // the immediate peer stays the socket, i.e. the proxy itself + [NETWORK_PEER_ADDRESS]: '127.0.0.1', + }), + ); + }); + + it('does not report a forwarded client address when userInfo collection is disabled', async () => { + client = new TestClient(getDefaultTestClientOptions({ tracesSampleRate: 1, dataCollection: { userInfo: false } })); + const originalSendEvent = client.sendEvent.bind(client); + client.sendEvent = (event, hint) => { + events.push(event); + return originalSendEvent(event, hint); + }; + setCurrentClient(client); + client.init(); + getIsolationScope().setClient(client); + + server = http.createServer((_req, res) => res.end('ok')); + await new Promise(resolve => server.listen(0, '127.0.0.1', () => resolve())); + instrument(true); + + await makeRequest('/users/42', 'GET', { 'X-Forwarded-For': '203.0.113.7' }); + const transaction = await waitForTransaction(); + + const data = transaction.contexts?.trace?.data; + expect(data).not.toHaveProperty(CLIENT_ADDRESS); + expect(data).not.toHaveProperty(NETWORK_PEER_ADDRESS); + // the deprecated alias of `client.address` carries the same IP, so it has to be gated too + expect(data).not.toHaveProperty('http.client_ip'); + }); + + it('reports the forwarded client address on the deprecated `http.client_ip` alias too', async () => { + server = http.createServer((_req, res) => res.end('ok')); + await new Promise(resolve => server.listen(0, '127.0.0.1', () => resolve())); + instrument(true); + + await makeRequest('/users/42', 'GET', { 'X-Forwarded-For': '203.0.113.7, 198.51.100.1' }); + const transaction = await waitForTransaction(); + + expect(transaction.contexts?.trace?.data).toEqual(expect.objectContaining({ 'http.client_ip': '203.0.113.7' })); + }); + // `http.target` is the deprecated alias of `url.full` and carries the same query string, so it has to // respect `dataCollection.urlQueryParams` too. it('filters sensitive query params in `http.target` and `url.full`', async () => { diff --git a/packages/deno/src/wrap-deno-request-handler.ts b/packages/deno/src/wrap-deno-request-handler.ts index c6a59e9f089d..004a5f9fa26d 100644 --- a/packages/deno/src/wrap-deno-request-handler.ts +++ b/packages/deno/src/wrap-deno-request-handler.ts @@ -75,9 +75,12 @@ export const wrapDenoRequestHandler = ( const dataCollection = client.getDataCollectionOptions(); if (dataCollection.userInfo) { - const clientAddress = (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path; + // `client.address` is the originating client, so a forwarding header wins over the socket, which + // behind a proxy holds the proxy's address. + const forwardedFor = request.headers.get('x-forwarded-for')?.split(',')[0]?.trim(); + const socketAddress = (info?.remoteAddr as Deno.NetAddr)?.hostname ?? (info?.remoteAddr as Deno.UnixAddr)?.path; const clientPort = (info?.remoteAddr as Deno.NetAddr)?.port; - assignIfSet(attributes, CLIENT_ADDRESS, clientAddress); + assignIfSet(attributes, CLIENT_ADDRESS, forwardedFor || socketAddress); assignIfSet(attributes, CLIENT_PORT, clientPort); } diff --git a/packages/node/src/integrations/http/httpServerSpansIntegration.ts b/packages/node/src/integrations/http/httpServerSpansIntegration.ts index c3acd96d1cc6..1234321e7433 100644 --- a/packages/node/src/integrations/http/httpServerSpansIntegration.ts +++ b/packages/node/src/integrations/http/httpServerSpansIntegration.ts @@ -183,7 +183,7 @@ const _httpServerSpansIntegration = ((options: HttpServerSpansIntegrationOptions [SERVER_ADDRESS]: hostname, [NETWORK_PROTOCOL_NAME]: 'http', [NETWORK_PROTOCOL_VERSION]: httpVersion, - [HTTP_CLIENT_IP]: typeof ips === 'string' ? ips.split(',')[0] : undefined, + [HTTP_CLIENT_IP]: client.getDataCollectionOptions().userInfo ? getForwardedClientAddress(ips) : undefined, [HTTP_USER_AGENT]: userAgent, [HTTP_SCHEME]: scheme, [HTTP_FLAVOR]: httpVersion, @@ -387,6 +387,14 @@ function isCompressed(headers: IncomingHttpHeaders): boolean { return !!encoding && encoding !== 'identity'; } +/** + * First entry of `X-Forwarded-For`: the client as seen by the outermost proxy. + * https://opentelemetry.io/docs/specs/semconv/registry/attributes/client/#client-address + */ +function getForwardedClientAddress(forwardedFor: string | string[] | undefined): string | undefined { + return typeof forwardedFor === 'string' ? forwardedFor.split(',')[0]?.trim() || undefined : undefined; +} + function getIncomingRequestAttributesOnResponse( request: HttpIncomingMessage, response: HttpServerResponse, @@ -404,12 +412,18 @@ function getIncomingRequestAttributesOnResponse( 'http.status_text': statusMessage?.toUpperCase(), }; + if (collectClientAddress) { + // `client.address` is the originating client, so a forwarding header wins over the socket, which + // behind a proxy holds the proxy's address. `network.peer.address` below keeps the socket value. + newAttributes[CLIENT_ADDRESS] = + getForwardedClientAddress(request.headers['x-forwarded-for']) ?? socket?.remoteAddress; + } + if (socket) { const { localAddress, localPort, remoteAddress, remotePort } = socket; newAttributes[SERVER_PORT] = localPort; newAttributes[NETWORK_LOCAL_ADDRESS] = localAddress; newAttributes[NETWORK_LOCAL_PORT] = localPort; - newAttributes[CLIENT_ADDRESS] = collectClientAddress ? remoteAddress : undefined; newAttributes[CLIENT_PORT] = remotePort; newAttributes[NETWORK_PEER_ADDRESS] = collectClientAddress ? remoteAddress : undefined; newAttributes[NETWORK_PEER_PORT] = remotePort;