ktg-plugin-marketplace/plugins/voyage/examples/observability/docker-compose.yml
Kjell Tore Guttormsen 48543f63c2 feat(voyage): add examples/observability/ Docker Compose stack — version-pinned per research/01
Step 14 of v4.1 — local-development observability stack with version-pinned
container images:
  - prom/prometheus:v3.0.1
  - prom/node-exporter:v1.10.2 (textfile collector enabled)
  - grafana/grafana:11.4.0
  - otel/opentelemetry-collector-contrib:0.115.0

Two complementary export paths from voyage hooks/scripts/otel-export.mjs:
  - VOYAGE_EXPORT_MODE=textfile → node-exporter textfile collector
  - VOYAGE_EXPORT_MODE=otlp     → otel-collector OTLP/HTTP receiver (:4318)
Both feed Prometheus → Grafana.

Files:
  examples/observability/docker-compose.yml
  examples/observability/otel-collector-config.yaml
  examples/observability/prometheus.yml
  examples/observability/grafana-datasource.yml
  examples/observability/README.md

Verified manifest expected_paths (5 files). docker compose config validation
runs in Step 16 with proper skip-pattern when docker is unavailable.
2026-05-09 09:50:13 +02:00

71 lines
2.4 KiB
YAML

services:
# OpenTelemetry Collector — receives OTLP/HTTP push from voyage hooks/scripts/otel-export.mjs
# and forwards metrics to Prometheus via prometheus exporter (scrape endpoint :8889)
otel-collector:
image: otel/opentelemetry-collector-contrib:0.115.0
container_name: voyage-otel-collector
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
ports:
- "4317:4317" # OTLP/gRPC (not used by voyage, kept for parity)
- "4318:4318" # OTLP/HTTP — voyage sends here when VOYAGE_EXPORT_MODE=otlp
- "8889:8889" # Prometheus exporter scrape endpoint
restart: unless-stopped
# Node Exporter with textfile collector — scrapes voyage.prom files written by voyage hooks
# when VOYAGE_EXPORT_MODE=textfile. Volume-mount: ./voyage-textfile/ matches voyage default.
node-exporter:
image: prom/node-exporter:v1.10.2
container_name: voyage-node-exporter
command:
- "--path.rootfs=/host"
- "--collector.textfile.directory=/var/lib/node_exporter/textfile"
- "--no-collector.arp"
- "--no-collector.bcache"
volumes:
- ./voyage-textfile:/var/lib/node_exporter/textfile:ro
- /:/host:ro,rslave
ports:
- "9100:9100"
restart: unless-stopped
# Prometheus — scrapes both node-exporter (textfile) and otel-collector (OTLP-derived)
prometheus:
image: prom/prometheus:v3.0.1
container_name: voyage-prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=14d"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
ports:
- "9090:9090"
depends_on:
- node-exporter
- otel-collector
restart: unless-stopped
# Grafana — preconfigured Prometheus datasource for voyage dashboards
grafana:
image: grafana/grafana:11.4.0
container_name: voyage-grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
volumes:
- ./grafana-datasource.yml:/etc/grafana/provisioning/datasources/voyage.yml:ro
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
depends_on:
- prometheus
restart: unless-stopped
volumes:
prometheus-data:
grafana-data: