Unverified Commit 2912b107 authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

OTel: use `srcPage` for templates when `next.route` is unavailable (#83911)

### Why?

srcPage is relatively lower cardinality, so use this if available.

In the base-server handleRequest, it is the entry of the request, so no
low-cardinality target is available.


https://github.com/vercel/next.js/pull/75416/files#diff-6f4291cc2bfc5073fdca12a014011769e840ee68583db1468acef075f037015aR891
parent f2721210
......@@ -459,7 +459,7 @@ export async function handler(
})
span.updateName(name)
} else {
span.updateName(`${method}`)
span.updateName(`${method} ${srcPage}`)
}
})
}
......@@ -1393,7 +1393,7 @@ export async function handler(
tracer.trace(
BaseServerSpan.handleRequest,
{
spanName: `${method}`,
spanName: `${method} ${srcPage}`,
kind: SpanKind.SERVER,
attributes: {
'http.method': method,
......
......@@ -257,7 +257,7 @@ export async function handler(
})
span.updateName(name)
} else {
span.updateName(`${method}`)
span.updateName(`${method} ${srcPage}`)
}
})
}
......@@ -454,7 +454,7 @@ export async function handler(
tracer.trace(
BaseServerSpan.handleRequest,
{
spanName: `${method}`,
spanName: `${method} ${srcPage}`,
kind: SpanKind.SERVER,
attributes: {
'http.method': method,
......
......@@ -316,7 +316,7 @@ async function requestHandler(
})
span.updateName(name)
} else {
span.updateName(`${req.method}`)
span.updateName(`${req.method} ${srcPage}`)
}
})
......@@ -339,7 +339,7 @@ async function requestHandler(
tracer.trace(
BaseServerSpan.handleRequest,
{
spanName: `${req.method}`,
spanName: `${req.method} ${srcPage}`,
kind: SpanKind.SERVER,
attributes: {
'http.method': req.method,
......
......@@ -296,7 +296,7 @@ async function requestHandler(
})
span.updateName(name)
} else {
span.updateName(`${req.method}`)
span.updateName(`${req.method} ${srcPage}`)
}
})
......@@ -343,7 +343,7 @@ async function requestHandler(
tracer.trace(
BaseServerSpan.handleRequest,
{
spanName: `${req.method}`,
spanName: `${req.method} ${srcPage}`,
kind: SpanKind.SERVER,
attributes: {
'http.method': req.method,
......
......@@ -133,7 +133,7 @@ export async function handler(
})
span.updateName(name)
} else {
span.updateName(`${method}`)
span.updateName(`${method} ${srcPage}`)
}
})
......@@ -146,7 +146,7 @@ export async function handler(
tracer.trace(
BaseServerSpan.handleRequest,
{
spanName: `${method}`,
spanName: `${method} ${srcPage}`,
kind: SpanKind.SERVER,
attributes: {
'http.method': method,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment