Hey everyone! 👋
This week I spent some time learning about Thanos — not the Marvel villain, but the one that works with Prometheus for monitoring in Kubernetes.
I’ll be honest — when I first heard about Thanos, I thought “Sounds complicated.”
And you know what? It kind of is… but it’s also super useful once you get the hang of it.
I didn’t build anything fancy, but I did get a minimal setup working: Prometheus + Thanos Sidecar + MinIO + a simple Go app exporting custom metrics. Along the way, I picked up a few interesting lessons worth sharing.
🌐 What Even Is Thanos?
If you’re using Prometheus for monitoring, Thanos helps you:
- Store metrics for a long time (not just a few days).
- Query metrics across multiple Prometheus instances.
- Avoid duplicate data if you’re running Prometheus in high availability mode.
Basically: it makes Prometheus smarter, stronger, and more scalable. Think of it like giving Prometheus a cloud brain.
🧪 What I Tried
Here’s what I set up (with a lot of Googling and head-scratching):
- Sidecar: This sits next to Prometheus and helps upload data to a bucket (like S3).
- Store: Reads data back from that bucket when you want to query old metrics.
- Query: Lets you run PromQL queries across all your data — even from multiple clusters.
- Compactor: Cleans up and organizes your stored metrics data.
📌 Why I’d Use Thanos Again
If you:
- Use Prometheus for metrics.
- Need to keep metrics longer than a few days.
- Or want to monitor multiple clusters. …Thanos is worth checking out. It takes some time to get it running, but the payoff is great once you do.
🚀 Want to Try It Yourself?
If you're curious and want to spin it up yourself, I’ve the whole setup here:
👉 GitHub Repo: github.com/RokibulHasan7/thanos-demo
It includes all the manifests to deploy:
- Prometheus.
- Thanos Sidecar, Compactor, Store, and Query.
- MinIO as the object store.
- The demo Go app exposing metrics.
You’ll find step-by-step instructions in the README to try everything locally.
Top comments (0)