← All insightsBest Practices

Grafana Loki best practices for teams

Nir Geier, CodeWizard · 2 May 2026 · 3 min read · Intermediate

Grafana Loki rewards a little discipline. These are the practices that keep it maintainable as a team and a codebase grow.

The practices

  • Keep labels low-cardinality; filter within the stream using LogQL
  • Set per-tenant retention and ingestion limits
  • Structure logs (logfmt/JSON) so LogQL parsers work well

What good looks like

Promtail scraping local logs and shipping to Loki.

yaml
server: { http_listen_port: 9080 }
clients: [{ url: http://loki:3100/loki/api/v1/push }]
scrape_configs:
  - job_name: system
    static_configs:
      - targets: [localhost]
        labels: { job: varlogs, __path__: /var/log/*log }

Anti-patterns to retire

  • High-cardinality labels (like request_id) destroying performance
  • Pushing huge log volumes without retention or limits
  • Expecting full-text indexing - Loki filters, it doesn't index content

Want senior help putting Grafana Loki to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult