@@ -233,7 +233,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
233
233
expect ( serverRequestHTTPClientSpan ) . toMatchObject ( {
234
234
op : 'http.client' ,
235
235
origin : 'auto.http.otel.node_fetch' ,
236
- description : 'GET http://localhost:3030/api/user/myUsername123.json' , // todo: parametrize (this is just a span though - no transaction)
236
+ description : 'GET http://localhost:3030/api/user/myUsername123.json' , // http.client does not need to be parametrized
237
237
data : {
238
238
'sentry.op' : 'http.client' ,
239
239
'sentry.origin' : 'auto.http.otel.node_fetch' ,
@@ -262,4 +262,53 @@ test.describe('nested SSR routes (client, server, server request)', () => {
262
262
request : { url : expect . stringContaining ( '/api/user/myUsername123.json' ) } ,
263
263
} ) ;
264
264
} ) ;
265
+
266
+ test ( 'sends parametrized pageload and server transaction names for catch-all routes' , async ( { page } ) => {
267
+ const clientPageloadTxnPromise = waitForTransaction ( 'astro-5' , txnEvent => {
268
+ return txnEvent ?. transaction ?. startsWith ( '/catchAll/' ) ?? false ;
269
+ } ) ;
270
+
271
+ const serverPageRequestTxnPromise = waitForTransaction ( 'astro-5' , txnEvent => {
272
+ return txnEvent ?. transaction ?. startsWith ( 'GET /catchAll/' ) ?? false ;
273
+ } ) ;
274
+
275
+ await page . goto ( '/catchAll/hell0/whatever-do' ) ;
276
+
277
+ const clientPageloadTxn = await clientPageloadTxnPromise ;
278
+ const serverPageRequestTxn = await serverPageRequestTxnPromise ;
279
+
280
+ expect ( clientPageloadTxn ) . toMatchObject ( {
281
+ transaction : '/catchAll/hell0/whatever-do' , // todo: parametrize to '/catchAll/[...path]'
282
+ transaction_info : { source : 'url' } ,
283
+ contexts : {
284
+ trace : {
285
+ op : 'pageload' ,
286
+ origin : 'auto.pageload.browser' ,
287
+ data : {
288
+ 'sentry.op' : 'pageload' ,
289
+ 'sentry.origin' : 'auto.pageload.browser' ,
290
+ 'sentry.source' : 'url' ,
291
+ } ,
292
+ } ,
293
+ } ,
294
+ } ) ;
295
+
296
+ expect ( serverPageRequestTxn ) . toMatchObject ( {
297
+ transaction : 'GET /catchAll/[path]' ,
298
+ transaction_info : { source : 'route' } ,
299
+ contexts : {
300
+ trace : {
301
+ op : 'http.server' ,
302
+ origin : 'auto.http.astro' ,
303
+ data : {
304
+ 'sentry.op' : 'http.server' ,
305
+ 'sentry.origin' : 'auto.http.astro' ,
306
+ 'sentry.source' : 'route' ,
307
+ url : expect . stringContaining ( '/catchAll/hell0/whatever-do' ) ,
308
+ } ,
309
+ } ,
310
+ } ,
311
+ request : { url : expect . stringContaining ( '/catchAll/hell0/whatever-do' ) } ,
312
+ } ) ;
313
+ } ) ;
265
314
} ) ;
0 commit comments