back to home

grafana / docker-otel-lgtm

OpenTelemetry backend in a Docker image

1,700 stars
188 forks
14 issues
ShellDockerfilePowerShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing grafana/docker-otel-lgtm in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/grafana/docker-otel-lgtm)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

docker-otel-lgtm [![Docker latest][docker-latest]][docker-hub] [![Docker pulls][docker-pulls]][docker-hub] An OpenTelemetry backend in a Docker image. It bundles the **OpenTelemetry Collector**, **Prometheus** (metrics), **Tempo** (traces), **Loki** (logs), **Pyroscope** (profiles), and **Grafana** into a single container — with optional **OBI** (eBPF auto-instrumentation). The Docker image is an open source backend for OpenTelemetry that's intended for development, demo, and testing environments. > [!IMPORTANT] > If you are looking for a **production-ready**, out-of-the box solution to monitor applications > and minimize MTTR (mean time to resolution) with OpenTelemetry and Prometheus, > you should try [Grafana Cloud Application Observability][app-o11y]. Documentation • Blog posts: • [_An OpenTelemetry backend in a Docker image: Introducing grafana/otel-lgtm_][otel-lgtm] • [_Observability in under 5 seconds: Reflecting on a year of grafana/otel-lgtm_][otel-lgtm-one-year] Get the Docker image The Docker image is available on [Docker Hub][docker-hub]. Run the Docker image Linux/Unix Windows (PowerShell) Linux/Unix Using mise You can also use [mise][mise] to run the Docker image: Configuration Enable logging You can enable logging in the .env file for troubleshooting: | Environment Variable | Enables Logging in: | |--------------------------|-------------------------| | | Grafana | | | Loki | | | Prometheus | | | Tempo | | | Pyroscope | | | OpenTelemetry Collector | | | OBI | | | All of the above | This has nothing to do with any application logs, which are collected by OpenTelemetry. Enable OBI (eBPF auto-instrumentation) [OpenTelemetry eBPF Instrumentation (OBI)][obi] uses eBPF to automatically generate traces and [RED][red-method] metrics for HTTP/gRPC services — with zero code changes. To enable OBI, add to your file or pass it as an environment variable: **Requirements:** Linux kernel 5.8+ with BTF support. The and scripts automatically add the required and Docker flags when OBI is enabled. If you run directly, you must add these flags manually. > [!NOTE] > The flag shares the host's PID namespace with the container, > so OBI can discover and instrument processes running on the host — not just > inside the container. For example, will instrument Java > processes running on the host as well. Target specific applications By default, OBI discovers services on common ports (80, 443, 8080-8099, 3000-3999, 5000-5999). You can target specific applications: | Variable | Purpose | |-----------------------------|-------------------------------------------------------------------------------------------------| | | Friendly language target: , , , , , or any regular expression | | | Override ports to monitor (native OBI environment variable) | | | Executable name pattern (native OBI environment variable, set automatically by ) | Send data to vendors In addition to the built-in observability tools, you can also send data to vendors. That way, you can easily try and switch between different backends. If the [ ][otlp-endpoint] variable is set, the OpenTelemetry Collector will send data (logs, metrics, and traces) to the specified endpoint using "OTLP/HTTP". You can also configure per-signal endpoints: • • • If both global and per-signal endpoints are set, per-signal values take precedence. Endpoints must include the scheme (for example, ). In addition, you can provide [ ][otlp-headers], for example, to authenticate with the backend. Send data to Grafana Cloud You can find the values for the environment variables in your [Grafana Cloud account][otel-setup]. Persist data across container instantiation The various components in the repository are configured to write their data to the directory. If you need to persist data across containers being created and destroyed, you can mount a volume to the directory. Note that this image is intended for development, demo, and testing environments and persisting data to an external volume doesn't change that. However, this feature could be useful in certain cases for some users even in testing situations. Customize backend configuration Each backend supports a environment variable for passing additional CLI flags without modifying any files: | Backend | Env var | Example | |-------------------------|-------------------------|--------------------------------------| | Prometheus | | | | Loki | | | | Tempo | | | | Pyroscope | | | | OpenTelemetry Collector | | | For example, to set a 90-day retention period for Prometheus: > [!NOTE] > The value is split on whitespace into separate arguments. For options that > require values with spaces, mount a custom configuration file instead (see below). For deeper customization, you can mount custom configuration files into the container: | Backend | Config file path | |-------------------------|---------------------------------------------| | Prometheus | | | Loki | | | Tempo | | | Pyroscope | | | OpenTelemetry Collector | | Grafana is configured via environment variables — see the [Grafana documentation][grafana-env-overrides] for details. Pre-install Grafana plugins You can pre-install Grafana plugins by adding them to the environment variable. See the [Grafana documentation][grafana-preinstall-plugins] for more information. Add custom dashboards You can add custom Grafana dashboards by mounting them into the container with a provisioning configuration. Create a dashboard JSON file and a provisioning YAML file: **dashboards-provisioning.yaml:** Mount both files in your : See the [Java example][java-example] for a complete working example. To set a custom dashboard as the home dashboard, add the environment variable: Run lgtm in Kubernetes Send OpenTelemetry Data There's no need to configure anything: the Docker image works with OpenTelemetry's defaults. View Grafana Navigate to and log in with the default built-in user and password . Build the Docker image from scratc…