Like Prometheus, but for logs. https://grafana.com/oss/loki
  • Go 97.4%
  • Jsonnet 1.1%
  • Go Template 0.4%
  • Makefile 0.3%
  • Ruby 0.3%
  • Other 0.3%
Find a file
Christian Haudum 06037114f4
feat(limits-service): Persist streamShardStore state (#24752)
Stream sharding state lives only in memory. After a restart, or after a
partition is handed to another instance, every stream looks brand new: it has
no rate history, so it gets a single shard until a full rate window of traffic
has been observed again. High-volume streams are under-sharded during that
warm-up.
With this PR, rate buckets and shard counts are written to the stream metadata topic and
restored from it, behind -ingest-limits.stream-sharding-durability-enabled
(default off).
2026-09-29 13:41:43 +02:00
.claude chore: Add AI agent tooling and rename agent documentation (#20609) 2026-01-30 15:21:44 -07:00
.cursor/skills/go chore: remove unused frontend cursor rule (#20674) 2026-02-04 13:23:08 +00:00
.devcontainer chore(deps): Update grafana/loki-build-image Docker tag to v0.35.2 (main) (#22490) 2026-06-29 16:09:18 -04:00
.github fix: Stop rennovate from bumping franz-go and pin kmsg to match franz-go (#24789) 2026-09-28 15:07:33 +00:00
.vscode chore: add shared vscode launch config (#20103) 2025-12-05 09:20:56 -05:00
clients chore(deps): Update logstash:9.5.3 Docker digest to 82bbb49 (main) (#24745) 2026-09-25 16:00:27 -06:00
cmd feat(canary): Implement support for path prefixes (#24534) 2026-09-14 19:31:15 +00:00
debug docs: fix Promtail / Loki capitalization (#1130) 2019-10-08 09:41:41 -04:00
docs feat(limits-service): Persist streamShardStore state (#24752) 2026-09-29 13:41:43 +02:00
examples chore(deps): Update grafana/loki Docker tag to v3.7.8 (main) (#24669) 2026-09-25 14:10:32 -04:00
integration fix: Port binding flake in integration tests (#24540) 2026-09-17 16:55:03 -04:00
loki-build-image chore(build): Build the make container user with the host UID/GID (#23254) 2026-07-14 16:32:40 +10:00
nix chore: update go version to 1.26.2 (#21464) 2026-04-21 12:01:51 +02:00
operator feat(operator): Update Loki operand to 3.7.8 (#24743) 2026-09-28 16:23:53 +02:00
pkg feat(limits-service): Persist streamShardStore state (#24752) 2026-09-29 13:41:43 +02:00
production chore(deps): Update grafana/grafana Docker tag to v13.2.2 (main) (#24642) 2026-09-25 14:11:39 -04:00
tools chore(dataobj): Rename dataobj-consumer to dataobj-builder (#24784) 2026-09-28 17:42:08 +02:00
vendor fix(deps): Update module charm.land/bubbletea/v2 to v2.0.10 (main) (#24766) 2026-09-28 16:28:39 -06:00
.dockerignore chore: Add tools/dev/kafka/data to .dockerignore (#19897) 2025-11-17 22:17:54 +01:00
.gitattributes Enable merge union strategy for CHANGELOG.md. (#5102) 2022-01-11 22:18:54 +02:00
.gitignore feat: Remove Promtail support (#21245) 2026-03-25 09:19:49 -03:00
.gitmodules operator: Publish docs as public website (#6449) 2022-06-30 11:54:49 +02:00
.golangci.yml chore: Update to Go 1.27 (#24738) 2026-09-25 12:39:18 -04:00
.lychee.toml Add a target to find dead link in our documentation. (#3713) 2021-05-12 05:03:50 -04:00
.release-please-manifest.json chore( operator): Community release 0.11.0 (#22330) 2026-08-18 15:51:14 +01:00
ADOPTERS.md feat: add toleration for bloom components (#12653) 2024-04-19 15:43:03 +01:00
AGENTS.md chore: Improve AGENTS.md (#21805) 2026-05-11 14:07:53 +02:00
CHANGELOG.md chore(k310): Release 3.8.0 (backport main) (#22303) 2026-06-08 14:24:24 -04:00
CODE_OF_CONDUCT.md Change conduct contact email address (#2425) 2020-07-27 08:38:41 -04:00
codecov.yml Attempting to add informational only feedback for codecov (#1647) 2020-02-06 15:04:08 -05:00
CODEOWNERS chore: Make oss big tent codeowners of grammar file to be notified about new grammar (#18145) 2025-06-20 09:25:38 -04:00
CODING_STANDARDS.md ci: Move to depguard from faillint (#24737) 2026-09-24 16:45:07 -04:00
CONTRIBUTING.md docs: Add Commit signing requirement (#22381) 2026-06-11 13:13:43 +00:00
crosscompile.mk feat(ci): Include linux/riscv64 Loki build in releases (#21597) 2026-04-20 07:32:58 +00:00
flake.lock chore: Update Go to 1.26.4 (#22166) 2026-06-03 19:24:49 +01:00
flake.nix chore: Update go to version 1.26.7 (#24570) 2026-09-17 14:02:09 -04:00
go.mod fix(deps): Update module charm.land/bubbletea/v2 to v2.0.10 (main) (#24766) 2026-09-28 16:28:39 -06:00
go.sum fix(deps): Update module charm.land/bubbletea/v2 to v2.0.10 (main) (#24766) 2026-09-28 16:28:39 -06:00
LICENSE Re-license to AGPLv3 (#3630) 2021-04-20 19:02:50 +02:00
LICENSING.md fix(promtail): Handle docker logs when a log is split in multiple frames (#12374) 2024-04-26 10:40:46 -07:00
MAINTAINERS.md Update MAINTAINERS.md (#11666) 2024-01-16 11:34:50 -05:00
Makefile chore: Update to Go 1.27 (#24738) 2026-09-25 12:39:18 -04:00
mkdocs.yml docs: general documentation rework 2019-09-06 13:44:24 -04:00
README.md feat: Remove Promtail support (#21245) 2026-03-25 09:19:49 -03:00
relyance.yaml chore(ci): Add relyance scanner (#17777) 2025-05-21 13:17:49 +00:00

Loki Logo

Check Go Report Card Slack Fuzzing Status

Loki: like Prometheus, but for logs.

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and easy to operate. It does not index the contents of the logs, but rather a set of labels for each log stream.

Compared to other log aggregation systems, Loki:

  • does not do full text indexing on logs. By storing compressed, unstructured logs and only indexing metadata, Loki is simpler to operate and cheaper to run.
  • indexes and groups log streams using the same labels you’re already using with Prometheus, enabling you to seamlessly switch between metrics and logs using the same labels that you’re already using with Prometheus.
  • is an especially good fit for storing Kubernetes Pod logs. Metadata such as Pod labels is automatically scraped and indexed.
  • has native support in Grafana (needs Grafana v6.0).

A Loki-based logging stack consists of 3 components:

  • Alloy is agent, responsible for gathering logs and sending them to Loki.
  • Loki is the main service, responsible for storing logs and processing queries.
  • Grafana for querying and displaying the logs.

Note that Alloy replaced Promtail in the stack, because Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy.

Loki is like Prometheus, but for logs: we prefer a multidimensional label-based approach to indexing, and want a single-binary, easy to operate system with no dependencies. Loki differs from Prometheus by focusing on logs instead of metrics, and delivering logs via push, instead of pull.

Getting started

⚠️ Helm Chart Migration

Effective March 16, 2026, the Grafana Loki Helm chart will be forked to a new repository grafana-community/helm-charts. The chart in the Loki repository will continue to be maintained for GEL users only. See #20705 for details.

Upgrading

Documentation

Commonly used sections:

Getting Help

If you have any questions or feedback regarding Loki:

Your feedback is always welcome.

Further Reading

Contributing

Refer to CONTRIBUTING.md

Building from source

Loki can be run in a single host, no-dependencies mode using the following commands.

You need an up-to-date version of Go, we recommend using the version found in our Makefile

# Checkout source code
$ git clone https://github.com/grafana/loki
$ cd loki

# Build binary
$ go build ./cmd/loki

# Run executable
$ ./loki -config.file=./cmd/loki/loki-local-config.yaml

Alternatively, on Unix systems you can use make to build the binary, which adds additional arguments to the go build command.

# Build binary
$ make loki

# Run executable
$ ./cmd/loki/loki -config.file=./cmd/loki/loki-local-config.yaml

To run multiple Loki tenants locally, ensure that auth_enabled is set to true and provide a runtime config with any tenant specific overrides.

# Build binary
$ make loki

# Run executable
./loki -config.file=./cmd/loki/loki-local-multi-tenant-config.yaml -runtime-config.file=./cmd/loki/loki-overrides.yaml

Adopters

Please see ADOPTERS.md for some of the organizations using Loki today. If you would like to add your organization to the list, please open a PR to add it to the list.

License

Grafana Loki is distributed under AGPL-3.0-only. For Apache-2.0 exceptions, see LICENSING.md.