Back to guidesGuide

Fix Loki label explosion without breaking the searches that actually matter

How to reduce streams, tiny chunks, and query latency while keeping incident-time context useful

A practical guide to spotting high-cardinality labels in Loki, taking them out of the hot path, and proving your searches still work.

Created: April 29, 2026

Published: April 29, 2026

Estimated time40 min
LevelAdvanced
Before you startAccess to Loki plus Grafana Explore or logcli
PlatformsLinux / Docker
WhatsAppXLinkedIn

Docker

Run the same checks from containers and restart only the log agent after validating the config.

docker composecurljq
Series from the Loki service
docker compose exec loki sh -lc 'START=$(date -u -d "1 hour ago" +%s000000000); END=$(date -u +%s000000000); curl -G -s http://localhost:3100/loki/api/v1/series --data-urlencode '''match[]={cluster="prod",namespace="payments"}''' --data-urlencode "start=${START}" --data-urlencode "end=${END}" | jq '''.data[:5]''''
Validate agent config
docker compose exec alloy alloy validate /etc/alloy/config.alloy
Apply only the agent change
docker compose restart alloy

Content locked

This guide requires both steps before full content is available.

  • Click “Like” on this guide.
  • Share on WhatsApp, X, LinkedIn, or copy the link.

Access is automatically unlocked as soon as both steps are completed.