Skip to content

Commit a6a4e53

Browse files
authored
ref: Remove usage of span tags (#10808)
Mostly, we rewrite this to just use attributes. This affects esp.: * browser profiling * angular tracing * http status (only set as attribute now) * remix tracing * remove all `routing.instrumentation` type tags completely (this is covered by origin now anyhow) Not covered by this are browser metrics, which is a dedicated PR here: #10823
1 parent d570594 commit a6a4e53

File tree

43 files changed

+121
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+121
-423
lines changed

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
7878
span_id: expect.any(String),
7979
start_timestamp: expect.any(Number),
8080
status: 'ok',
81-
tags: { 'http.status_code': '200' },
8281
timestamp: expect.any(Number),
8382
trace_id: expect.any(String),
8483
},

dev-packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/propagation.test.ts

Lines changed: 61 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import { Span } from '@sentry/types';
33
import axios from 'axios';
44
import { waitForTransaction } from '../event-proxy-server';
55

6-
const authToken = process.env.E2E_TEST_AUTH_TOKEN;
7-
const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG;
8-
const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
9-
const EVENT_POLLING_TIMEOUT = 90_000;
10-
116
test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
127
const inboundTransactionPromise = waitForTransaction('node-experimental-fastify-app', transactionEvent => {
138
return (
@@ -55,56 +50,38 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
5550
]),
5651
);
5752

58-
expect(outboundTransaction).toEqual(
59-
expect.objectContaining({
60-
contexts: expect.objectContaining({
61-
trace: {
62-
data: {
63-
url: 'http://localhost:3030/test-outgoing-http',
64-
'otel.kind': 'SERVER',
65-
'http.response.status_code': 200,
66-
'sentry.op': 'http.server',
67-
'sentry.origin': 'auto.http.otel.http',
68-
'sentry.source': 'route',
69-
},
70-
op: 'http.server',
71-
span_id: expect.any(String),
72-
status: 'ok',
73-
tags: {
74-
'http.status_code': '200',
75-
},
76-
trace_id: traceId,
77-
origin: 'auto.http.otel.http',
78-
},
79-
}),
80-
}),
81-
);
53+
expect(outboundTransaction.contexts?.trace).toEqual({
54+
data: {
55+
url: 'http://localhost:3030/test-outgoing-http',
56+
'otel.kind': 'SERVER',
57+
'http.response.status_code': 200,
58+
'sentry.op': 'http.server',
59+
'sentry.origin': 'auto.http.otel.http',
60+
'sentry.source': 'route',
61+
},
62+
op: 'http.server',
63+
span_id: expect.any(String),
64+
status: 'ok',
65+
trace_id: traceId,
66+
origin: 'auto.http.otel.http',
67+
});
8268

83-
expect(inboundTransaction).toEqual(
84-
expect.objectContaining({
85-
contexts: expect.objectContaining({
86-
trace: {
87-
data: {
88-
url: 'http://localhost:3030/test-inbound-headers',
89-
'otel.kind': 'SERVER',
90-
'http.response.status_code': 200,
91-
'sentry.op': 'http.server',
92-
'sentry.origin': 'auto.http.otel.http',
93-
'sentry.source': 'route',
94-
},
95-
op: 'http.server',
96-
parent_span_id: outgoingHttpSpanId,
97-
span_id: expect.any(String),
98-
status: 'ok',
99-
tags: {
100-
'http.status_code': '200',
101-
},
102-
trace_id: traceId,
103-
origin: 'auto.http.otel.http',
104-
},
105-
}),
106-
}),
107-
);
69+
expect(inboundTransaction.contexts?.trace).toEqual({
70+
data: {
71+
url: 'http://localhost:3030/test-inbound-headers',
72+
'otel.kind': 'SERVER',
73+
'http.response.status_code': 200,
74+
'sentry.op': 'http.server',
75+
'sentry.origin': 'auto.http.otel.http',
76+
'sentry.source': 'route',
77+
},
78+
op: 'http.server',
79+
parent_span_id: outgoingHttpSpanId,
80+
span_id: expect.any(String),
81+
status: 'ok',
82+
trace_id: traceId,
83+
origin: 'auto.http.otel.http',
84+
});
10885
});
10986

11087
test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
@@ -154,54 +131,36 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
154131
]),
155132
);
156133

157-
expect(outboundTransaction).toEqual(
158-
expect.objectContaining({
159-
contexts: expect.objectContaining({
160-
trace: {
161-
data: {
162-
url: 'http://localhost:3030/test-outgoing-fetch',
163-
'otel.kind': 'SERVER',
164-
'http.response.status_code': 200,
165-
'sentry.op': 'http.server',
166-
'sentry.origin': 'auto.http.otel.http',
167-
'sentry.source': 'route',
168-
},
169-
op: 'http.server',
170-
span_id: expect.any(String),
171-
status: 'ok',
172-
tags: {
173-
'http.status_code': '200',
174-
},
175-
trace_id: traceId,
176-
origin: 'auto.http.otel.http',
177-
},
178-
}),
179-
}),
180-
);
134+
expect(outboundTransaction.contexts?.trace).toEqual({
135+
data: {
136+
url: 'http://localhost:3030/test-outgoing-fetch',
137+
'otel.kind': 'SERVER',
138+
'http.response.status_code': 200,
139+
'sentry.op': 'http.server',
140+
'sentry.origin': 'auto.http.otel.http',
141+
'sentry.source': 'route',
142+
},
143+
op: 'http.server',
144+
span_id: expect.any(String),
145+
status: 'ok',
146+
trace_id: traceId,
147+
origin: 'auto.http.otel.http',
148+
});
181149

182-
expect(inboundTransaction).toEqual(
183-
expect.objectContaining({
184-
contexts: expect.objectContaining({
185-
trace: {
186-
data: {
187-
url: 'http://localhost:3030/test-inbound-headers',
188-
'otel.kind': 'SERVER',
189-
'http.response.status_code': 200,
190-
'sentry.op': 'http.server',
191-
'sentry.origin': 'auto.http.otel.http',
192-
'sentry.source': 'route',
193-
},
194-
op: 'http.server',
195-
parent_span_id: outgoingHttpSpanId,
196-
span_id: expect.any(String),
197-
status: 'ok',
198-
tags: {
199-
'http.status_code': '200',
200-
},
201-
trace_id: traceId,
202-
origin: 'auto.http.otel.http',
203-
},
204-
}),
150+
expect(inboundTransaction.contexts?.trace).toEqual({
151+
data: expect.objectContaining({
152+
url: 'http://localhost:3030/test-inbound-headers',
153+
'otel.kind': 'SERVER',
154+
'http.response.status_code': 200,
155+
'sentry.op': 'http.server',
156+
'sentry.origin': 'auto.http.otel.http',
157+
'sentry.source': 'route',
205158
}),
206-
);
159+
op: 'http.server',
160+
parent_span_id: outgoingHttpSpanId,
161+
span_id: expect.any(String),
162+
status: 'ok',
163+
trace_id: traceId,
164+
origin: 'auto.http.otel.http',
165+
});
207166
});

dev-packages/e2e-tests/test-applications/node-experimental-fastify-app/tests/transactions.test.ts

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,24 @@ test('Sends an API route transaction', async ({ baseURL }) => {
2020
const transactionEvent = await pageloadTransactionEventPromise;
2121
const transactionEventId = transactionEvent.event_id;
2222

23+
expect(transactionEvent.contexts?.trace).toEqual({
24+
data: {
25+
url: 'http://localhost:3030/test-transaction',
26+
'otel.kind': 'SERVER',
27+
'http.response.status_code': 200,
28+
'sentry.op': 'http.server',
29+
'sentry.origin': 'auto.http.otel.http',
30+
'sentry.source': 'route',
31+
},
32+
op: 'http.server',
33+
span_id: expect.any(String),
34+
status: 'ok',
35+
trace_id: expect.any(String),
36+
origin: 'auto.http.otel.http',
37+
});
38+
2339
expect(transactionEvent).toEqual(
2440
expect.objectContaining({
25-
contexts: expect.objectContaining({
26-
trace: {
27-
data: {
28-
url: 'http://localhost:3030/test-transaction',
29-
'otel.kind': 'SERVER',
30-
'http.response.status_code': 200,
31-
'sentry.op': 'http.server',
32-
'sentry.origin': 'auto.http.otel.http',
33-
'sentry.source': 'route',
34-
},
35-
op: 'http.server',
36-
span_id: expect.any(String),
37-
status: 'ok',
38-
tags: {
39-
'http.status_code': '200',
40-
},
41-
trace_id: expect.any(String),
42-
origin: 'auto.http.otel.http',
43-
},
44-
}),
45-
4641
spans: [
4742
{
4843
data: {
@@ -90,9 +85,6 @@ test('Sends an API route transaction', async ({ baseURL }) => {
9085
origin: 'manual',
9186
},
9287
],
93-
tags: {
94-
'http.status_code': '200',
95-
},
9688
transaction: 'GET /test-transaction',
9789
type: 'transaction',
9890
transaction_info: {

dev-packages/e2e-tests/test-applications/sveltekit/test/performance.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ test('sends a pageload transaction', async ({ page }) => {
2222
origin: 'auto.pageload.sveltekit',
2323
},
2424
},
25-
tags: {
26-
'routing.instrumentation': '@sentry/sveltekit',
27-
},
2825
});
2926
});
3027

dev-packages/node-integration-tests/suites/express/tracing-experimental/test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ describe('express tracing experimental', () => {
2121
},
2222
op: 'http.server',
2323
status: 'ok',
24-
tags: {
25-
'http.status_code': '200',
26-
},
2724
},
2825
},
2926
spans: expect.arrayContaining([
@@ -61,9 +58,6 @@ describe('express tracing experimental', () => {
6158
},
6259
op: 'http.server',
6360
status: 'ok',
64-
tags: {
65-
'http.status_code': '200',
66-
},
6761
},
6862
},
6963
},
@@ -93,9 +87,6 @@ describe('express tracing experimental', () => {
9387
},
9488
op: 'http.server',
9589
status: 'ok',
96-
tags: {
97-
'http.status_code': '200',
98-
},
9990
},
10091
},
10192
},
@@ -133,9 +124,6 @@ describe('express tracing experimental', () => {
133124
},
134125
op: 'http.server',
135126
status: 'ok',
136-
tags: {
137-
'http.status_code': '200',
138-
},
139127
},
140128
},
141129
},

dev-packages/node-integration-tests/suites/express/tracing/test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ test('should create and send transactions for Express routes and spans for middl
1919
},
2020
op: 'http.server',
2121
status: 'ok',
22-
tags: {
23-
'http.status_code': '200',
24-
},
2522
},
2623
},
2724
spans: [
@@ -55,9 +52,6 @@ test('should set a correct transaction name for routes specified in RegEx', done
5552
},
5653
op: 'http.server',
5754
status: 'ok',
58-
tags: {
59-
'http.status_code': '200',
60-
},
6155
},
6256
},
6357
},
@@ -87,9 +81,6 @@ test.each([['array1'], ['array5']])(
8781
},
8882
op: 'http.server',
8983
status: 'ok',
90-
tags: {
91-
'http.status_code': '200',
92-
},
9384
},
9485
},
9586
},
@@ -127,9 +118,6 @@ test.each([
127118
},
128119
op: 'http.server',
129120
status: 'ok',
130-
tags: {
131-
'http.status_code': '200',
132-
},
133121
},
134122
},
135123
},

dev-packages/node-integration-tests/suites/tracing/spans/test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ test('should capture spans for outgoing http requests', async () => {
2222
op: 'http.client',
2323
origin: 'auto.http.node.http',
2424
status: 'ok',
25-
tags: {
26-
'http.status_code': '200',
27-
},
2825
},
2926
{
3027
description: 'GET http://match-this-url.com/api/v1',
3128
op: 'http.client',
3229
origin: 'auto.http.node.http',
3330
status: 'ok',
34-
tags: {
35-
'http.status_code': '200',
36-
},
3731
},
3832
],
3933
});

packages/angular/src/tracing.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ export class TraceService implements OnDestroy {
144144
attributes: {
145145
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular',
146146
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
147-
},
148-
tags: {
149147
url: strippedUrl,
150148
...(navigationEvent.navigationTrigger && {
151149
navigationTrigger: navigationEvent.navigationTrigger,
@@ -176,8 +174,7 @@ export class TraceService implements OnDestroy {
176174
name: `${navigationEvent.url}`,
177175
op: ANGULAR_ROUTING_OP,
178176
origin: 'auto.ui.angular',
179-
tags: {
180-
'routing.instrumentation': '@sentry/angular',
177+
attributes: {
181178
url: strippedUrl,
182179
...(navigationEvent.navigationTrigger && {
183180
navigationTrigger: navigationEvent.navigationTrigger,

0 commit comments

Comments
 (0)