A Local OpenTelemetry Sandbox With Docker Compose
The fastest way to learn OpenTelemetry is to watch data move through a Collector into backends you can click on. This guide builds a complete local sandbox with Docker Compose: OTel Studio as the source, an OpenTelemetry Collector in the middle, Jaeger for traces and Prometheus for metrics. It takes about five minutes and needs only Docker.
The layout
| Service | Role | Address |
|---|---|---|
| otel-studio | Generates traces, logs and metrics | http://localhost:3002 |
| otelcol | Receives OTLP, exports traces to Jaeger, exposes metrics for Prometheus, prints logs | OTLP on 4317 (gRPC) and 4318 (HTTP) |
| jaeger | Stores and shows traces | http://localhost:16686 |
| prometheus | Stores and queries metrics | http://localhost:9090 |
The files
Create a folder with three files. First otelcol.yaml:
receivers:
otlp:
protocols:
grpc: { endpoint: 0.0.0.0:4317 }
http: { endpoint: 0.0.0.0:4318 }
processors:
batch: {}
exporters:
otlp/jaeger:
endpoint: jaeger:4317
tls: { insecure: true }
prometheus:
endpoint: 0.0.0.0:8889
debug:
verbosity: basic
service:
pipelines:
traces: { receivers: [otlp], processors: [batch], exporters: [otlp/jaeger] }
metrics: { receivers: [otlp], processors: [batch], exporters: [prometheus] }
logs: { receivers: [otlp], processors: [batch], exporters: [debug] }Then prometheus.yml, which scrapes the Collector:
scrape_configs:
- job_name: otelcol
scrape_interval: 10s
static_configs:
- targets: ["otelcol:8889"]And compose.yaml:
services:
otel-studio:
image: ghcr.io/xplurdata/otel-studio:latest
ports: ["3002:3002"]
environment:
ADMIN_PASS: change-me-please
OTEL_ENDPOINT: http://otelcol:4317
OTEL_PROTOCOL: grpc
volumes: ["studio-data:/data"]
depends_on: [otelcol]
otelcol:
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otelcol-contrib/config.yaml"]
volumes: ["./otelcol.yaml:/etc/otelcol-contrib/config.yaml:ro"]
depends_on: [jaeger]
jaeger:
image: jaegertracing/jaeger:latest
ports: ["16686:16686"]
prometheus:
image: prom/prometheus:latest
ports: ["9090:9090"]
volumes: ["./prometheus.yml:/etc/prometheus/prometheus.yml:ro"]
volumes:
studio-data: {}
Run it
docker compose up -d
docker compose logs -f otelcol
- Open http://localhost:3002, sign in as
adminwith the password from the file, and press Start. The endpoint was pre-created fromOTEL_ENDPOINT. - Traces: open Jaeger at
localhost:16686, choose a service such asfrontendand click Find Traces. Open one to see the parent-child spans across services. - Metrics: open Prometheus at
localhost:9090and tryhttp_requests_totalorsum(rate(http_errors_total[1m])). Names are converted from dotted OpenTelemetry names to underscores. - Logs: watch
docker compose logs -f otelcol; switch the debug exporter toverbosity: detailedto see full records, including the trace and span IDs that tie each log to a trace.
Experiments to run
- Press Inject Anomaly and watch the error rate jump in Prometheus and red spans appear in Jaeger.
- Add a processor to
otelcol.yaml(for example the attributes processor), restart the Collector withdocker compose restart otelcol, and see the change in the data. - Enable the Infrastructure simulator and query
system_cpu_utilizationby host. - Add a second exporter to send the same data to another backend — see Backends and presets.
For anything beyond a laptop, pin image versions instead of
latest, give Prometheus and Jaeger persistent storage, and put the Collector behind authentication. This sandbox is intentionally disposable: docker compose down -v removes everything.