What you will learn in this TP
- Configure Mimir with object storage
- Connect Prometheus via remote_write
- Query Mimir from Grafana
Introduction #
What you will learn in this section
- Configure Mimir with object storage
- Connect Prometheus via remote_write
- Query Mimir from Grafana
Context. Your team wants to centralise the metrics from several Prometheus servers and keep them for a year. Before sizing a cluster, you build a complete prototype on your workstation.
Prerequisites: Docker Compose, basic knowledge of Prometheus and PromQL · Estimated time: 45 min
A first remote_write → Mimir → Grafana pipeline.Setup #
Guided steps, with their solutions.
1. Write mimir.yaml
Why? Mimir needs to know where to store blocks, rules and the alerting configuration; in monolithic mode with a single process, the replication factor must be lowered to 1.
Write the Mimir configuration: S3 storage pointing to MinIO, three separate buckets, multi-tenancy disabled and replication set to 1.2. Connect Prometheus
Why? Prometheus keeps its role as the collector; Mimir is the one that stores and serves the history.
Write aprometheus.ymlthat scrapes Prometheus itself and Mimir (mimir:8080), with an external labelclusterand aremote_writeto Mimir.3. Start the stack
Why? A reproducible Compose file lets you restart the lab from scratch at any time.
Write thedocker-compose.yml(MinIO, Mimir, Prometheus, Grafana), start it and wait until Mimir is ready.4. Check ingestion
Why? Before opening Grafana, make sure the samples are actually arriving and are not being rejected.
Query the Mimir Prometheus API to count the series of themimirjob, then check that no sample has been rejected.5. Add the data source in Grafana
Why? For Grafana, Mimir is just another Prometheus data source: only the
Create a Prometheus-type data source pointing to Mimir and plot/prometheusprefix changes.rate(cortex_distributor_received_samples_total[1m]).6. See the blocks in MinIO
Why? The first block is only uploaded once a 2-hour period closes: it is normal not to see anything straight away.
Open the MinIO console (localhost:9001) or usemcto list the blocks bucket after two hours.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Why Grafana Mimir? Architecture and deployment modes
The limits of Prometheus alone, what Mimir brings (long-term storage, high availability, multi-te...
Mimir: the write path (distributor, ingesters, replication and HA deduplication)
How Mimir ingests metrics: remote_write, distributor validation and limits, hash ring, ingester r...
Thanos, Grafana Mimir or VictoriaMetrics: which long-term storage for Prometheus?
Detailed comparison of three long-term storage solutions for Prometheus: architecture, storage, h...
The LGTM stack (Loki, Grafana, Tempo, Mimir): architecture and setup
Understand Grafana Labs' LGTM stack: Loki for logs, Grafana for visualization, Tempo for traces a...
Mimir: compactor, retention and object storage
Configure Mimir object storage (S3, GCS, Azure, MinIO), understand compaction and split-and-merge...
Mimir: ruler, Alertmanager and mimirtool
Evaluate recording and alerting rules in Mimir, configure the multi-tenant Alertmanager and autom...
Grafana Mimir best practices: architecture, limits, costs and operations
Production checklist for Grafana Mimir: architecture, zone-aware replication, per-tenant limits, ...
Mimir: the read path (query-frontend, querier, store-gateway and caches)
How Mimir answers a PromQL query: query-frontend splitting and caching, queue, queriers, store-ga...
Grafana Pyroscope architecture and deployment
Pyroscope components (distributor, ingester, querier, store-gateway, compactor), object storage, ...