Skip to content

Commit 3134d5b

Browse files
committed
chore(react-router): Use snake_case for span op names
1 parent 821e986 commit 3134d5b

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

dev-packages/e2e-tests/test-applications/react-router-7-framework-custom/tests/performance/performance.server.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ test.describe('server - performance', () => {
153153
trace_id: expect.any(String),
154154
data: {
155155
'sentry.origin': 'auto.http.react_router.loader',
156-
'sentry.op': 'function.react-router.loader',
156+
'sentry.op': 'function.react_router.loader',
157157
},
158158
description: 'Executing Server Loader',
159159
parent_span_id: expect.any(String),
160160
start_timestamp: expect.any(Number),
161161
timestamp: expect.any(Number),
162162
status: 'ok',
163-
op: 'function.react-router.loader',
163+
op: 'function.react_router.loader',
164164
origin: 'auto.http.react_router.loader',
165165
});
166166
});
@@ -213,14 +213,14 @@ test.describe('server - performance', () => {
213213
trace_id: expect.any(String),
214214
data: {
215215
'sentry.origin': 'auto.http.react_router.action',
216-
'sentry.op': 'function.react-router.action',
216+
'sentry.op': 'function.react_router.action',
217217
},
218218
description: 'Executing Server Action',
219219
parent_span_id: expect.any(String),
220220
start_timestamp: expect.any(Number),
221221
timestamp: expect.any(Number),
222222
status: 'ok',
223-
op: 'function.react-router.action',
223+
op: 'function.react_router.action',
224224
origin: 'auto.http.react_router.action',
225225
});
226226
});

dev-packages/e2e-tests/test-applications/react-router-7-framework-node-20-18/tests/performance/performance.server.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ test.describe('server - performance', () => {
153153
span_id: expect.any(String),
154154
trace_id: expect.any(String),
155155
data: {
156-
'sentry.op': 'function.react-router.loader',
156+
'sentry.op': 'function.react_router.loader',
157157
'sentry.origin': 'auto.http.react_router.server',
158158
},
159159
description: 'Executing Server Loader',
160-
op: 'function.react-router.loader',
160+
op: 'function.react_router.loader',
161161
origin: 'auto.http.react_router.server',
162162
parent_span_id: expect.any(String),
163163
start_timestamp: expect.any(Number),
@@ -213,11 +213,11 @@ test.describe('server - performance', () => {
213213
span_id: expect.any(String),
214214
trace_id: expect.any(String),
215215
data: {
216-
'sentry.op': 'function.react-router.action',
216+
'sentry.op': 'function.react_router.action',
217217
'sentry.origin': 'auto.http.react_router.server',
218218
},
219219
description: 'Executing Server Action',
220-
op: 'function.react-router.action',
220+
op: 'function.react_router.action',
221221
origin: 'auto.http.react_router.server',
222222
parent_span_id: expect.any(String),
223223
start_timestamp: expect.any(Number),

dev-packages/e2e-tests/test-applications/react-router-7-framework/tests/performance/performance.server.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ test.describe('server - performance', () => {
122122
trace_id: expect.any(String),
123123
data: {
124124
'sentry.origin': 'auto.http.react_router',
125-
'sentry.op': 'function.react-router.loader',
125+
'sentry.op': 'function.react_router.loader',
126126
},
127127
description: 'Executing Server Loader',
128128
parent_span_id: expect.any(String),
129129
start_timestamp: expect.any(Number),
130130
timestamp: expect.any(Number),
131131
status: 'ok',
132-
op: 'function.react-router.loader',
132+
op: 'function.react_router.loader',
133133
origin: 'auto.http.react_router',
134134
});
135135
});
@@ -150,14 +150,14 @@ test.describe('server - performance', () => {
150150
trace_id: expect.any(String),
151151
data: {
152152
'sentry.origin': 'auto.http.react_router',
153-
'sentry.op': 'function.react-router.action',
153+
'sentry.op': 'function.react_router.action',
154154
},
155155
description: 'Executing Server Action',
156156
parent_span_id: expect.any(String),
157157
start_timestamp: expect.any(Number),
158158
timestamp: expect.any(Number),
159159
status: 'ok',
160-
op: 'function.react-router.action',
160+
op: 'function.react_router.action',
161161
origin: 'auto.http.react_router',
162162
});
163163
});

packages/react-router/src/server/instrumentation/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*/
66
export function getOpName(pathName: string, requestMethod: string): string {
77
return isLoaderRequest(pathName, requestMethod)
8-
? 'function.react-router.loader'
8+
? 'function.react_router.loader'
99
: isActionRequest(pathName, requestMethod)
10-
? 'function.react-router.action'
11-
: 'function.react-router';
10+
? 'function.react_router.action'
11+
: 'function.react_router';
1212
}
1313

1414
/**

packages/react-router/src/server/wrapServerAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function wrapServerAction<T>(options: SpanOptions = {}, actionFn: (args:
6767
...options,
6868
attributes: {
6969
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.action',
70-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.action',
70+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.action',
7171
...options.attributes,
7272
},
7373
},

packages/react-router/src/server/wrapServerLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function wrapServerLoader<T>(options: SpanOptions = {}, loaderFn: (args:
6767
...options,
6868
attributes: {
6969
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.loader',
70-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.loader',
70+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.loader',
7171
...options.attributes,
7272
},
7373
},

packages/react-router/test/server/wrapServerAction.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('wrapServerAction', () => {
3131
name: 'Executing Server Action',
3232
attributes: {
3333
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.action',
34-
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.action',
34+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.action',
3535
},
3636
},
3737
expect.any(Function),
@@ -61,7 +61,7 @@ describe('wrapServerAction', () => {
6161
name: 'Custom Action',
6262
attributes: {
6363
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.action',
64-
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.action',
64+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.action',
6565
'sentry.custom': 'value',
6666
},
6767
},

packages/react-router/test/server/wrapServerLoader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('wrapServerLoader', () => {
3131
name: 'Executing Server Loader',
3232
attributes: {
3333
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.loader',
34-
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.loader',
34+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.loader',
3535
},
3636
},
3737
expect.any(Function),
@@ -61,7 +61,7 @@ describe('wrapServerLoader', () => {
6161
name: 'Custom Loader',
6262
attributes: {
6363
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.loader',
64-
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react-router.loader',
64+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function.react_router.loader',
6565
'sentry.custom': 'value',
6666
},
6767
},

0 commit comments

Comments
 (0)