Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
What is the primary benefit of OpenTelemetry being a vendor-neutral standard, compared to instrumenting directly with a specific monitoring vendor's SDK?
💻 Code Challenge | +75 XP
Set up a tracing.js file that initializes an OpenTelemetry NodeSDK with auto-instrumentation and an OTLP exporter, loaded via --require before the main application entry point.
After adding OpenTelemetry auto-instrumentation, Express routes are not showing up as spans in the tracing backend at all. Reorder the steps to diagnose the likely cause.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Importing and initializing the OpenTelemetry SDK as a regular import inside the main application file
// Wrong: SDK starts too late, after Express is already imported
import express from "express";
import { sdk } from "./tracing.js";
sdk.start();
// Correct: node --require ./tracing.js server.js
// tracing.js runs and patches libraries BEFORE server.js imports themThe Solution //
Auto-instrumentation works by patching library internals (like Express or the HTTP module) at the moment they're first imported — if the SDK initializes after those libraries are already imported elsewhere in the module graph, the patching never applies and no spans are generated. The SDK must be loaded via --require (or an equivalent preload mechanism) before any other application code runs.
The Error //
Assuming OpenTelemetry auto-instrumentation captures custom business logic automatically
// Not automatically traced — pure business logic
function calculatePricing(order) { /* ... */ }
// Requires an explicit manual span for visibility
const span = tracer.startSpan("calculatePricing");
try { return calculatePricing(order); } finally { span.end(); }The Solution //
Auto-instrumentation only creates spans for supported libraries it knows how to patch — HTTP calls, common database drivers, popular frameworks. Custom business logic (like a complex pricing calculation) is invisible to auto-instrumentation entirely and requires an explicit manual span to be traced.