Skip to main content
InterviewHubPRO
Section Overview
Q46

Question 46 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

92%
Next.js & App Router (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

OpenTelemetry Integration in Next.js (`instrumentation.ts`).

senior LevelCode ExampleSystem Design

In Simple Words: Next.js supports native OpenTelemetry distributed tracing:

  • Create instrumentation.ts in the project root:
    typescript
    export async function register() {
      if (process.env.NEXT_RUNTIME === 'nodejs') {
        await import('./tracing.node');
      }
    }
    
  • Automatically exports spans for route handlers, RSC rendering, and database queries directly to Jaeger, Datadog, or Grafana Tempo.