DEV Community

Alex Spinov
Alex Spinov

Posted on

Grafana Mimir Has a Free API: Horizontally Scalable Prometheus Without the Pain

Prometheus is great until you have 100 million active time series. Then it falls over. Grafana Mimir doesn't.

What Is Grafana Mimir?

Grafana Mimir is a horizontally scalable, highly available, multi-tenant time series database for Prometheus metrics. It's 100% Prometheus-compatible — same PromQL, same remote write API — but scales to billions of series.

Drop-In Prometheus Replacement

Point your existing Prometheus at Mimir and everything just works:

# prometheus.yml — just add remote_write
remote_write:
  - url: http://mimir:9009/api/v1/push
Enter fullscreen mode Exit fullscreen mode

That's it. Your Prometheus metrics now flow into a scalable backend. All your dashboards, alerts, and recording rules continue working.

The API

Mimir exposes a Prometheus-compatible query API:

# Instant query
curl 'http://mimir:9009/prometheus/api/v1/query?query=up'

# Range query
curl 'http://mimir:9009/prometheus/api/v1/query_range?query=rate(http_requests_total[5m])&start=2024-01-01T00:00:00Z&end=2024-01-02T00:00:00Z&step=60'

# Series metadata
curl 'http://mimir:9009/prometheus/api/v1/series?match[]=http_requests_total'

# Label values
curl 'http://mimir:9009/prometheus/api/v1/label/__name__/values'
Enter fullscreen mode Exit fullscreen mode

Every PromQL query you know works. Every Grafana dashboard works. Zero changes.

Why Mimir Over Prometheus

Feature Prometheus Mimir
Max series ~10M (single node) Billions (horizontal)
High availability Not built-in Built-in replication
Long-term storage Local disk Object storage (S3, GCS)
Multi-tenancy No Yes, built-in
Global view Federation (fragile) Native

Architecture

Prometheus → Distributor → Ingester → Object Storage (S3/GCS)
                                    ↓
Grafana ← Query Frontend ← Querier → Object Storage
Enter fullscreen mode Exit fullscreen mode

Each component scales independently. Need more write throughput? Add ingesters. More queries? Add queriers.

Quick Start

docker run -p 9009:9009 grafana/mimir:latest   -target=all   -server.http-listen-port=9009
Enter fullscreen mode Exit fullscreen mode

Building monitoring infrastructure? Check out my automation tools or email spinov001@gmail.com.

Top comments (0)