OpenTelemetry Guide 2026: Getting Started with OTel
The practical guide to OpenTelemetry — instrument your app with traces, metrics, and logs, set up the OTel Collector, and pick the right backend.
⚡ What is OpenTelemetry?
OpenTelemetry (OTel) is the CNCF standard for observability instrumentation. It lets you instrument your code once and send telemetry data — traces, metrics, and logs — to any backend. No vendor lock-in. Works with Datadog, Grafana, Jaeger, Honeycomb, New Relic, and 50+ others.
OTel Signal Types
Distributed request journey across services
Use case: Debugging latency, finding bottlenecks in microservices
Numeric time-series measurements (counters, histograms)
Use case: Dashboards, alerting, SLO/SLI tracking
Structured and unstructured event records
Use case: Debug context, audit trails, error detail
Context propagation across service boundaries
Use case: Passing user IDs, request IDs through traces
Getting Started: Node.js Auto-Instrumentation
The fastest way to add OTel to an existing Node.js/Express app — zero code changes required:
1. Install dependencies
npm install \ @opentelemetry/sdk-node \ @opentelemetry/auto-instrumentations-node \ @opentelemetry/exporter-otlp-http
2. Create tracing.js
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-otlp-http');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const sdk = new NodeSDK({
traceExporter: new OTLPTraceExporter({
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
}),
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();
console.log('OpenTelemetry initialized');3. Start your app with OTel
OTEL_SERVICE_NAME=my-api \ OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway.your-backend.com \ node --require ./tracing.js app.js
The auto-instrumentation package automatically instruments HTTP requests, Express routes, PostgreSQL/MySQL, Redis, gRPC, and more — without modifying your application code.
OTel Collector: Should You Use It?
✅ Use the Collector when...
- • Multiple services sending telemetry
- • Need to filter/transform data before export
- • Running Kubernetes (deploy as DaemonSet)
- • Sending to multiple backends simultaneously
- • Need buffering and retry on backend failure
⚡ Skip the Collector when...
- • Single service, prototype or dev environment
- • Backend supports direct OTLP (Grafana Cloud, Honeycomb)
- • Simplicity is more important than flexibility
- • Getting started — add the Collector later
# Minimal OTel Collector config (otel-collector-config.yaml)
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
timeout: 1s
send_batch_size: 1024
exporters:
otlphttp/grafana:
endpoint: https://otlp-gateway-prod-us-central-0.grafana.net/otlp
headers:
authorization: Basic ${GRAFANA_OTLP_TOKEN}
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/grafana]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/grafana]OTel Backend Comparison
| Backend | Cost | Signals | Best For |
|---|---|---|---|
| Grafana Cloud | Free → $8/mo | Traces + Metrics + Logs | Best free starting point |
| Jaeger (self-hosted) | Free | Traces only | Simple trace debugging |
| Honeycomb | Free → $130/mo | Traces + Metrics | Best trace UX/querying |
| Better Stack | $25/mo | Logs + Metrics + Uptime | All-in-one observability |
| Datadog | $15-23/host/mo | Traces + Metrics + Logs | Enterprise, best UX |
Frequently Asked Questions
What is OpenTelemetry (OTel)?
OpenTelemetry (OTel) is a CNCF open-source observability framework that provides standardized APIs, SDKs, and tools for collecting telemetry data — traces, metrics, and logs — from your applications and infrastructure. It is vendor-neutral, meaning you instrument your code once and can send data to any backend: Jaeger, Grafana Tempo, Datadog, New Relic, Honeycomb, and more. OTel has become the industry standard for distributed tracing since 2021.
What is the difference between OpenTelemetry and Prometheus?
OpenTelemetry and Prometheus serve different primary purposes. Prometheus is a metrics collection system with its own data model (time series), scrape protocol, and query language (PromQL). OpenTelemetry is a broader instrumentation framework that handles traces, metrics, AND logs in one unified SDK. OTel can export metrics in Prometheus format (via the OTel Collector), so they are complementary: many teams use OTel for instrumentation and Prometheus as a metrics backend. For new projects, start with OTel — it gives you traces, metrics, and logs from day one.
How do I get started with OpenTelemetry in Node.js?
To instrument a Node.js app with OTel: (1) npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node @opentelemetry/exporter-otlp-http, (2) Create a tracing.js file that initializes the NodeSDK with your exporter, (3) Require it before your app: node --require ./tracing.js app.js, (4) Configure OTEL_EXPORTER_OTLP_ENDPOINT env var to point to your OTel Collector or backend. The auto-instrumentation package handles HTTP, Express, gRPC, and database calls automatically without code changes.
What is the OpenTelemetry Collector and do I need it?
The OpenTelemetry Collector is an optional agent/proxy that receives, processes, and exports telemetry data. You don't need it to get started — you can export directly from your app to a backend like Grafana Cloud or Jaeger. However, for production you should use the Collector because: (1) It buffers telemetry to handle backend outages, (2) It transforms and filters data before export, (3) It decouples your application from the backend — change backends by updating the Collector config, not your code, (4) It adds host/infrastructure metrics without app instrumentation.
Which OpenTelemetry backend should I use?
The best OTel backend depends on your use case: (1) Grafana Cloud — free tier, managed Tempo (traces), Loki (logs), Mimir (metrics), strong OTel support, (2) Jaeger — open-source, self-hosted, traces only, great for smaller teams, (3) Honeycomb — excellent UX for traces, usage-based pricing, loved by platform engineering teams, (4) Better Stack — managed solution with OTel integration, great for uptime + traces together, (5) Datadog / New Relic — enterprise with best-in-class correlation but high cost. For new OTel adopters, Grafana Cloud's free tier is the most practical starting point.
Related Guides
📡 Monitor your APIs — know when they go down before your users do
Better Stack checks uptime every 30 seconds with instant Slack, email & SMS alerts. Free tier available.
Affiliate link — we may earn a commission at no extra cost to you