Observability

OpenTelemetry and Observability: A Practical Guide

Most teams already have monitoring. They know when a server is down. What they often cannot answer quickly is why a request was slow for one customer, or which change made error rates rise. That gap is what observability closes, and OpenTelemetry has become the standard way to close it without locking yourself into one vendor.

This guide covers how I approach observability on AWS and Kubernetes: what to collect, how OpenTelemetry fits, and how to keep the result useful and affordable.

Monitoring and observability

Monitoring tells you that something is wrong, using checks and thresholds you defined in advance. Observability lets you ask new questions about a running system without shipping new code, because the system emits enough detail about its own behavior.

In practice you need both. Monitoring pages you. Observability helps you find the cause.

The three signals

Signal Answers Typical tools
Metrics How much, how often, how fast, over time Prometheus, Grafana
Logs What happened, in detail, at a moment in time Loki, Elasticsearch (ELK)
Traces Where time went across services for one request Jaeger, Grafana Tempo, New Relic

Each signal is useful alone. The value multiplies when they are connected, for example by including a trace ID in every log line so that you can jump from a slow trace to the logs of that exact request.

What OpenTelemetry provides

OpenTelemetry (OTel) is a vendor-neutral, open standard for producing and moving telemetry. It has four parts that matter in practice:

  • APIs and SDKs for most languages, used inside your application.
  • Auto-instrumentation that adds traces and metrics for common frameworks and libraries without code changes.
  • OTLP, a single protocol for sending metrics, logs and traces.
  • The Collector, a standalone service that receives, processes and exports telemetry.

The key benefit is decoupling. Applications emit OTLP once. Where the data goes, whether Prometheus, Loki, a tracing backend or a managed platform such as New Relic, becomes a Collector configuration change instead of a code change.

A reference architecture

OpenTelemetry pipeline from applications and hosts through the Collector to Prometheus, Loki, a tracing backend and Grafana OpenTelemetry pipeline from applications and hosts through the Collector to Prometheus, Loki, a tracing backend and Grafana

A common, maintainable layout:

  1. Applications send OTLP to a local or cluster-level Collector.
  2. The Collector adds resource attributes such as environment and cluster, batches the data and applies limits.
  3. Metrics go to Prometheus, logs to Loki and traces to a tracing backend.
  4. Grafana reads from all three, and alert rules route to the on-call contact.

On Kubernetes, a Collector runs either as a DaemonSet (an agent on every node) or as a Deployment (a gateway). Many setups use both: agents collect from the node and forward to a gateway that handles processing and export.

A minimal Collector configuration

This example receives OTLP, protects the Collector from overload, batches data and exposes metrics for Prometheus to scrape. Adjust endpoints for your environment.

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 75
    spike_limit_percentage: 20
  resource:
    attributes:
      - key: deployment.environment
        value: production
        action: upsert
  batch:

exporters:
  prometheus:
    endpoint: 0.0.0.0:8889
  otlphttp/traces:
    endpoint: http://tracing-backend:4318
  otlphttp/logs:
    endpoint: http://loki:3100/otlp

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [memory_limiter, resource, batch]
      exporters: [prometheus]
    traces:
      receivers: [otlp]
      processors: [memory_limiter, resource, batch]
      exporters: [otlphttp/traces]
    logs:
      receivers: [otlp]
      processors: [memory_limiter, resource, batch]
      exporters: [otlphttp/logs]

Loki accepts OTLP logs natively from version 3. On older versions, use a log shipper such as Promtail or Grafana Alloy instead. Always keep memory_limiter first in each pipeline.

Instrumenting applications

Start with auto-instrumentation, then add manual spans where they matter.

For a Python service, auto-instrumentation looks like this:

pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install

export OTEL_SERVICE_NAME=checkout-api
export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
opentelemetry-instrument python app.py

Auto-instrumentation gives you request traces, database calls and outbound HTTP calls. Add manual spans around business operations, such as “calculate price” or “send invoice”, where the generic data is not specific enough.

Two habits make the data much more useful:

  • Set a consistent service.name and deployment.environment on every service.
  • Put the trace ID in application logs so that logs and traces link together.

Sampling and cost control

Telemetry volume, not tooling, is what makes observability expensive. Control it early.

  • Sample traces. Keep all errors and slow requests, and a small percentage of normal ones. Tail-based sampling in the Collector can do this, at the cost of more memory.
  • Watch metric cardinality. A label with unbounded values, such as a user ID or full URL, can create millions of time series. Use route templates, not raw paths.
  • Set log retention deliberately. Keep recent logs searchable, and move or delete older ones. See the AWS cost optimization guide for retention examples.
  • Drop noise at the Collector. Health-check requests and debug logs rarely justify their storage cost.

Alerts worth waking up for

Alert on symptoms that users feel, not on every internal metric.

  • Good alerts: error rate above the agreed level, latency above the objective, a queue that is not draining, a certificate about to expire.
  • Poor alerts: CPU at 80 percent on one node, a single pod restart, disk at 70 percent with weeks of headroom.

Tie alerts to service level objectives (SLOs) where you can, and put a runbook link in every alert. Review alerts monthly and delete the ones nobody acts on. Alert fatigue is a reliability problem, not just an annoyance.

A staged rollout

You do not need everything at once.

  1. Week 1. Deploy the Collector, enable auto-instrumentation on the busiest service, and build one dashboard answering the question your team asks most during incidents.
  2. Weeks 2 to 3. Centralize logs, link traces to logs, and replace the noisiest alerts with symptom-based ones.
  3. Month 2. Add SLOs, extend instrumentation to remaining services, and tune sampling and retention against actual cost.

Common mistakes

  • Collecting everything and deciding what matters later.
  • Dashboards built for the team instead of with the team.
  • No consistent naming, so the same service appears under three names.
  • Treating observability as a tool purchase instead of a practice.
  • Ignoring the cost of high-cardinality metrics until the bill arrives.

Need help?

I design and implement observability stacks with OpenTelemetry, Prometheus, Grafana, Loki and New Relic, and tune alerting to cut noise. See monitoring and observability consulting or site reliability engineering, or discuss your project.

Related articles

Related services

Discuss your infrastructure with a senior engineer

Share your goals and current setup. I will respond with sensible next steps.

Talk to a DevOps Engineer