Pre-export trace diagnostics
Catch the exact hop that dropped your trace.
A tiny Node.js test helper for proving context lineage across queues, callbacks, streams, timers, and framework edges—before misleading spans reach your backend.
npm i -D trace-context-probe
- No SDK internals
- Zero runtime dependencies
- No payload capture
Executable proof
Five ways context disappears. Five exact answers.
This local simulation runs the same comparison engine as the npm package. Each fixture breaks a different boundary and checks whether the first reported name is exact.
Run the fixture suite to inspect each first broken boundary.
Observe, don’t interfere
One expectation. One observation. No patched internals.
Mark the known-good span
Capture only its public trace ID and span ID.
Wrap the boundary
The wrapper observes when the real callback runs. It never binds context for you.
Export the first tear
Get JSON for CI, DOT for tooling, or a standalone HTML graph for a bug report.
60-second setup
Put the proof beside the boundary.
The stable core accepts your own context reader. The optional adapter uses only OpenTelemetry’s public API.
See complete usage and CLI exitsimport { createOpenTelemetryProbe } from
'trace-context-probe/opentelemetry';
const probe = createOpenTelemetryProbe({
name: 'checkout-worker'
});
const request = probe.mark('http.request');
queue.consume(probe.wrap(
'queue.consume', { expect: request }, handler
));
const report = probe.report();
// report.firstBrokenBoundary?.name
Explicit compatibility
Small surface. Boring dependencies.
Use the core with any tracer, or add the optional public OpenTelemetry adapter. Exporters and vendors stay out of the diagnostic path.
| Component | Supported |
|---|---|
| Node.js | 18 · 20 · 22 · 24 |
| TypeScript | 5.2 and newer |
| OpenTelemetry API | 1.7–1.x (optional) |
| Package formats | ESM · CommonJS · .d.ts |
Vendor-neutral · MIT licensed
Fix the first break.
Trust everything after it.
npm i -D trace-context-probe