
OpenTelemetry JS Has a Free API: Here's How to Instrument Your Node.js Apps
What is OpenTelemetry? OpenTelemetry (OTel) is the industry standard for observability. It provides a single set of APIs, SDKs, and tools to collect traces, metrics, and logs from your applications. The JavaScript SDK is completely free and open source — and it works with every major observability platform: Jaeger, Grafana, Datadog, New Relic, Honeycomb, and more. Quick Setup npm install @opentelemetry/sdk-node \ @opentelemetry/auto-instrumentations-node \ @opentelemetry/exporter-trace-otlp-http Auto-Instrument Everything // tracing.js — run BEFORE your app const { NodeSDK } = require ( " @opentelemetry/sdk-node " ); const { getNodeAutoInstrumentations } = require ( " @opentelemetry/auto-instrumentations-node " ); const { OTLPTraceExporter } = require ( " @opentelemetry/exporter-trace-otlp-http " ); const sdk = new NodeSDK ({ traceExporter : new OTLPTraceExporter ({ url : " http://localhost:4318/v1/traces " , }), instrumentations : [ getNodeAutoInstrumentations ()], serviceName : " my-
Continue reading on Dev.to JavaScript
Opens in a new tab


