Skip to content
Merged
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 @@ -17,24 +17,26 @@ test('Instruments ioredis automatically', async ({ baseURL }) => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@ test.describe('orchestrion DB instrumentation', () => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ test('Instruments DB calls made during server-side rendering of a page', async (
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set page-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set page-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get page-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get page-key',
}),
}),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,26 @@ test('Instruments ioredis automatically', async ({ baseURL }) => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,26 @@ test.describe('server - orchestrion build-time db instrumentation', () => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand All @@ -59,7 +61,7 @@ test.describe('server - orchestrion build-time db instrumentation', () => {
// Every db span nests under the native instrumentation-API http.server transaction.
const rootSpanId = transactionEvent.contexts?.trace?.span_id;
const spanIds = new Set([rootSpanId, ...spans.map(span => span.span_id)]);
const dbSpans = spans.filter(span => span.op === 'db');
const dbSpans = spans.filter(span => span.origin === 'auto.db.redis');
expect(dbSpans.every(span => typeof span.parent_span_id === 'string' && spanIds.has(span.parent_span_id))).toBe(
true,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@ test('Instruments ioredis automatically via build-time orchestrion', async ({ ba

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@ test('Instruments ioredis automatically', async ({ baseURL }) => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,26 @@ test('Instruments ioredis automatically', async ({ baseURL }) => {

expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'set test-key [1 other arguments]',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'set',
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
);
expect(spans).toContainEqual(
expect.objectContaining({
op: 'db',
op: 'db.query',
origin: 'auto.db.redis',
description: 'get test-key',
status: 'ok',
data: expect.objectContaining({
'db.system.name': 'redis',
'db.operation.name': 'get',
'db.query.text': 'get test-key',
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ const expectedProducerSpan = (routingKey: string) =>
op: 'queue.publish',
data: expect.objectContaining({
'messaging.system': 'rabbitmq',
// Legacy messaging attributes emitted by both the OTel and orchestrion integrations.
'messaging.destination': '',
'messaging.destination_kind': 'topic',
'messaging.rabbitmq.routing_key': routingKey,
'messaging.url': 'amqp://sentry:***@localhost:5672/',
'messaging.protocol': 'AMQP',
'messaging.protocol_version': '0.9.1',
'messaging.operation.name': 'send',
'messaging.operation.type': 'send',
'messaging.destination.name': '',
'messaging.rabbitmq.destination.routing_key': routingKey,
Expand All @@ -37,14 +31,10 @@ const EXPECTED_MESSAGE_SPAN_CONSUMER = expect.objectContaining({
op: 'queue.process',
data: expect.objectContaining({
'messaging.system': 'rabbitmq',
// Legacy messaging attributes emitted by both the OTel and orchestrion integrations. The consumer
// reads the default exchange ('') off the delivered message and the queue name as the routing key.
'messaging.destination': '',
'messaging.destination_kind': 'topic',
'messaging.rabbitmq.routing_key': 'queue1',
'messaging.operation': 'process',
// The consumer reads the default exchange ('') off the delivered message and the queue name as the routing key.
'messaging.destination.name': '',
'messaging.rabbitmq.destination.routing_key': 'queue1',
'messaging.operation.name': 'process',
'messaging.operation.type': 'process',
'sentry.kind': 'consumer',
'sentry.op': 'queue.process',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory
});

const redisOrigin = 'auto.db.redis';
const redisSpanOp = 'db.query';

describe('ioredis non-cache keys', () => {
const EXPECTED_TRANSACTION = {
transaction: 'Test Span',
spans: expect.arrayContaining([
expect.objectContaining({
description: 'set test-key [1 other arguments]',
op: 'db',
op: redisSpanOp,
origin: redisOrigin,
data: expect.objectContaining({
'sentry.op': 'db',
'sentry.op': redisSpanOp,
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6383,
Expand All @@ -26,10 +27,10 @@ describeWithDockerCompose('redis cache auto instrumentation', { workingDirectory
}),
expect.objectContaining({
description: 'get test-key',
op: 'db',
op: redisSpanOp,
origin: redisOrigin,
data: expect.objectContaining({
'sentry.op': 'db',
'sentry.op': redisSpanOp,
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6383,
Expand Down
30 changes: 15 additions & 15 deletions dev-packages/node-integration-tests/suites/tracing/redis/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@ describeWithDockerCompose('redis auto instrumentation', { workingDirectory: [__d
// subscriber instead of the OTel monkey-patch, so the span origin differs. All
// other attributes are identical.
const origin = 'auto.db.redis';
const redisSpanOp = 'db.query';
const redisData = {
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6380,
};

const EXPECTED_TRANSACTION = {
transaction: 'Test Span',
spans: expect.arrayContaining([
expect.objectContaining({
description: 'set test-key [1 other arguments]',
op: 'db',
op: redisSpanOp,
origin,
data: expect.objectContaining({
'sentry.op': 'db',
'sentry.op': redisSpanOp,
'sentry.origin': origin,
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6380,
...redisData,
'db.query.text': 'set test-key [1 other arguments]',
}),
}),
expect.objectContaining({
description: 'get test-key',
op: 'db',
op: redisSpanOp,
origin,
data: expect.objectContaining({
'sentry.op': 'db',
'sentry.op': redisSpanOp,
'sentry.origin': origin,
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6380,
...redisData,
'db.query.text': 'get test-key',
}),
}),
// a failing command produces a span with an error status
expect.objectContaining({
description: 'incr test-key',
op: 'db',
op: redisSpanOp,
status: 'internal_error',
origin,
data: expect.objectContaining({
'sentry.op': 'db',
'sentry.op': redisSpanOp,
'sentry.origin': origin,
'db.system.name': 'redis',
'server.address': 'localhost',
'server.port': 6380,
...redisData,
'db.query.text': 'incr test-key',
Comment thread
s1gr1d marked this conversation as resolved.
}),
}),
Expand Down
3 changes: 2 additions & 1 deletion docs/migration/v11-end-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,9 @@ Attribute availability remains runtime-dependent. For example, browser and Worke

#### Messaging and database attributes

- Legacy messaging (`messaging.*`) span attributes on the AMQP instrumentation were replaced by their current semantic-convention equivalents.
- Legacy messaging (`messaging.*`) span attributes on the AMQP instrumentation were replaced by their current semantic-convention equivalents: `messaging.destination.name`, `messaging.rabbitmq.destination.routing_key`, `messaging.message.id`, `messaging.message.conversation_id`, `messaging.operation.name`, `network.protocol.name`, `network.protocol.version`, and `url.full`. `messaging.destination_kind` is no longer emitted.
- 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`.
- The Redis and ioredis instrumentations no longer emit `db.connection_string`. The connection is described by `server.address` and `server.port` instead.

#### GenAI attributes

Expand Down
Loading
Loading