123DevOps··1 min read

Observability with OpenTelemetry: where to start

Traces, metrics, and logs under one open standard. Learn how to instrument your first application and ship data through the Collector.

Observability

OpenTelemetry (OTel) has become the industry standard for collecting telemetry without getting locked into a vendor. You instrument once and can send the data to Grafana, Datadog, Honeycomb, Elastic, or any OTLP-compatible backend.

The three signals

  • Traces: the path of a request across services.
  • Metrics: numbers aggregated over time (latency, error rate, CPU usage).
  • Logs: discrete events — ideally correlated with the trace_id.

Automatic instrumentation

For many languages, you can get started without changing any code. In Node.js:

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

The role of the Collector

The Collector receives, processes, and exports telemetry. It decouples your application from the backend:

receivers:
  otlp:
    protocols:
      grpc:
      http:
processors:
  batch:
exporters:
  otlphttp:
    endpoint: https://your-backend.example.com
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp]

Keeping costs in check

Telemetry grows fast. Use sampling (for example, tail sampling to keep 100% of errors and a fraction of successful requests) and avoid high-cardinality attributes, such as user IDs, in metrics.

Start with one critical service, prove the value of traces during a real incident, and only then expand.

Get updates on new posts and stay in the loop!