loki README

The project's README from github.com/grafana/loki. As one markdown file: README.md.

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:

A Loki-based logging stack consists of 3 components:

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.

loki (grafana/loki)

Searching Database…

29K ·GitHub
这是什么?Loki 是 Grafana 推出的一个可水平扩展、高可用、多租户的日志聚合系统——就像 Prometheus,只不过面向的是日志。
它和其他日志聚合系统有什么不同?它不做全文索引:Loki 存储的是压缩过的非结构化日志,只对元数据(标签)建立索引,因此运维更简单、运行成本也更低。
一套 Loki 日志系统是什么样的?由三个部分组成:Alloy,负责收集日志并发送给 Loki 的采集代理;Loki 服务本身,负责存储日志和处理查询;还有 Grafana,用于查询和展示。
使用它需要 Grafana 吗?需要——Grafana 是这套系统的查询和展示层,从 Grafana v6.0 起就原生支持 Loki。
一些老教程提到 Promtail——现在还能用它来发送日志吗?不能。在这套系统里 Alloy 已经取代了 Promtail——Promtail 被视为功能已完结,之后的日志采集开发都会在 Grafana Alloy 中进行。
关于许可证有什么需要注意的?Loki 采用 AGPL-3.0-only 许可证发布,这是一种强 copyleft(传染性开源)许可证;Apache-2.0 的豁免条款列在 LICENSING.md 中。
我能不用 Grafana,直接在终端里查询日志吗?可以——LogCLI 提供了一个命令行界面,可以直接查询 Loki 的日志。
Docker 容器能把日志直接发给 Loki 吗?可以——Docker Driver Client 是一个 Docker 插件,能把容器日志直接发送到 Loki。
用 Helm 安装时有什么要注意的?有——从 2026 年 3 月 16 日起,Grafana Loki 的 Helm chart 会分叉到 grafana-community/helm-charts 仓库,而 Loki 仓库中的 chart 之后只面向 GEL 用户维护。
Creator
grafana
Size
547.9 MB
Stars
29K
Age
8y
Commits · 90 Days