Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 27017);
assertEquals(mongoSpan!.data?.['sentry.origin'], 'auto.db.mongo');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 27017);
assertEquals(mongooseSpan!.data?.['sentry.origin'], 'auto.db.mongoose');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 3306);
assertEquals(mysqlSpan!.data?.['db.user'], 'root');
assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 3306);
assertEquals(mysqlSpan!.data?.['sentry.origin'], 'auto.db.mysql2');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 5432);
assertEquals(pgSpan!.data?.['db.user'], 'root');
assertEquals(pgSpan!.data?.['sentry.origin'], 'auto.db.postgres');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port'], 1433);
assertEquals(tediousSpan!.data?.['sentry.origin'], 'auto.db.tedious');
});
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port']).toBe(3306);
expect(firstQuery!.data?.['db.user']).toBe('root');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
'server.port': 3306,
}),
}),
);
Expand All @@ -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),
'server.port': 3306,
}),
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port']).toBe(3306);
expect(firstQuery!.data?.['db.user']).toBe('root');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port']).toBe(3306);
expect(firstQuery!.data?.['db.user']).toBe('root');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
'server.port': 3306,
}),
}),
);
Expand All @@ -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),
'server.port': 3306,
}),
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port']).toBe(3306);
expect(firstQuery!.data?.['db.user']).toBe('root');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?.['server.port']).toBe(5432);
expect(firstQuery!.data?.['db.user']).toBe('postgres');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading
Loading