Skip to content
Commitpedia
Log in Join & edit

Loki: horizontally scalable log aggregation inspired by Prometheus

The Grafana Loki repository: a log store that indexes labels instead of full text, queried with LogQL from Grafana or logcli, with the single-binary mode for one host and the microservices mode for clusters.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of Loki: horizontally scalable log aggregation inspired by Prometheus: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
grafana/loki

grafana/loki

Stars
29k
Forks
4.1k
Language
Go
Licence
AGPL-3.0
Last push
15 Oct 2026

On GitHub: Like Prometheus, but for logs.

Open on GitHub

Grafana Loki (about 29,000 stars on GitHub) is developed by Grafana Labs and contributors under the AGPL-3.0 license. Unlike Elasticsearch-style systems it does not index the content of log lines; it indexes a small set of labels per stream and stores the compressed lines as chunks on local disk or object storage. That design makes it cheap to run and operate, at the price of slower full-text searches over very long time ranges.

Choose Loki when you already run Prometheus and Grafana: the labels match the ones on your metrics, so you can jump from a spike on a graph to the log lines of the same host and service in one click. The repository also contains logcli, the command-line client, and Promtail, the original agent, which has been superseded by Grafana Alloy for new deployments.

Try it with Docker, either on its own or with the compose stack from Loki: ship and search logs:

docker run -d --name loki -p 3100:3100 grafana/loki:latest
curl -s http://localhost:3100/ready
curl -s -G http://localhost:3100/loki/api/v1/query --data-urlencode 'query={job="varlog"}' --data-urlencode 'limit=5'

The production/ and examples/ directories in the repository hold reference configurations for Docker Compose and Kubernetes, and the docs/ tree is the source of grafana.com/docs/loki. Retention is off by default; configure the compactor with retention_enabled: true and a retention_period before the disk fills. Careful: once retention is enabled, chunks older than the period are deleted permanently. Credit to Grafana Labs and the Loki contributors.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0193 Linux logs reference: journalctl, journald storage, logrotate and centralized logging Read and filter systemd journal logs, keep their disk use in check, rotate classic log files with logrotate, and understand when to… Intermediate · Cheat sheet · Linux Article Linux administration · Logs 15 Oct 2026
  • 0291 What is a log? A log is a running record of what a program did and when, written to a file so you can look back… Beginner · Explains an idea · Any system Article Logs 15 Oct 2026
  • 0323 Fix: Failed to start service, how to read systemctl status and journalctl Job for x.service failed tells you only that the service did not start. The real reason is in systemctl status and journalctl… Beginner · Fixes an error · Linux Article Logs · Services & systemd 15 Oct 2026
  • 0371 Where are the logs? journalctl, /var/log and container logs A practical map of where Linux programs write their logs and the commands to read them: journalctl filters, the classic files under… Beginner · Step by step · Linux Article Logs 15 Oct 2026
  • 0373 Loki: ship and search logs Run Loki, Grafana Alloy and Grafana with Docker Compose, collect the systemd journal and /var/log files with a short Alloy configuration, and… Intermediate · Step by step · Linux Article Logs 15 Oct 2026
  • 0432 Try Sigma rules against your own logs Install the sigma-cli converter, take a rule from the public SigmaHQ library, convert it into a query for a log tool you… Intermediate · Step by step · Linux, macOS Article Logs · Security resources & detection 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +1,596 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?