Skip to content

Commit

Permalink
Add Next.js version to trace (#30881)
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Nov 3, 2021
1 parent 5f72810 commit 1ddd8de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/next/build/index.ts
Expand Up @@ -132,7 +132,9 @@ export default async function build(
debugOutput = false,
runLint = true
): Promise<void> {
const nextBuildSpan = trace('next-build')
const nextBuildSpan = trace('next-build', undefined, {
attrs: { version: process.env.__NEXT_VERSION },
})

const buildResult = await nextBuildSpan.traceAsyncFn(async () => {
// attempt to load global env values so they are available in next.config.js
Expand Down
4 changes: 3 additions & 1 deletion packages/next/server/dev/hot-reloader.ts
Expand Up @@ -189,7 +189,9 @@ export default class HotReloader {
)
this.previewProps = previewProps
this.rewrites = rewrites
this.hotReloaderSpan = trace('hot-reloader')
this.hotReloaderSpan = trace('hot-reloader', undefined, {
attrs: { version: process.env.__NEXT_VERSION },
})
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
// of the current `next dev` invocation.
this.hotReloaderSpan.stop()
Expand Down

0 comments on commit 1ddd8de

Please sign in to comment.