Skip to content

Commit 5391d08

Browse files
committed
fix otel tests (maybe)
1 parent f528092 commit 5391d08

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/opentelemetry-node/test/spanprocessor.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ describe('SentrySpanProcessor', () => {
569569

570570
child.end();
571571

572-
const { description, data } = spanToJSON(sentrySpan!);
572+
const { description, data, op } = spanToJSON(sentrySpan!);
573573

574574
expect(description).toBe('GET http://example.com/my/route/123');
575575
expect(data).toEqual({
@@ -578,7 +578,9 @@ describe('SentrySpanProcessor', () => {
578578
'http.url': 'http://example.com/my/route/123',
579579
'otel.kind': 'INTERNAL',
580580
url: 'http://example.com/my/route/123',
581+
'sentry.op': 'http',
581582
});
583+
expect(op).toBe('http');
582584

583585
parentOtelSpan.end();
584586
});
@@ -598,7 +600,7 @@ describe('SentrySpanProcessor', () => {
598600

599601
child.end();
600602

601-
const { description, data } = spanToJSON(sentrySpan!);
603+
const { description, data, op } = spanToJSON(sentrySpan!);
602604

603605
expect(description).toBe('GET http://example.com/my/route/123');
604606
expect(data).toEqual({
@@ -609,7 +611,9 @@ describe('SentrySpanProcessor', () => {
609611
url: 'http://example.com/my/route/123',
610612
'http.query': '?what=123',
611613
'http.fragment': '#myHash',
614+
'sentry.op': 'http',
612615
});
616+
expect(op).toBe('http');
613617

614618
parentOtelSpan.end();
615619
});

packages/opentelemetry/test/integration/transactions.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('Integration | Transactions', () => {
8383
},
8484
},
8585
trace: {
86-
data: { 'otel.kind': 'INTERNAL' },
86+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op' },
8787
op: 'test op',
8888
span_id: expect.any(String),
8989
status: 'ok',
@@ -144,7 +144,9 @@ describe('Integration | Transactions', () => {
144144
// This is the same behavior as for the "regular" SDKs
145145
expect(spans.map(span => spanToJSON(span))).toEqual([
146146
{
147-
data: { 'otel.kind': 'INTERNAL' },
147+
data: {
148+
'otel.kind': 'INTERNAL',
149+
},
148150
description: 'inner span 1',
149151
origin: 'manual',
150152
parent_span_id: expect.any(String),
@@ -236,7 +238,7 @@ describe('Integration | Transactions', () => {
236238
},
237239
}),
238240
trace: {
239-
data: { 'otel.kind': 'INTERNAL' },
241+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op' },
240242
op: 'test op',
241243
span_id: expect.any(String),
242244
status: 'ok',
@@ -278,7 +280,7 @@ describe('Integration | Transactions', () => {
278280
},
279281
}),
280282
trace: {
281-
data: { 'otel.kind': 'INTERNAL' },
283+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op b' },
282284
op: 'test op b',
283285
span_id: expect.any(String),
284286
status: 'ok',
@@ -355,7 +357,10 @@ describe('Integration | Transactions', () => {
355357
attributes: {},
356358
}),
357359
trace: {
358-
data: { 'otel.kind': 'INTERNAL' },
360+
data: {
361+
'otel.kind': 'INTERNAL',
362+
'sentry.op': 'test op',
363+
},
359364
op: 'test op',
360365
span_id: expect.any(String),
361366
parent_span_id: parentSpanId,

0 commit comments

Comments
 (0)