Skip to content

Commit d045755

Browse files
authoredMar 20, 2024
feat: support also x-next-debug-logging to enable server-timing (#359)
1 parent 311fafe commit d045755

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
 

‎src/build/templates/handler-monorepo.tmpl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export default async function (req, context) {
1313
tracing.start()
1414
}
1515

16-
const requestContext = createRequestContext(req.headers.get('x-nf-debug-logging'))
16+
const requestContext = createRequestContext(
17+
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'),
18+
)
1719
const tracer = getTracer()
1820

1921
const handlerResponse = await runWithRequestContext(requestContext, () => {

‎src/build/templates/handler.tmpl.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ export default async function handler(req, context) {
1010
if (process.env.NETLIFY_OTLP_TRACE_EXPORTER_URL) {
1111
tracing.start()
1212
}
13-
14-
const requestContext = createRequestContext(req.headers.get('x-nf-debug-logging'))
13+
const requestContext = createRequestContext(
14+
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'),
15+
)
1516
const tracer = getTracer()
1617

1718
const handlerResponse = await runWithRequestContext(requestContext, () => {

0 commit comments

Comments
 (0)
Please sign in to comment.