OpenTelemetry JavaScript SDK
Official OpenTelemetry JavaScript/TypeScript SDK for distributed tracing, metrics, and logging. Implements the CNCF OpenTelemetry standard for instrumentation. Auto-instruments popular Node.js frameworks (Express, Fastify, NestJS, HTTP, gRPC, PostgreSQL, Redis, MongoDB) via @opentelemetry/auto-instrumentations-node. Exports telemetry to any OTLP-compatible backend (Jaeger, Zipkin, Grafana Tempo, Honeycomb, Datadog, Dynatrace, etc.) through standardized exporters.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
TLS configurable for OTLP exporters. API keys in headers for cloud backends. No PII filtering — trace data may include request parameters; implement span processors for PII scrubbing.
⚡ Reliability
Best When
You're building microservices or agent systems that need distributed tracing, and want vendor-neutral instrumentation that works with any observability backend.
Avoid When
You're on a single service and want quick setup — vendor-specific APM agents (Datadog, New Relic) auto-instrument with less configuration than OTel.
Use Cases
- • Auto-instrument Node.js Express/Fastify APIs with distributed tracing without changing application code using @opentelemetry/auto-instrumentations-node
- • Create custom spans for business-logic operations (LLM calls, agent steps) with manual instrumentation API
- • Export metrics (request count, latency histograms, error rates) to Prometheus or Grafana from Node.js services
- • Propagate trace context across microservices via W3C Trace Context headers for end-to-end distributed trace correlation
- • Instrument agent LLM calls and tool invocations with custom spans for visibility into agent execution flows
Not For
- • Error tracking with stack traces — use Sentry for exception capture with rich context; OTEL traces don't capture the same exception detail
- • Log aggregation — OTEL logs are still experimental in JavaScript SDK; use pino/winston with log aggregation for structured logs
- • Simple single-service monitoring — for basic metrics on a single service, simpler tools (prom-client, Datadog APM) may be lower overhead
Interface
Authentication
Authentication depends on the OTLP exporter target. OTLP exporters support headers for API keys (Honeycomb, Grafana Cloud). Direct OTLP to local collector needs no auth. Configure via OTEL_EXPORTER_OTLP_HEADERS env var.
Pricing
Apache 2.0 licensed SDK is free. Observability backends (Jaeger, Zipkin self-hosted: free; Honeycomb, Grafana Cloud, Datadog: paid).
Agent Metadata
Known Gotchas
- ⚠ SDK registration must happen BEFORE importing instrumented libraries — setup code using register() must be the FIRST import in the entry point, not after framework imports
- ⚠ Auto-instrumentation via @opentelemetry/auto-instrumentations-node instruments everything by default — disable specific instrumentations for libraries you don't want to trace to reduce noise
- ⚠ Exporter failures are silent by default — OTEL is designed to not impact application; enable debug logging to see export errors: DiagConsoleLogger with DiagLogLevel.DEBUG
- ⚠ Context propagation must be configured consistently across all services — mixing W3C Trace Context and B3 propagators causes trace correlation breaks
- ⚠ Custom spans must be ended — span.end() must always be called in a finally block; unclosed spans are never exported and leak memory
- ⚠ W3C Trace Context header name is 'traceparent', not 'x-trace-id' — services checking for 'x-trace-id' will miss OTEL trace propagation; update gateway/proxy header configs
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for OpenTelemetry JavaScript SDK.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.