$ show grafana/docker-otel-lgtm
This repository builds and maintains the `grafana/otel-lgtm` Docker image, an all-in-one OpenTelemetry backend for development, demo, and testing. It bundles Grafana, Prometheus, Tempo, Loki, Pyroscope, and the OpenTelemetry Collector into a single container, providing a complete observability stack with a single `docker run` command. The image supports optional eBPF-based auto-instrumentation (OBI) for zero-code traces and RED metrics, and can export telemetry to external vendors via OTLP. The architecture is a multi-stage Docker build that downloads and verifies each component using checksums or cosign signatures. The container entrypoint (`run-all.sh`) starts all services in parallel, waits for health checks, and handles graceful shutdown. The OpenTelemetry Collector configuration is dynamically extended based on environment variables (debug exporter, external endpoints, custom headers). The repository also includes example applications in Java, Go, Python, .NET, and Node.js that demonstrate OpenTelemetry instrumentation, along with acceptance tests (OATS) that validate traces, metrics, logs, and profiles. CI/CD is comprehensive: automated builds, linting (flint, hadolint, shellcheck, etc.), container scanning with Trivy, CodeQL analysis, and weekly scheduled releases with immutable version tags. Container images are signed with cosign and attested via GitHub Artifact Attestations. The repository is actively maintained with Renovate for dependency updates and a well-defined release process.
The LLM identified 2 files worth highlighting for reuse:
Generates an OpenTelemetry Collector overlay configuration at container startup based on environment variables (`OTEL_EXPORTER_OTLP_ENDPOINT`, per-signal endpoints, `OTEL_COLLECTOR_DEBUG_EXPORTER`, `OTEL_EXPORTER_OTLP_HEADERS`). The script conditionally renders pipeline exporters (debug, external, or both) and injects authentication headers into external endpoints. This pattern is reusable for any project that needs to dynamically configure an OTel Collector based on runtime environment, without requiring static config files or manual templating.
Manages Grafana plugin version compatibility across container upgrades. When the Grafana version changes (detected via a marker file under `GF_PATHS_HOME`), it removes four managed plugins (exploretraces, lokiexplore, metricsdrilldown, pyroscope) so Grafana re-downloads version-compatible builds on next startup. This prevents stale plugin binaries from being served by a newer Grafana version. The pattern is reusable for any Grafana deployment that persists plugin data across upgrades and wants automatic self-healing.