OpenTelemetry Explained: Traces, Metrics and Logs with One Standard

What OpenTelemetry is: APIs, SDKs, the Collector and OTLP; auto vs manual instrumentation; context propagation; and sending data to any backend.

Published December 4, 2026

For years, every observability vendor had its own agents and libraries, so switching tools meant re-instrumenting your code. OpenTelemetry (OTel), a CNCF project, standardises how telemetry is generated and transported. You instrument once with vendor-neutral APIs and send traces, metrics and logs to whichever backend you choose.

The concept

OpenTelemetry has several parts. Language APIs and SDKs (Java, Python, JavaScript, Go, .NET and more) create telemetry. Instrumentation libraries and auto-instrumentation agents capture common operations (HTTP requests, database queries, message queues) without code changes. OTLP is the wire protocol. The OpenTelemetry Collector receives, processes (batching, filtering, redaction, sampling) and exports data to backends.

Context propagation is what makes distributed tracing work: when service A calls service B, the trace ID and span ID travel in headers (W3C traceparent), so B's spans join the same trace. Semantic conventions standardise attribute names (http.request.method, db.system) so dashboards and queries work consistently across languages and vendors.

The OpenTelemetry pipeline

Your servicesOTel SDK + auto-instrumentationOTLPgRPC / HTTPOpenTelemetry Collectorreceive → process → exportBackendsPrometheus, Jaeger/Tempo, Loki, vendors
Instrument once, route anywhere.

Context propagation

FrontendAPIOrders svcDBtraceparent: 00-abc…-01same trace id, new spandb spanrowsresponseresponse
Trace context travels in headers so spans join one trace.

Signals

SignalAnswersExample
TracesWhere did time go in this request?Checkout took 2.4 s, 1.9 s in payments call
MetricsHow is the system behaving overall?p95 latency, error rate, queue depth
LogsWhat exactly happened here?Structured error with trace_id
Profiles (emerging)Which code uses CPU/memory?Continuous profiling linked to traces

Practical examples

Zero-code instrumentation for Node.js

Auto-instrument common libraries and export via OTLP.

npm install @opentelemetry/auto-instrumentations-node @opentelemetry/api
export OTEL_SERVICE_NAME=orders
export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
node --require @opentelemetry/auto-instrumentations-node/register server.js

Manual span with attributes (Python)

Add business context to traces.

from opentelemetry import trace
tracer = trace.get_tracer("orders")

def place_order(cart):
    with tracer.start_as_current_span("place_order") as span:
        span.set_attribute("order.items", len(cart.items))
        span.set_attribute("order.total_paise", cart.total)
        return charge_and_save(cart)

Collector pipeline

Batch, then export traces and metrics to different backends.

receivers:
  otlp: { protocols: { grpc: {}, http: {} } }
processors:
  batch: {}
exporters:
  otlp/tempo: { endpoint: tempo:4317, tls: { insecure: true } }
  prometheusremotewrite: { endpoint: http://prometheus:9090/api/v1/write }
service:
  pipelines:
    traces:  { receivers: [otlp], processors: [batch], exporters: [otlp/tempo] }
    metrics: { receivers: [otlp], processors: [batch], exporters: [prometheusremotewrite] }

Common mistakes

  • Instrumenting with vendor-specific SDKs and getting locked in.
  • Broken context propagation across async queues, producing disconnected traces.
  • High-cardinality attributes (user IDs as metric labels) exploding metric costs.
  • Exporting directly from every service instead of through a Collector.

Key takeaways

  • OpenTelemetry standardises telemetry generation and transport.
  • Auto-instrumentation gets you far; add manual spans for business context.
  • The Collector processes and routes data to any backend.
  • Propagate context everywhere, including message queues.

FAQ

Is OpenTelemetry a backend?

No. It generates and transports telemetry; you still need storage and visualisation backends.

How do I control tracing costs?

Use sampling (head-based in SDKs, tail-based in the Collector) to keep interesting traces like errors and slow requests.

Are OTel logs ready?

Logs support is stable in many languages; a common pattern is structured logs that include trace and span IDs.

More DevOps articles