Instrumentation Hook

+15 Mana ✨

Next.js provides an instrumentation.ts (or .js) file to integrate monitoring tools like OpenTelemetry.

This file exports a register function that is called once when a new Next.js server instance starts.

ts
export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    await import('./instrumentation-node')
  }
}
✓ Completed