Like Prometheus, but for logs. https://grafana.com/oss/loki
  • Go 97.7%
  • Jsonnet 1.1%
  • Go Template 0.4%
  • Ruby 0.3%
  • Makefile 0.2%
  • Other 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eric Huang 08d643947d
feat(kafka): Support configurable SASL mechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) (#21719)
Loki's Kafka clients previously hardcoded SASL PLAIN as the only authentication mechanism. Brokers configured to allow only SCRAM-SHA-256 or SCRAM-SHA-512 reject PLAIN authentication, preventing Loki from connecting.

This PR adds a new optional sasl_mechanism configuration parameter (`-kafka.sasl-mechanism`), allowing operators to choose between:
* PLAIN (default, backward-compatible)
* SCRAM-SHA-256
* SCRAM-SHA-512

The setting applies to shared Kafka reader/writer clients and the logline index builder. The builder inherits the root mechanism unless explicitly overridden with `-logline-builder.kafka.sasl-mechanism`; an unset mechanism preserves the PLAIN default.

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
2026-11-28 17:27:46 +01: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 chore(deps): Update actions/labeler action to v7 (main) (#26715) 2026-11-27 15:21:55 +01:00
.vscode chore: add shared vscode launch config (#20103) 2025-12-05 09:20:56 -05:00
clients refactor(logql): Mark the log line of a pipeline as unsafe memory with UnsafeBytes (#26740) 2026-11-27 10:51:08 +01:00
cmd fix(logcli): Return error in case fmt command fails to write output (#26723) 2026-11-26 19:13:11 +00:00
debug
docs feat(kafka): Support configurable SASL mechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) (#21719) 2026-11-28 17:27:46 +01:00
examples docs: Update Bloom docs for 4.0 (#26615) 2026-11-23 11:55:23 +01:00
integration perf(logql): Move from forked jsonparser to upstream (#26685) 2026-11-27 15:16:36 +00: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 build: Upgrade to Go 1.27.2 and fix build (#25188) 2026-10-15 12:47:17 +00:00
pkg feat(kafka): Support configurable SASL mechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) (#21719) 2026-11-28 17:27:46 +01:00
production fix(mixin): Add reason label to duplicate LokiCompactorHasNotSuccessfullyRunCompaction alerts (#24756) 2026-11-27 08:23:54 +00:00
tools chore(dataobj): Delete the dataobj-locality tool (#26752) 2026-11-27 11:09:24 +01:00
vendor feat(kafka): Support configurable SASL mechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) (#21719) 2026-11-28 17:27:46 +01:00
.dockerignore
.gitattributes
.gitignore feat: Remove Promtail support (#21245) 2026-03-25 09:19:49 -03:00
.golangci.yml chore: Remove operator code and related workflows (#25988) 2026-11-03 10:51:30 +00:00
.lychee.toml
.release-please-manifest.json chore: Remove dangling references to the Loki Operator (#26220) 2026-11-05 14:04:20 +11:00
ADOPTERS.md feat: add toleration for bloom components (#12653) 2024-04-19 15:43:03 +01:00
AGENTS.md chore: Remove dangling references to the Loki Operator (#26220) 2026-11-05 14:04:20 +11:00
CHANGELOG.md docs: Update CHANGELOG to correct errors (#26185) 2026-11-03 10:47:50 -05:00
CODE_OF_CONDUCT.md
codecov.yml
CODEOWNERS chore: Remove operator code and related workflows (#25988) 2026-11-03 10:51:30 +00:00
CODING_STANDARDS.md ci: Move to depguard from faillint (#24737) 2026-09-24 16:45:07 -04:00
CONTRIBUTING.md chore(docs): Remove stale LIDs (#25544) 2026-10-22 12:04:53 -04:00
crosscompile.mk feat(ci): Include linux/riscv64 Loki build in releases (#21597) 2026-04-20 07:32:58 +00:00
flake.lock build: Upgrade to Go 1.27.2 and fix build (#25188) 2026-10-15 12:47:17 +00:00
flake.nix chore(deps): Upgrade Go to 1.27.4 (#26463) 2026-11-13 15:17:36 +01:00
go.mod perf: Migrate loghttp and query JSON to Go json/v2 (#26534) 2026-11-27 15:43:25 +00:00
go.sum perf(logql): Move from forked jsonparser to upstream (#26685) 2026-11-27 15:16:36 +00:00
LICENSE Re-license to AGPLv3 (#3630) 2021-04-20 19:02:50 +02:00
LICENSING.md refactor(logql): Move pkg/logqlmodel to pkg/logql/model (#25950) 2026-10-30 10:21:06 +01:00
MAINTAINERS.md
Makefile chore(deps): Upgrade Go to 1.27.4 (#26463) 2026-11-13 15:17:36 +01:00
mkdocs.yml
README.md ci: Run check once per main commit and cancel superseded PR checks (#25617) 2026-11-06 18:06:28 +01:00
relyance.yaml chore: Remove operator code and related workflows (#25988) 2026-11-03 10:51:30 +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.