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 59b2efe76790..c289a1120eef 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.namespace'], 'mydb'); assertEquals(mongoSpan!.data?.['db.collection.name'], 'users'); assertEquals(mongoSpan!.data?.['db.operation.name'], '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?.['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 f40f441edabb..3e8488a569fe 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.collection.name'], 'blogposts'); assertEquals(mongooseSpan!.data?.['db.operation.name'], '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?.['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 1f6bde13ebe9..c21638cf667a 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.name'], 'mysql'); assertEquals(mysqlSpan!.data?.['db.query.text'], '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?.['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 8ad6e7be4421..afafeb6ea7f8 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.query.text'], 'SELECT 1 AS solution'); assertEquals(mysqlSpan!.data?.['db.namespace'], '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?.['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 81c0927499f5..2e7ca65e4d69 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.name'], 'postgresql'); assertEquals(pgSpan!.data?.['db.query.text'], '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?.['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 9bd4134baf89..9cb6c45468bc 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.namespace'], 'mydb'); assertEquals(tediousSpan!.data?.['db.user'], 'sa'); assertEquals(tediousSpan!.data?.['db.query.text'], '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?.['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 50fbc40bb3cd..751985066afd 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).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?.['server.port']).toBe(3306); expect(firstQuery!.data?.['db.user']).toBe('root'); }); diff --git a/dev-packages/e2e-tests/test-applications/astro-7/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/astro-7/tests/db.test.ts index a30e0a9948a2..0d574839e992 100644 --- a/dev-packages/e2e-tests/test-applications/astro-7/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-7/tests/db.test.ts @@ -63,8 +63,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + 'server.port': 3306, }), }), ); @@ -79,8 +79,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + '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 3a4c231c8c2d..1a70ac0cd0cf 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.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 b6335b08ba5c..60c2a1b44704 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).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?.['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 d9c2e8b1dca0..a5959a69b4ca 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.query.text': '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), + 'server.port': 3306, }), }), ); @@ -85,8 +85,8 @@ test.describe('orchestrion DB instrumentation', () => { 'db.query.text': '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), + '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 d50cbf4a5e95..a38e5a401b44 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.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 9d9f3826ab62..f03ea57becf3 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.name']).toBe('postgresql'); expect(firstQuery!.data?.['db.query.text']).toBe('SELECT 1 + 1 AS solution'); - expect(firstQuery!.data?.['net.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/nuxt-4-cloudflare/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4-cloudflare/tests/db.test.ts index d955313fe272..d2f846fd29cf 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).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?.['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 9998ff948b2f..edc49d309d1d 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.query.text': '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), + 'server.port': 3306, }), }), ); @@ -91,8 +91,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + '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 bace6bfa2f22..3f1a0b059934 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.query.text': '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), + 'server.port': 3306, }), }), ); @@ -105,8 +105,8 @@ test.describe('server - orchestrion build-time db instrumentation', () => { 'db.query.text': '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), + '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 16da10b6bfbf..345ae42d0629 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).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?.['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 31a8adf47cc4..6e7270571658 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.query.text': '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), + 'server.port': 3306, }), }), ); @@ -78,8 +78,8 @@ test('Instruments mysql automatically via build-time orchestrion', async ({ base 'db.query.text': '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), + 'server.port': 3306, }), }), ); diff --git a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/db.test.ts index 36cc9b21dbaa..b030b04f4be3 100644 --- a/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/sveltekit-2/tests/db.test.ts @@ -63,8 +63,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + 'server.port': 3306, }), }), ); @@ -79,8 +79,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + '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 4d7bead1f857..29779ff2a045 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.name']).toBe('mysql'); expect(firstQuery!.data?.['db.query.text']).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?.['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 3e8619a37dc0..1d25ce7f8b2a 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.query.text': '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), + 'server.port': 3306, }), }), ); @@ -88,8 +88,8 @@ test('Instruments mysql automatically', async ({ baseURL }) => { 'db.query.text': '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), + 'server.port': 3306, }), }), ); 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..29c313b1363e 100644 --- a/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts @@ -18,8 +18,6 @@ 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, 'messaging.operation.type': 'send', 'messaging.destination.name': '', 'messaging.rabbitmq.destination.routing_key': routingKey, 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 a10f3971916f..53e629d1e182 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', + 'server.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', + '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 e0e9910d1be9..2e8c61e3494a 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.namespace': 'tests', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 5445, + 'server.address': 'localhost', + 'server.port': 5445, }), status: 'ok', description: @@ -35,8 +35,8 @@ describe('knex auto instrumentation', () => { 'db.namespace': 'tests', 'sentry.origin': ORIGIN, 'sentry.op': 'db', - 'net.peer.name': 'localhost', - 'net.peer.port': 5445, + 'server.address': 'localhost', + '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 ba2ddc1443bf..d22862d285d3 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.collection.name': 'movies', 'db.operation.name': 'find', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'server.port': expect.any(Number), 'db.query.text': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -49,8 +49,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.collection.name': 'movies', 'db.operation.name': 'insert', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'server.port': expect.any(Number), 'db.query.text': '{"title":"?","_id":{"_bsontype":"?","id":"?"}}', 'sentry.kind': 'client', }, @@ -68,8 +68,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.collection.name': '$cmd', 'db.operation.name': 'isMaster', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'server.port': expect.any(Number), 'db.query.text': '{"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.collection.name': 'movies', 'db.operation.name': 'update', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'server.port': expect.any(Number), 'db.query.text': '{"title":"?"}', 'sentry.kind': 'client', }, @@ -123,8 +123,8 @@ describe('MongoDB auto-instrumentation', () => { 'db.namespace': 'admin', 'db.collection.name': '$cmd', 'db.connection_string': expect.any(String), - 'net.peer.name': expect.any(String), - 'net.peer.port': expect.any(Number), + 'server.address': expect.any(String), + 'server.port': expect.any(Number), 'db.query.text': '{"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 7e645825bf73..9c92c7b3d779 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.name': 'mysql', - 'net.peer.name': 'localhost', - 'net.peer.port': port, + 'server.address': 'localhost', + 'server.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': { + '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 8ba6407a138a..13ef2055b2b8 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.name': 'mysql', 'db.query.text': 'SELECT 1 + 1 AS solution', - 'net.peer.name': 'localhost', - 'net.peer.port': 3306, + 'server.address': 'localhost', + 'server.port': 3306, 'db.user': 'root', }), }), @@ -34,8 +34,8 @@ describeWithDockerCompose('mysql2 auto instrumentation', { workingDirectory: [__ data: expect.objectContaining({ 'db.system.name': 'mysql', 'db.query.text': 'SELECT ? as a, ? as b, NOW() as c', - 'net.peer.name': 'localhost', - 'net.peer.port': 3306, + 'server.address': 'localhost', + '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 afbb56986f18..d561ba65fa8c 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': { + 'server.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 e6a53001eaee..dfc907d0aa56 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.name': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, 'db.query.text': 'set test-key [1 other arguments]', }), }), @@ -32,8 +32,8 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory data: expect.objectContaining({ 'sentry.op': 'db', 'db.system.name': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6383, + 'server.address': 'localhost', + 'server.port': 6383, 'db.query.text': '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 9061ab62cde4..1bafe944d94d 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.name': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'server.port': 6380, 'db.query.text': 'set test-key [1 other arguments]', }), }), @@ -36,8 +36,8 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.op': 'db', 'sentry.origin': origin, 'db.system.name': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'server.port': 6380, 'db.query.text': 'get test-key', }), }), @@ -51,8 +51,8 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d 'sentry.op': 'db', 'sentry.origin': origin, 'db.system.name': 'redis', - 'net.peer.name': 'localhost', - 'net.peer.port': 6380, + 'server.address': 'localhost', + 'server.port': 6380, 'db.query.text': '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 46db5196098f..35427782a145 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.name': 'mssql', 'db.namespace': 'master', 'db.user': 'sa', - 'net.peer.name': '127.0.0.1', - 'net.peer.port': 1433, + 'server.address': '127.0.0.1', + 'server.port': 1433, }), ...overrides, }); diff --git a/docs/migration/v11-end-state.md b/docs/migration/v11-end-state.md index 3f9dbcb47d2a..49e8ddf60d32 100644 --- a/docs/migration/v11-end-state.md +++ b/docs/migration/v11-end-state.md @@ -527,6 +527,7 @@ 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`. +- The `net.peer.name` and `net.peer.port` span attributes on database and messaging client spans were replaced by `server.address` and `server.port`, and `net.transport` by `network.transport`. - `network.*` span attributes were aligned across SDKs. - Legacy messaging (`messaging.*`) span attributes on the AMQP instrumentation were replaced by their current semantic-convention equivalents. - The database span attributes `db.system`, `db.name`, `db.operation`, `db.statement` and `db.mongodb.collection` were renamed to `db.system.name`, `db.namespace`, `db.operation.name`, `db.query.text` and `db.collection.name`. diff --git a/packages/server-utils/src/integrations/amqplib.ts b/packages/server-utils/src/integrations/amqplib.ts index 14b52401b4c3..2ce8b9d8fb91 100644 --- a/packages/server-utils/src/integrations/amqplib.ts +++ b/packages/server-utils/src/integrations/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/knex.ts b/packages/server-utils/src/integrations/knex.ts index c6ec163a752e..2928f66bd339 100644 --- a/packages/server-utils/src/integrations/knex.ts +++ b/packages/server-utils/src/integrations/knex.ts @@ -20,10 +20,10 @@ import { DB_QUERY_TEXT, DB_SYSTEM_NAME, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, - NET_TRANSPORT, + NETWORK_TRANSPORT, SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, } from '@sentry/conventions/attributes'; import { DEBUG_BUILD } from '../debug-build'; import { CHANNELS } from '../orchestrion/channels'; @@ -176,9 +176,9 @@ function subscribeQuery(): void { [DB_OPERATION_NAME]: operation, [DB_USER]: connection?.user, [DB_NAMESPACE]: 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_QUERY_TEXT]: dbStatement, }; diff --git a/packages/server-utils/src/integrations/mongodb/mongodb-span.ts b/packages/server-utils/src/integrations/mongodb/mongodb-span.ts index d015e362f3e9..b3b8ca98c4a9 100644 --- a/packages/server-utils/src/integrations/mongodb/mongodb-span.ts +++ b/packages/server-utils/src/integrations/mongodb/mongodb-span.ts @@ -1,21 +1,17 @@ -// The `@sentry/conventions` net attribute keys are deprecated (superseded by newer semconv), but we -// emit them deliberately to preserve parity with what `@opentelemetry/instrumentation-mongodb` produced. -/* oxlint-disable typescript/no-deprecated */ - import { DB_COLLECTION_NAME, DB_NAMESPACE, DB_OPERATION_NAME, DB_QUERY_TEXT, DB_SYSTEM_NAME, - NET_PEER_NAME, - NET_PEER_PORT, SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, } from '@sentry/conventions/attributes'; import type { Span, SpanAttributes } from '@sentry/core'; import { isObjectLike, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; -// OTel db keys/values not exported by `@sentry/conventions`, inlined to match +// `db.connection_string` is not part of `@sentry/conventions`, so it stays inlined to match // what `@opentelemetry/instrumentation-mongodb` emitted. const ATTR_DB_CONNECTION_STRING = 'db.connection_string'; const DB_SYSTEM_VALUE_MONGODB = 'mongodb'; @@ -132,10 +128,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; } } @@ -218,8 +214,7 @@ export function getV3SpanAttributes( } /** - * Start a mongodb client span, with the db attributes on the stable conventions - * and the net attributes still on the legacy ones. + * Start a mongodb client span on the stable conventions. * * `op: 'db'` is set explicitly rather than relying on `inferDbSpanData`, * to support platforms that lack it (ie, Deno). diff --git a/packages/server-utils/src/integrations/mongoose/mongoose-legacy-span.ts b/packages/server-utils/src/integrations/mongoose/mongoose-legacy-span.ts index 69e0cca1e2cc..9a018566e8fb 100644 --- a/packages/server-utils/src/integrations/mongoose/mongoose-legacy-span.ts +++ b/packages/server-utils/src/integrations/mongoose/mongoose-legacy-span.ts @@ -5,16 +5,12 @@ import { DB_SYSTEM_NAME, DB_USER, SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, } from '@sentry/conventions/attributes'; import type { Span, SpanAttributes } from '@sentry/core'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; -// OTel "OLD" net semantic-conventions, reproduced from the vendored -// `@opentelemetry/instrumentation-mongoose` span shape. Inlined as literals to -// avoid importing the deprecated convention constants. -const ATTR_NET_PEER_NAME = 'net.peer.name'; -const ATTR_NET_PEER_PORT = 'net.peer.port'; - /** The subset of mongoose's `Collection` that the legacy span shape reads. */ export interface MongooseLegacyCollection { name?: string; @@ -31,8 +27,8 @@ export interface StartMongooseLegacySpanOptions { /** * Start a mongoose client span reproducing the vendored - * `@opentelemetry/instrumentation-mongoose` span shape, with the db attributes - * on the stable conventions and the net attributes still on the legacy ones. + * `@opentelemetry/instrumentation-mongoose` span shape, on the stable + * conventions. * * Shared by the vendored OTel/IITM instrumentation (`@sentry/node`) and the * orchestrion channel subscriber so the two emit an identical span shape, @@ -50,8 +46,8 @@ export function startMongooseLegacySpan({ [DB_COLLECTION_NAME]: collection?.name, [DB_NAMESPACE]: collection?.conn?.name, [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, [DB_OPERATION_NAME]: operation, [DB_SYSTEM_NAME]: 'mongoose', [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, diff --git a/packages/server-utils/src/integrations/mysql.ts b/packages/server-utils/src/integrations/mysql.ts index 97f05431da50..fc2d4ff69dd1 100644 --- a/packages/server-utils/src/integrations/mysql.ts +++ b/packages/server-utils/src/integrations/mysql.ts @@ -1,5 +1,13 @@ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { DB_NAMESPACE, DB_QUERY_TEXT, DB_SYSTEM_NAME, DB_USER, SENTRY_KIND } from '@sentry/conventions/attributes'; +import { + DB_NAMESPACE, + DB_QUERY_TEXT, + DB_SYSTEM_NAME, + DB_USER, + SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import type { IntegrationFn, Scope } from '@sentry/core'; import { isObjectLike, @@ -18,11 +26,9 @@ import { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation // When enabled, OTel 'Mysql' integration is omitted from the default set. const INTEGRATION_NAME = 'Mysql' as const; -// OTel "OLD" net semantic-conventions and the non-conventions `db.connection_string`, inlined to keep -// this integration free of OTel deps. Matches `@opentelemetry/instrumentation-mysql`'s default shape. +// `db.connection_string` is not part of `@sentry/conventions`, so it stays inlined. Matches +// `@opentelemetry/instrumentation-mysql`'s default shape. const ATTR_DB_CONNECTION_STRING = 'db.connection_string'; -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 @@ -85,8 +91,8 @@ function instrumentMysql(): void { ...(database ? { [DB_NAMESPACE]: database } : {}), ...(user ? { [DB_USER]: user } : {}), ...(sql ? { [DB_QUERY_TEXT]: 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/mysql2/index.ts b/packages/server-utils/src/integrations/mysql2/index.ts index ecec865ebd0f..7232b984c889 100644 --- a/packages/server-utils/src/integrations/mysql2/index.ts +++ b/packages/server-utils/src/integrations/mysql2/index.ts @@ -19,9 +19,9 @@ import { DB_QUERY_TEXT, DB_SYSTEM_NAME, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, } from '@sentry/conventions/attributes'; const INTEGRATION_NAME = 'Mysql2' as const; @@ -124,9 +124,9 @@ function getConnectionAttributes(config: Mysql2ConnectionConfig | undefined): Sp [DB_NAMESPACE]: 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/postgres.ts b/packages/server-utils/src/integrations/postgres.ts index 151e94de75c3..567423a614d3 100644 --- a/packages/server-utils/src/integrations/postgres.ts +++ b/packages/server-utils/src/integrations/postgres.ts @@ -1,5 +1,13 @@ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { DB_NAMESPACE, DB_QUERY_TEXT, DB_SYSTEM_NAME, DB_USER, SENTRY_KIND } from '@sentry/conventions/attributes'; +import { + DB_NAMESPACE, + DB_QUERY_TEXT, + DB_SYSTEM_NAME, + DB_USER, + SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import type { IntegrationFn, Scope, SpanAttributes } from '@sentry/core'; import { isObjectLike, @@ -22,12 +30,9 @@ const INTEGRATION_NAME = 'Postgres' as const; // so they default to 'manual'). const ORIGIN = 'auto.db.postgres'; -// OpenTelemetry "OLD" net semantic-conventions and the non-conventions -// `db.connection_string`, inlined to keep this integration free of -// `@opentelemetry/*` deps. +// `db.connection_string` is not part of `@sentry/conventions`, so it stays +// inlined, keeping this integration free of `@opentelemetry/*` deps. const ATTR_DB_CONNECTION_STRING = 'db.connection_string'; -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'; @@ -217,8 +222,8 @@ function getConnectionAttributes(params: PgConnectionParams): SpanAttributes { [ATTR_DB_CONNECTION_STRING]: getConnectionString(params), [DB_NAMESPACE]: params.database, [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, }; } @@ -242,9 +247,9 @@ function getPoolConnectionAttributes(opts: PgPoolOptions): SpanAttributes { [ATTR_PG_IDLE_TIMEOUT]: opts.idleTimeoutMillis, [ATTR_PG_MAX_CLIENT]: opts.max, [DB_NAMESPACE]: 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, [DB_USER]: user || undefined, }; } diff --git a/packages/server-utils/src/integrations/redis/index.ts b/packages/server-utils/src/integrations/redis/index.ts index 601420aafbf0..873ae16aa292 100644 --- a/packages/server-utils/src/integrations/redis/index.ts +++ b/packages/server-utils/src/integrations/redis/index.ts @@ -1,13 +1,8 @@ -/* eslint-disable @typescript-eslint/no-deprecated -- the net attributes are still on the OLD semconv, - matching `@opentelemetry/instrumentation-redis`. TODO(v11): switch to `server.address`/`server.port` - and drop this disable. */ import * as diagnosticsChannel from 'node:diagnostics_channel'; import { DB_OPERATION_BATCH_SIZE, DB_QUERY_TEXT, DB_SYSTEM_NAME, - NET_PEER_NAME, - NET_PEER_PORT, SENTRY_KIND, SERVER_ADDRESS, SERVER_PORT, @@ -114,8 +109,8 @@ function removeCredentialsFromConnectionString(url: string | undefined): string function nodeRedisAttributes(options: NodeRedisClientOptions | undefined): SpanAttributes { return { [DB_SYSTEM_NAME]: 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, }; @@ -162,8 +157,8 @@ function subscribeLegacyRedisCommand(cacheOptions: RedisCacheOptions): void { [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/redis/ioredis-channel-subscriber.ts b/packages/server-utils/src/integrations/redis/ioredis-channel-subscriber.ts index b1ed318ba5d7..b745cc1c539d 100644 --- a/packages/server-utils/src/integrations/redis/ioredis-channel-subscriber.ts +++ b/packages/server-utils/src/integrations/redis/ioredis-channel-subscriber.ts @@ -1,8 +1,5 @@ -/* eslint-disable @typescript-eslint/no-deprecated -- the net attributes are still on the OLD semconv, - matching `@opentelemetry/instrumentation-ioredis`. TODO(v11): switch to `server.address`/`server.port` - and drop this disable. */ import * as diagnosticsChannel from 'node:diagnostics_channel'; -import { DB_QUERY_TEXT, DB_SYSTEM_NAME, NET_PEER_NAME, NET_PEER_PORT } from '@sentry/conventions/attributes'; +import { DB_QUERY_TEXT, DB_SYSTEM_NAME, SERVER_ADDRESS, SERVER_PORT } from '@sentry/conventions/attributes'; import type { Span } from '@sentry/core'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core'; import { CHANNELS } from '../../orchestrion/channels'; @@ -43,8 +40,8 @@ function connectionAttributes(host: string | undefined, port: number | undefined return { [DB_SYSTEM_NAME]: '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/tedious.ts b/packages/server-utils/src/integrations/tedious.ts index 69064f907b75..65f0ea8d2c6b 100644 --- a/packages/server-utils/src/integrations/tedious.ts +++ b/packages/server-utils/src/integrations/tedious.ts @@ -16,9 +16,9 @@ import { DB_QUERY_TEXT, DB_SYSTEM_NAME, DB_USER, - NET_PEER_NAME, - NET_PEER_PORT, SENTRY_KIND, + SERVER_ADDRESS, + SERVER_PORT, } from '@sentry/conventions/attributes'; import { CHANNELS } from '../orchestrion/channels'; import { tediousModuleNames } from '../orchestrion/config/tedious'; @@ -136,8 +136,8 @@ function subscribeQuery(channelName: string, operation: string): void { [DB_USER]: connection.config?.userName ?? connection.config?.authentication?.options?.userName, [DB_QUERY_TEXT]: 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/test/orchestrion/postgres.test.ts b/packages/server-utils/test/orchestrion/postgres.test.ts index 6f85284a407e..b0b529681dc9 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.name': 'postgresql', 'db.namespace': '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.query.text': 'SELECT * FROM "User"', 'sentry.origin': 'auto.db.postgres', @@ -212,8 +212,8 @@ describe('postgresIntegration', () => { 'db.system.name': 'postgresql', 'db.namespace': '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, }), }), ); diff --git a/packages/server-utils/test/redis/ioredis-channel-subscriber.test.ts b/packages/server-utils/test/redis/ioredis-channel-subscriber.test.ts index 64bbd38fe834..4ddcb5ac6082 100644 --- a/packages/server-utils/test/redis/ioredis-channel-subscriber.test.ts +++ b/packages/server-utils/test/redis/ioredis-channel-subscriber.test.ts @@ -30,8 +30,8 @@ describe('startIORedisCommandSpan', () => { attributes: expect.objectContaining({ 'db.system.name': 'redis', 'db.connection_string': 'redis://localhost:6379', - 'net.peer.name': 'localhost', - 'net.peer.port': 6379, + 'server.address': 'localhost', + 'server.port': 6379, 'db.query.text': 'set test-key [1 other arguments]', 'sentry.origin': 'auto.db.redis', }),