Skip to content

Commit 04f4b3a

Browse files
committed
OTel: use srcPage for templates when next.route is unavailable
1 parent f982260 commit 04f4b3a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

packages/next/src/build/templates/app-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ export async function handler(
459459
})
460460
span.updateName(name)
461461
} else {
462-
span.updateName(`${method}`)
462+
span.updateName(`${method} ${srcPage}`)
463463
}
464464
})
465465
}
@@ -1393,7 +1393,7 @@ export async function handler(
13931393
tracer.trace(
13941394
BaseServerSpan.handleRequest,
13951395
{
1396-
spanName: `${method}`,
1396+
spanName: `${method} ${srcPage}`,
13971397
kind: SpanKind.SERVER,
13981398
attributes: {
13991399
'http.method': method,

packages/next/src/build/templates/app-route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export async function handler(
257257
})
258258
span.updateName(name)
259259
} else {
260-
span.updateName(`${method}`)
260+
span.updateName(`${method} ${srcPage}`)
261261
}
262262
})
263263
}
@@ -454,7 +454,7 @@ export async function handler(
454454
tracer.trace(
455455
BaseServerSpan.handleRequest,
456456
{
457-
spanName: `${method}`,
457+
spanName: `${method} ${srcPage}`,
458458
kind: SpanKind.SERVER,
459459
attributes: {
460460
'http.method': method,

packages/next/src/build/templates/edge-ssr-app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ async function requestHandler(
316316
})
317317
span.updateName(name)
318318
} else {
319-
span.updateName(`${req.method}`)
319+
span.updateName(`${req.method} ${srcPage}`)
320320
}
321321
})
322322

@@ -339,7 +339,7 @@ async function requestHandler(
339339
tracer.trace(
340340
BaseServerSpan.handleRequest,
341341
{
342-
spanName: `${req.method}`,
342+
spanName: `${req.method} ${srcPage}`,
343343
kind: SpanKind.SERVER,
344344
attributes: {
345345
'http.method': req.method,

packages/next/src/build/templates/edge-ssr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ async function requestHandler(
296296
})
297297
span.updateName(name)
298298
} else {
299-
span.updateName(`${req.method}`)
299+
span.updateName(`${req.method} ${srcPage}`)
300300
}
301301
})
302302

@@ -343,7 +343,7 @@ async function requestHandler(
343343
tracer.trace(
344344
BaseServerSpan.handleRequest,
345345
{
346-
spanName: `${req.method}`,
346+
spanName: `${req.method} ${srcPage}`,
347347
kind: SpanKind.SERVER,
348348
attributes: {
349349
'http.method': req.method,

packages/next/src/build/templates/pages-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export async function handler(
133133
})
134134
span.updateName(name)
135135
} else {
136-
span.updateName(`${method}`)
136+
span.updateName(`${method} ${srcPage}`)
137137
}
138138
})
139139

@@ -146,7 +146,7 @@ export async function handler(
146146
tracer.trace(
147147
BaseServerSpan.handleRequest,
148148
{
149-
spanName: `${method}`,
149+
spanName: `${method} ${srcPage}`,
150150
kind: SpanKind.SERVER,
151151
attributes: {
152152
'http.method': method,

0 commit comments

Comments
 (0)