๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Prometheus + Loki + Grafana 2026: The Modern Observability Stack Setup

Prometheus + Loki + Grafana 2026: The Modern Observability Stack Setup

Quick summary: Prometheus for metrics, Loki for logs, Grafana for visualization and alerting. The combination is mature, free, and operationally well-understood in 2026 โ€” but how you deploy them matters more than which tools you pick. This guide walks through architecture decisions (microservices vs monolithic for each component), sizing rules of thumb, retention strategy, the alerting patterns that catch real production issues, and the long-tail operational concerns (cardinality explosions, log-volume cost surprises, dashboard sprawl) that separate a stack that scales from one that does not.

Prometheus Loki Grafana modern observability stack setup guide 2026

Why This Stack Wins

The observability market in 2026 has crystallized around two camps: vendor SaaS (Datadog, New Relic, Splunk, Honeycomb) and open-source self-hosted (Prometheus + Loki + Grafana, with optional traces via Tempo or Jaeger). Both are legitimate; both have growing user bases. The vendor side wins on out-of-the-box experience and not-running-storage; the open-source side wins on cost at scale and data sovereignty.

Prometheus + Loki + Grafana specifically wins because:

  • Prometheus is the de facto standard for metrics in the Kubernetes/cloud-native world. Every modern infrastructure tool exposes Prometheus metrics natively or via an exporter.
  • Loki uses object storage for log persistence, making the cost-per-GB an order of magnitude lower than Elasticsearch-based alternatives.
  • Grafana is the dashboard everyone already knows. Even teams using vendor backends often run Grafana for visualization.
  • The query languages (PromQL, LogQL) are similar enough that engineers fluent in one are productive in the other within a day.
  • All three projects are governed under open foundations (CNCF for Prometheus, Grafana Labs for Loki and Grafana itself) with active development and predictable release cycles.

Architecture Decision 1: Monolithic or Microservices?

Each of the three components offers two deployment modes: a single binary that does everything (simpler) and a microservices mode where each functional piece runs as a separate service (more scalable). The right choice depends on your scale.

Prometheus

  • Single Prometheus binary โ€” works up to roughly 10 million active series per instance on modern hardware. For most organizations under 1000 services, one Prometheus per environment is enough.
  • Federated Prometheus โ€” multiple Prometheus instances scraping subsets, with a top-level Prometheus aggregating. Common pattern for multi-cluster Kubernetes.
  • Thanos or Mimir โ€” fully distributed, horizontally scalable Prometheus-compatible backends. Choose these when you need cross-region global query, long-term retention beyond 30 days, or HA without losing data on a node failure.

Loki

  • Monolithic mode โ€” single binary, single object-storage bucket. Works fine up to several TB/day of ingestion and several months of retention.
  • Simple Scalable Deployment (SSD) โ€” three components: read, write, backend. The current default recommendation for most production deployments.
  • Microservices โ€” fully separated ingester, distributor, querier, query-frontend, compactor. Reserved for very large installations (10s of TB/day).

Grafana

  • Single instance with a Postgres or MySQL backend works for most teams.
  • HA pair behind a load balancer with a shared database for organizations where dashboard availability is critical.
  • For multi-tenant or organization-of-organizations deployments, look at Grafana Enterprise or self-hosted multi-tenancy with separate orgs.

Sizing Rules of Thumb

These are starting points based on real deployments, not theoretical maxes. Your mileage will vary by workload characteristics; treat as ballpark sanity-check numbers.

Prometheus

Active seriesRAMCPUDisk (15 days @ 15s scrape)
500K4 GB2 vCPU40 GB
2M16 GB4 vCPU160 GB
10M64 GB16 vCPU800 GB

RAM is the binding constraint โ€” Prometheus needs to keep recent samples in memory for queries and ingest. Disk on locally-attached NVMe is essential; network storage will not keep up at scale.

Loki

Ingestion ratePods (SSD mode)S3 storage (90 days)
10 GB/day1 read + 2 write + 1 backend~300 GB compressed
100 GB/day3 read + 4 write + 2 backend~3 TB compressed
1 TB/day10 read + 12 write + 4 backend~30 TB compressed

Loki's compression ratio is roughly 10x for typical structured logs and roughly 4x for verbose unstructured logs. Plan storage based on uncompressed-to-compressed measured on your actual log mix.

Retention Strategy

Default retention should be opinionated, with long-term storage as a separate decision.

Metrics retention

  • Prometheus local: 15-30 days at full resolution. Anything more is a Thanos/Mimir conversation.
  • Long-term metrics: 1-2 years downsampled to 5-minute resolution via Thanos compactor or Mimir.
  • Compliance scenarios (financial, healthcare): 7 years at degraded resolution, often in cheaper object storage.

Log retention

  • Hot tier: 7-14 days for routine debugging
  • Warm tier: 30-90 days for incident investigation
  • Cold tier / archive: 1+ year if compliance requires; consider Loki's S3 storage class lifecycle policies to move chunks to Glacier-class storage.

Setting Up the Stack: Helm Charts

For Kubernetes deployments, the official Helm charts are the right starting point.

# Add repos
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

# Prometheus stack (Prometheus + Alertmanager + node-exporter + kube-state-metrics)
helm install kube-prom prometheus-community/kube-prometheus-stack \
  --namespace monitoring --create-namespace \
  --values prometheus-values.yaml

# Loki (SSD mode)
helm install loki grafana/loki \
  --namespace monitoring \
  --values loki-values.yaml

# Grafana (often included in kube-prometheus-stack, but installable separately)
helm install grafana grafana/grafana \
  --namespace monitoring \
  --values grafana-values.yaml

Critical values to set

# prometheus-values.yaml essentials
prometheus:
  prometheusSpec:
    retention: 30d
    retentionSize: 200GB
    resources:
      requests:
        memory: 8Gi
        cpu: 2
      limits:
        memory: 16Gi
    storageSpec:
      volumeClaimTemplate:
        spec:
          storageClassName: fast-nvme
          resources:
            requests:
              storage: 250Gi

# loki-values.yaml essentials
deploymentMode: SimpleScalable
loki:
  storage:
    type: s3
    s3:
      endpoint: s3.eu-west-1.amazonaws.com
      bucketnames: my-loki-chunks
      region: eu-west-1
  limits_config:
    retention_period: 720h  # 30 days

Alerting: The Patterns That Catch Real Issues

The most expensive observability mistake is "we have all the data but no alerts." The second most expensive is "we have alerts but they never fire because they alert on symptoms not causes." Here are alert templates that catch real problems.

SLO-based alerts (the gold standard)

# Alert if 99th percentile latency budget is being burned faster than 14.4x normal
- alert: HighErrorBudgetBurn
  expr: |
    (
      sum(rate(http_requests_total{job="api",status=~"5.."}[1h]))
      / sum(rate(http_requests_total{job="api"}[1h]))
    ) > (14.4 * 0.001)
  for: 2m
  labels:
    severity: page
  annotations:
    summary: "Error budget burning fast โ€” pages on-call"

Capacity alerts

- alert: PrometheusDiskFillingUp
  expr: |
    predict_linear(node_filesystem_avail_bytes{job="node",mountpoint="/prometheus"}[6h], 4*3600) < 0
  for: 30m
  labels:
    severity: warn

Backbone alerts (always include these)

  • Prometheus has been down for 5+ minutes (target an external system or paging service)
  • Alertmanager has been silent for >1 hour (dead-man's switch with cron + healthcheck)
  • Loki ingestion rate has dropped to zero (often signals a logging agent failure rather than no logs)

The Cardinality Trap

The single most common Prometheus failure mode is unbounded cardinality. A label with high cardinality (user IDs, request IDs, container IDs that change every deploy) explodes memory usage. Symptoms: Prometheus OOMs, then OOMs again on restart because it tries to load the same series.

Defense:

  • Audit metrics quarterly with topk(20, count by (__name__)({__name__=~".+"}))
  • Reject high-cardinality labels at scrape time via metric_relabel_configs
  • Set sample_limit on each scrape job to fail fast on misbehaving exporters
  • Educate developers: every label is a multiplier; instance ร— method ร— status_code ร— path is already 4-dimensional

Cost Realities at Scale

The "free open source" line is true for software licenses, not for compute and storage. Expected operating costs for self-hosted at scale:

  • 10M active series Prometheus: ~$300-500/month in compute + NVMe storage
  • 1 TB/day Loki: ~$200/month compute + ~$700/month S3 (eu-west-1 standard tier, 90-day retention)
  • Grafana: small flat cost, usually under $100/month

Compare to typical SaaS pricing for equivalent volumes (~$5,000-15,000/month at the scales above) and the ROI on self-hosting becomes obvious for any organization above mid-size โ€” provided you have the operational capacity to run the stack reliably.

Operational Lessons from Real Deployments

1. Run observability outside the things it observes

If your Prometheus runs in the same Kubernetes cluster it monitors, when the cluster has a problem you have no observability. Run the monitoring stack in a separate cluster (or VMs) with cross-cluster scraping and remote-write.

2. Dashboard sprawl is real

After 18 months, every team has 50 dashboards, half of them broken or duplicated. Establish a curation process: tag dashboards, deprecate aggressively, require a "What is this dashboard for?" comment in the JSON.

3. Test your alerts

An alert that has never fired is an alert you do not know works. Quarterly fire-drill: deliberately break a service in staging, see if the right alert pages within target time, post-mortem if not.

4. Log levels matter

The default for many applications is INFO, which logs request-rate ร— instance-rate ร— multi-line content per request. Storage costs scale linearly with this volume. Audit log levels yearly; many "INFO" logs should be DEBUG (keep locally on hot tier only) or removed entirely.

5. Distributed tracing is the missing third pillar

Metrics + logs is a strong baseline. Adding tracing (Tempo, Jaeger, vendor) is the next step for understanding cross-service request flows. Most production teams in 2026 have at least basic tracing in place; if you do not, it is the highest-ROI next investment in observability.

Real-World Migration Story: From Datadog to Self-Hosted

One mid-sized SaaS team we worked with migrated from Datadog to a Prometheus + Loki + Grafana stack over four months in late 2025, motivated by a Datadog renewal quote that had grown to roughly $420,000/year as their service count tripled. Here is the abbreviated story of how it played out.

Month 1 โ€” Prometheus first. They stood up Mimir backed by S3 in a dedicated monitoring Kubernetes cluster, separate from the application clusters. Existing Datadog Agent custom metrics had to be migrated to Prometheus exposition format; the team built a small pre-flight tool that scanned application code for Datadog statsd calls and flagged each as "trivial port", "needs label rework", or "needs investigation". About 80% were trivial.

Month 2 โ€” Loki for logs. The bigger lift than expected. Datadog's Logs product makes ad-hoc field-based queries fast; Loki's label-based model required some unlearning. They added a few key labels (service, environment, severity) and accepted that arbitrary-field search would be slower. After a month of usage, the team adapted; nobody asked to go back.

Month 3 โ€” Grafana dashboards and alerts. Recreating Datadog dashboards was tedious but mechanical. The bigger work was rebuilding alert rules in Prometheus's recording-rule + alerting-rule format. They standardized on SLO-based alerts (error budget burn rate) which actually improved alert quality compared to the threshold-based alerts they had inherited.

Month 4 โ€” turn off Datadog. They ran both stacks in parallel for three weeks, comparing dashboards and alerts. A small number of Datadog-only features (synthetic monitoring, real user monitoring) were replaced with separate point tools. Total cutover happened on a Tuesday afternoon with no customer-visible impact.

Outcome: Total operational cost of the new stack: roughly $3,400/month. Engineering time on observability operations: about 0.5 FTE (one engineer half-time, with the platform team owning runbooks). Annual savings vs. Datadog renewal: approximately $380,000. Lessons: the migration is real work but the steady-state operational burden is much smaller than people fear.

Frequently Asked Questions

Why not Elasticsearch for logs?

Storage cost. Elasticsearch indexes everything aggressively, which makes ad-hoc field queries fast but storage cost 5-10x higher than Loki for equivalent volumes. If you live in Kibana and rely heavily on full-text search of arbitrary fields, Elasticsearch wins. If you mostly grep for specific labels and time ranges, Loki wins on cost.

Should I use VictoriaMetrics instead of Prometheus?

VictoriaMetrics is genuinely excellent and a strong alternative โ€” better resource efficiency, better long-term retention out of the box, PromQL-compatible. The ecosystem (exporters, integrations, documentation) is smaller than Prometheus's but growing. Either choice is defensible in 2026.

What about OpenTelemetry?

OpenTelemetry is the emerging standard for instrumentation. The OTel Collector can export to Prometheus, Loki, Grafana Tempo, or any vendor โ€” making it the right unification layer. Use OTel for new instrumentation; keep existing Prometheus exporters where they already work.

How do I avoid Grafana dashboard sprawl?

Treat dashboards as code: store JSON in git, require PR review for new ones, maintain a curated "blessed" folder for the dashboards on-call uses, and aggressively delete unused ones (Grafana has built-in metrics for dashboard view counts).

Can this stack handle multi-tenancy?

Yes โ€” Prometheus via separate instances per tenant or via Mimir's native multi-tenancy; Loki has multi-tenancy built in via the X-Scope-OrgID header; Grafana via organizations or multiple instances. The complexity is real; use only if you actually have multiple isolated tenants to serve.

A Concrete Stack From a Real Mid-Sized Deployment

One platform team we worked with serves about 400 microservices across three Kubernetes clusters. Their stack: one Mimir installation backed by S3 (handling 8M active series across all clusters), Loki SSD mode ingesting about 200 GB/day, Grafana HA pair fronted by an internal load balancer. Total infrastructure cost: roughly $2,800/month, replacing a Datadog bill that would have been around $22,000/month at their volume. The trade-off: about 0.6 FTE of platform engineering time on observability operations. For their size, the math works overwhelmingly in favor of self-hosting; for smaller organizations it usually does not.

Further Reading from the Dargslan Library

The Bottom Line

Prometheus + Loki + Grafana is the dominant open-source observability stack for good reasons: mature, battle-tested, and dramatically cheaper than vendor SaaS at scale. Pay attention to the architecture decisions (single-binary vs distributed, retention strategy, where the stack runs relative to what it observes), set up alerts on symptoms users actually care about, and audit cardinality and log volume quarterly. Done right, you have observability that scales with your organization without becoming a budget line item your CFO highlights every month.

Share this article:
Thomas Ellison
About the Author

Thomas Ellison

Database Administration, Applied Mathematics, Technical Education, Documentation

Thomas Ellison is a database administrator and mathematics teacher with a strong focus on structured thinking, data integrity, and reliable system design.

He has extensive experience managing database systems in professional environments, ensuring performance, consistency, and long-term maintainability. His work includ...

Database Administration SQL Data Modeling Performance Optimization Mathematical Foundations

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.