A Local Lab for Debugging OpenTelemetry Collector Pipelines
DebugGuide6 min read

A Local Lab for Debugging OpenTelemetry Collector Pipelines

By Nicolas Narbais

Use Docker Compose to prove that traces, metrics, and logs pass through each OpenTelemetry Collector pipeline before you debug the backend.

Last updated on

When telemetry disappears, start at the first hop you control.

Your backend might be broken, or the trace missed the Collector, the metric entered the wrong pipeline, or the log landed in a pipeline with no useful exporter. Each failure needs a different fix.

This Docker Compose lab runs one Collector, on-demand test generators, Jaeger, and Prometheus so you can prove every signal path locally before blaming a production backend.

Warning

Pinned versions: Examples below use Collector Contrib 0.153.0, Prometheus v3.5.3, and Jaeger 1.76.0 (verified May 30, 2026). Check release notes if you run newer versions.

Four signal paths to prove separately

Keep these four paths separate while debugging. The Collector’s own runtime metrics on :8888 are independent from application metrics flowing through the metrics pipeline to :8889.

SignalEntry pointFirst proofFinal proof
TracesOTLP/gRPC :4317debug exporter logsJaeger UI (:16686)
Application metricsOTLP/gRPC :4317debug exporter logsPrometheus :8889 job
LogsOTLP/gRPC :4317debug exporter logsCollector logs
Collector self-metricsCollector runtimelocalhost:8888/metricsPrometheus :8888 job

otel-architecture-schematic-local

Note

Core rule: Prove the Collector receives and exports each signal before you debug the backend.

Build the three lab files

You need Docker and Docker Compose. Create an empty directory with three files:

docker-compose.yml
otelcol-config.yml
prometheus-config.yaml

1. docker-compose.yml

Starts the Collector, Prometheus, and Jaeger. The telemetrygen services stay behind a Compose profile (generate) so you trigger fresh telemetry only when needed. Jaeger’s OTLP ports stay internal to Docker, and the host talks only to the Collector on 4317 and 4318 (Jaeger deployment docs).

services:
  otel-collector:
    image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.153.0
    command: ["--config=/etc/otelcol-contrib/config.yaml"]
    volumes:
      - ./otelcol-config.yml:/etc/otelcol-contrib/config.yaml:ro
    ports:
      - "4317:4317" # OTLP gRPC receiver
      - "4318:4318" # OTLP HTTP receiver
      - "8888:8888" # Collector self-metrics
      - "8889:8889" # Metrics exposed by the prometheus exporter
    depends_on:
      - jaeger

  prometheus:
    image: prom/prometheus:v3.5.3
    command:
      - "--config.file=/etc/prometheus/prometheus.yml"
    volumes:
      - ./prometheus-config.yaml:/etc/prometheus/prometheus.yml:ro
    ports:
      - "9090:9090"
    depends_on:
      - otel-collector

  jaeger:
    image: jaegertracing/all-in-one:1.76.0
    environment:
      COLLECTOR_OTLP_ENABLED: "true"
    ports:
      - "16686:16686" # Jaeger UI
    # Jaeger's OTLP ports stay inside the Compose network.
    # The host only talks to the Collector on 4317 and 4318.

  telemetrygen-traces:
    image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.153.0
    profiles: ["generate"]
    command:
      - traces
      - "--otlp-endpoint=otel-collector:4317"
      - "--otlp-insecure"
      - "--duration=30s"
      - "--rate=2"
    depends_on:
      - otel-collector

  telemetrygen-metrics:
    image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.153.0
    profiles: ["generate"]
    command:
      - metrics
      - "--otlp-endpoint=otel-collector:4317"
      - "--otlp-insecure"
      - "--duration=30s"
      - "--rate=1"
    depends_on:
      - otel-collector

  telemetrygen-logs:
    image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.153.0
    profiles: ["generate"]
    command:
      - logs
      - "--otlp-endpoint=otel-collector:4317"
      - "--otlp-insecure"
      - "--duration=30s"
      - "--rate=2"
    depends_on:
      - otel-collector

2. otelcol-config.yml

Receives OTLP, prints every signal with debug, exports traces to Jaeger, exposes pipeline metrics on :8889, and serves self-metrics on :8888. Defining a component does nothing until you attach it under service.pipelines (Collector configuration).

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  memory_limiter:
    check_interval: 1s
    limit_mib: 256
    spike_limit_mib: 64

  batch:

exporters:
  debug:
    verbosity: normal

  otlp/jaeger:
    endpoint: jaeger:4317
    tls:
      insecure: true

  prometheus:
    endpoint: 0.0.0.0:8889
    resource_to_telemetry_conversion:
      enabled: true

service:
  telemetry:
    metrics:
      level: normal
      readers:
        - pull:
            exporter:
              prometheus:
                host: 0.0.0.0
                port: 8888

  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [debug, otlp/jaeger]

    metrics:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [debug, prometheus]

    logs:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [debug]

3. prometheus-config.yaml

Scrapes two targets: :8888 for Collector runtime metrics and :8889 for pipeline metrics. Prometheus can accept OTLP push directly with --web.enable-otlp-receiver (Prometheus OpenTelemetry guide), but pull mode keeps both local metric paths visually distinct.

global:
  scrape_interval: 10s

scrape_configs:
  - job_name: otel-collector-self
    static_configs:
      - targets: ["otel-collector:8888"]

  - job_name: otel-collector-application-metrics
    static_configs:
      - targets: ["otel-collector:8889"]

Start the lab and send test telemetry

Bring up the stack, verify the containers, and open Prometheus (http://localhost:9090) and Jaeger (http://localhost:16686):

docker compose up -d
docker compose ps

The stack starts empty. Generate traces, metrics, and logs over OTLP/gRPC (:4317) using telemetrygen:

docker compose run --rm telemetrygen-traces
docker compose run --rm telemetrygen-metrics
docker compose run --rm telemetrygen-logs

If your application SDK sends OTLP over HTTP, verify port 4318 explicitly so you catch gRPC/HTTP port mismatches early:

docker compose run --rm telemetrygen-traces \
  traces \
  --otlp-http \
  --otlp-endpoint=otel-collector:4318 \
  --otlp-insecure \
  --traces=3

Verify each hop in order

1. Prove the Collector received each signal

Stream the Collector logs:

docker compose logs -f otel-collector

The debug exporter proves a signal entered its pipeline and reached its first exporter, not that a downstream backend received it. Look for these record headers (exact fields vary by version and verbosity):

# Traces
ResourceSpans #0
ScopeSpans #0
Span #0
Name: lets-go

# Metrics
ResourceMetrics #0
ScopeMetrics #0
Metric #0
Name: gen

# Logs
ResourceLogs #0
ScopeLogs #0
LogRecord #0
Body: log

If the logs stay silent, check four things:

  • Endpoint: telemetrygen targets otel-collector:4317 (inside Docker, localhost points to the generator container itself).
  • Receiver wiring: otlp is listed in the target pipeline under service.pipelines.
  • Exporter wiring: debug is attached to that same pipeline.
  • Protocol match: gRPC goes to 4317; HTTP goes to 4318 (OTLP specification).

2. Prove trace export in Jaeger

Open http://localhost:16686, select the telemetrygen service, and search for traces.

If Jaeger is empty while debug shows spans, verify that otlp/jaeger is in the traces pipeline and that Jaeger has COLLECTOR_OTLP_ENABLED=true. The Collector reaches Jaeger over Docker DNS at jaeger:4317, so Jaeger’s OTLP port does not need host publishing.

3. Prove application metrics in Prometheus

Query the :8889 scrape job in Prometheus (http://localhost:9090):

{job="otel-collector-application-metrics"}

Exact metric names can change across telemetrygen versions, but recent series should appear as soon as Prometheus scrapes :8889.

4. Prove Collector self-metrics

Check the Collector’s own /metrics endpoint from your host to confirm it is accepting and exporting data without errors:

curl http://localhost:8888/metrics

Expect otelcol_* series such as:

otelcol_receiver_accepted_spans_total{receiver="otlp",transport="grpc"} 12
otelcol_exporter_sent_spans_total{exporter="debug"} 12

In Prometheus, query by prefix so version-specific metric renames do not hide failures:

{job="otel-collector-self", __name__=~"otelcol_.*"}
{job="otel-collector-self", __name__=~"otelcol_receiver_.*"}
{job="otel-collector-self", __name__=~"otelcol_exporter_.*"}

Match the symptom to the first boundary that can explain it:

SymptomFirst place to check
No debug outputGenerator endpoint, otlp receiver, pipeline wiring, port 4317/4318
debug shows spans, Jaeger is emptyotlp/jaeger exporter config, COLLECTOR_OTLP_ENABLED=true
Self-metrics work, app metrics are emptytelemetrygen-metrics, metrics pipeline, :8889 scrape job
App metrics work, self-metrics are emptyservice.telemetry.metrics block, :8888 port binding
Works inside Docker, fails from hostPublished ports: in docker-compose.yml

The lab is proven when Collector logs show ResourceSpans, ResourceMetrics, and ResourceLogs; Jaeger lists telemetrygen traces; both Prometheus jobs return data; and failed-export counters stay at zero.

Export Collector self-metrics in production

In production, replace Prometheus scraping on :8888 with a periodic OTLP reader under service.telemetry.metrics.readers (Collector internal telemetry).

This reader cannot reuse a pipeline exporter like otlp_http/tsuga. Pipeline exporters only process signals moving through service.pipelines. Point it directly at /v1/metrics using the same secret-backed environment variables:

service:
  telemetry:
    resource:
      service.name: otel-collector
      deployment.environment.name: ${env:DEPLOYMENT_ENVIRONMENT_NAME}
    metrics:
      readers:
        - periodic:
            exporter:
              otlp:
                endpoint: ${env:TSUGA_OTLP_ENDPOINT}/v1/metrics
                headers:
                  Authorization: Bearer ${env:TSUGA_INGESTION_KEY}
                protocol: http/protobuf
Warning

Do not omit /v1/metrics: Pipeline OTLP/HTTP exporters append the signal path automatically; the telemetry reader sends directly to the exact URL you give it. This syntax requires Collector 0.83 or later.

Keep Collector telemetry under its own service.name, watch queue depth, queue capacity, enqueue failures, send failures, and memory-limiter refusals, and keep diagnostic endpoints (health_check, pprof, zpages) on private interfaces. See How to Operate an OpenTelemetry Collector and Collector Pipelines.

Optional receivers and debugging extensions

Keep the baseline lab minimal. Add these blocks only when you need to reproduce a specific local source or inspect Collector internals.

Tail a local log file with filelog

Mount a local log directory in docker-compose.yml and attach filelog to the logs pipeline:

# docker-compose.yml
otel-collector:
  volumes:
    - ./otelcol-config.yml:/etc/otelcol-contrib/config.yaml:ro
    - ./logs:/var/log/sample:ro
# otelcol-config.yml
receivers:
  filelog/sample:
    include:
      - /var/log/sample/*.log
    start_at: beginning
    include_file_path: true

service:
  pipelines:
    logs:
      receivers: [otlp, filelog/sample]
      processors: [memory_limiter, batch]
      exporters: [debug]

Write a test line and watch the logs:

mkdir -p logs
echo "hello from filelog" >> logs/app.log
docker compose restart otel-collector
docker compose logs -f otel-collector

Add host metrics with hostmetrics

The hostmetrics receiver collects CPU, memory, disk, filesystem, load, and network metrics. Inside Docker, it reflects the container view unless you mount the host filesystem and configure root_path.

receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      cpu:
      memory:
      disk:
      filesystem:
      network:
      load:

Add hostmetrics to service.pipelines.metrics.receivers to activate it.

Enable Collector debugging extensions

For local pipeline inspection, enable health_check, pprof, and zpages, and publish their ports only while debugging on a private interface:

extensions:
  health_check:
  pprof:
    endpoint: 0.0.0.0:1777
  zpages:
    endpoint: 0.0.0.0:55679

service:
  extensions: [health_check, pprof, zpages]

This lab is a development harness. Production still needs durable backends, TLS and authentication, sized queues and retries, bounded metric dimensions, and tested Collector upgrades. Next time telemetry goes missing, run the signal through this lab first and fix the exact boundary that breaks.

References

Written by

Nicolas Narbais

Nicolas Narbais builds, breaks, debugs, and scales observability systems using OpenTelemetry and modern telemetry pipelines. He shares practical, opinionated lessons to help engineers get better signal with less noise.

Olatuak Editorial Philosophy

Better signal, not more telemetry.

Olatuak helps platform engineers, SREs, and observability teams turn noisy telemetry into clear operational decisions without blindly collecting more data.

Scroll to zoom · Drag to pan · Double-click to reset