Loki logo

Loki

Scalable, label-driven log aggregation built for Kubernetes

Loki aggregates logs using Prometheus‑style labels, offering cost‑effective, horizontally‑scalable storage and native Grafana integration, ideal for Kubernetes pod logs and easy operation.

Loki banner

Overview

Overview

Loki is a horizontally‑scalable, highly‑available log aggregation system that uses the same label model as Prometheus. By storing compressed, unstructured logs and indexing only metadata, it delivers a low‑cost, easy‑to‑operate alternative to traditional full‑text indexed solutions. The label‑driven approach lets teams correlate logs with metrics directly in Grafana, making incident investigation faster and more intuitive.

Deployment

A typical Loki stack consists of the Alloy agent for log collection, the Loki service for storage and query processing, and Grafana for visualization. Loki runs as a single binary with no external dependencies, supports multi‑tenant isolation, and integrates natively with Kubernetes, automatically scraping pod labels. Installation can be performed via pre‑built binaries, Docker images, or source builds, and the system scales horizontally by adding more Loki nodes behind a load balancer. Existing Prometheus users benefit from reusing their label taxonomy, while the Grafana UI provides seamless log exploration alongside metrics.

Highlights

No full‑text indexing; stores compressed logs with label metadata only
Prometheus‑style labels enable seamless metric‑log correlation
Horizontally scalable, multi‑tenant architecture with high availability
Native Grafana integration for unified observability

Pros

  • Low storage cost due to minimal indexing
  • Simple single‑binary deployment without external dependencies
  • Reuses existing Prometheus label taxonomy
  • Built‑in Grafana datasource for instant log exploration

Considerations

  • Cannot perform full‑text search across log contents
  • Effective use requires disciplined label management
  • Advanced log analytics may need external processing
  • Multi‑node setups require load‑balancer configuration

Fit guide

Great for

  • Teams already using Prometheus for metrics
  • Kubernetes clusters needing pod‑level log aggregation
  • Organizations that prioritize cost‑effective log storage
  • Multi‑tenant SaaS platforms requiring isolated log streams

Not ideal when

  • Scenarios demanding deep full‑text search capabilities
  • Environments with strict compliance requiring indexed logs
  • Small single‑node deployments where added components add overhead
  • Use cases that rely heavily on log content analytics without external tooling

How teams use it

Correlate logs with metrics in Grafana

Enable engineers to jump from a metric alert to the exact log lines that generated it, speeding up root‑cause analysis.

Centralized logging for Kubernetes clusters

Collect pod logs automatically via Alloy, store them cost‑effectively, and provide a single query interface for all clusters.

Multi‑tenant log platform for SaaS providers

Isolate each customer’s logs using Loki’s tenant support while sharing the same infrastructure.

Cost‑controlled log retention for development environments

Store large volumes of logs at low cost, retaining them for weeks without expensive indexing.

Tech snapshot

Go96%
Jsonnet2%
Smarty1%
Makefile1%
Ruby1%
Shell1%

Tags

grafanahacktoberfestprometheuscloudnativeloggingloki

Frequently asked questions

How does Loki differ from traditional log aggregation systems?

Loki indexes only log labels, not the full log text, which reduces storage and operational complexity compared to full‑text indexed solutions.

Can Loki perform full‑text search inside log messages?

No. Loki’s queries are based on label selectors and time ranges; full‑text search requires exporting logs to another system.

What agents can send logs to Loki?

Alloy is the primary agent; historically Promtail was used. Both can tail files, read journald, and forward logs via the Loki API.

How are logs queried and visualized?

Grafana provides a native Loki datasource; users write LogQL queries to filter by labels and time, and view results alongside metrics.

Is Loki designed for high availability?

Yes. Loki can be run as multiple nodes behind a load balancer, with built‑in replication and multi‑tenant isolation for HA deployments.

Project at a glance

Active
Stars
27,441
Watchers
27,441
Forks
3,902
LicenseAGPL-3.0
Repo age7 years old
Last commit3 hours ago
Primary languageGo

Last synced 3 hours ago