Grafana Loki stores and queries application and infrastructure logs using metadata labels instead of full-text indexing on log bodies.
Overview
Grafana Loki is a horizontally scalable, multi-tenant log aggregation system modeled after Prometheus-style label indexing. It keeps compressed, unstructured log data and indexes labels for each stream rather than the full text of every line.
A typical stack centers on Loki for storage and queries, with Grafana Alloy handling log collection after Alloy replaced Promtail in the documented stack. Clients can push logs in varied formats, and operators query them with LogQL inside Grafana or through LogCLI on the command line.
Because streams reuse Prometheus-like labels, teams can correlate metrics and logs with the same dimensions. Alerting rules can evaluate incoming log data and forward results to a Prometheus Alertmanager for routing.
Loki can run as a single-binary deployment on one host or scale out for higher availability. Integrations include native Grafana datasource support, a Docker logging driver, and optional Helm-based installation paths described in the project docs.
Key features
- Label-based log stream indexing
- LogQL query language
- Grafana datasource integration
- Push-based log ingestion
- Object storage persistence
- LogCLI command-line queries
- Docker logging driver
- Alerting with Alertmanager
Use cases
- Centralizing application and infrastructure logs
- Correlating logs with Prometheus metrics
- Real-time log tailing during incidents
- Generating alerts from log patterns
- Running cost-conscious log retention