Skip to content

Commit aa91899

Browse files
committed
Update the name
1 parent 8bd83d7 commit aa91899

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/next/src/server/base-server.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,15 +909,22 @@ export default abstract class Server<
909909

910910
const route = rootSpanAttributes.get('next.route')
911911
if (route) {
912-
const name = `${method} ${route}`
912+
const name = isRSCRequest
913+
? `${method} ${route} (partial render tree)`
914+
: `${method} ${route}`
915+
913916
span.setAttributes({
914917
'next.route': route,
915918
'http.route': route,
916919
'next.span_name': name,
917920
})
918921
span.updateName(name)
919922
} else {
920-
span.updateName(`${method} ${req.url}`)
923+
span.updateName(
924+
isRSCRequest
925+
? `${method} ${req.url} (partial render tree)`
926+
: `${method} ${req.url}`
927+
)
921928
}
922929
})
923930
)

test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,16 @@ describe('opentelemetry', () => {
367367
runtime: 'nodejs',
368368
traceId: env.span.traceId,
369369
parentId: env.span.rootParentId,
370-
name: 'GET /app/[param]/rsc-fetch',
370+
name: 'GET /app/[param]/rsc-fetch (partial render tree)',
371371
attributes: {
372372
'http.method': 'GET',
373373
'http.route': '/app/[param]/rsc-fetch',
374374
'http.status_code': 200,
375375
'http.target': '/app/param/rsc-fetch',
376376
'next.route': '/app/[param]/rsc-fetch',
377377
'next.rsc': true,
378-
'next.span_name': 'GET /app/[param]/rsc-fetch',
378+
'next.span_name':
379+
'GET /app/[param]/rsc-fetch (partial render tree)',
379380
'next.span_type': 'BaseServer.handleRequest',
380381
},
381382
kind: 1,

0 commit comments

Comments
 (0)