Slide 1 of 5

Labels tell you where

Labels tell you where

Loki, which powers Grafana Cloud Logs, takes the idea of a fewest labels principle further than metrics by indexing only your labels, not the log content, so every label combination splits your logs into another stream to index and store.

Good log labels describe the origin or context of the log; for example, application, namespace, environment, cluster, or region. These are static, bounded, and what you actually filter by when you start a search. Loki performs best with few labels, and the fewer streams you create, the smaller the index and the faster your queries.

One application splitting into four log streams because two labels with two values each create four unique label combinations

Script

Logs need their own strategy. The metric labeling rules you’ve learned all point toward using the fewest labels that answer real queries, and Loki takes that fewest labels principle even further. It indexes only your labels, never the log content, so every label combination splits your logs into another stream to index and store.

Good log labels tell you where the log came from. Think application, namespace, environment, cluster, or region.

These origin labels are static, they’re bounded, and they’re what you actually filter by when you start a search.

Loki performs best with few labels, and the fewer streams you create, the smaller the index and the faster your queries.