DELAPARRA
Index
Color
NL
Category: Observability

Loki

Explained by Updated

What is Loki?

Loki: Grafana’s log database — indexes only labels, not full text, making it cheap. Queried with LogQL. Loki is Grafana's log storage system. Unlike traditional log databases, it only indexes a few labels per stream, such as app and environment, not the full text of every line. That makes it cheap to run and store.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Loki

How is Loki used in practice?

You query it with LogQL. {app="api"} |= "error" finds error lines from the API, and you can parse JSON fields and filter on them, such as requests slower than 500 milliseconds.

What should you keep in mind with Loki?

It works best alongside Prometheus and Grafana, where you can jump from a spike on a graph to the logs for that same time and service. Keep labels to low-cardinality values like app, namespace and level; putting request IDs in labels defeats the design. For searching many terabytes of logs by arbitrary text, a full-text system may suit you better.

What does an example of Loki look like?

{app="api"} |= "error" | json | latency_ms > 500

At a glance

CategoryObservability
Explained by
Updated

More Observability terms

All terms starting with L

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.