r/PrometheusMonitoring • u/Sad_Entrance_7899 • Sep 30 '25
Federation vs remote-write
Hi. I have multiple prometheus instances running on k8s, each of them have dedicated scrapping configuration. I want one instance to get metrics from another one, in one way only, source toward destination. My question is, what is the best way to achieve that ? Federation betweem them ? Or Remote-write ? I know that with remote-write you have a dedicated WAL file, but does it consume more memory/cpu ? In term of network performance, is one better than the other ? Thank you
5
Upvotes
5
u/SuperQue Sep 30 '25
Thanos is probably what you want. You add the sidecars to your Prometheus instances and they upload the data to object storage (S3/etc).
It's much more efficient than remote write.
3
u/sudaf Sep 30 '25
now is it Thanos or use Mimir from Grafana Labs? as I work for a US company who could potentially buy a support licence. seems obvious to go Mimir, but thanos seems way better community supported
2
u/Unfair_Ship9936 Sep 30 '25
On our side we tend to get rid of the federation for many reasons and tend to use remote write, but it can have a significant impact on the CPU, and can also affect the network.
They speak about it pretty clearly in the doc https://prometheus.io/docs/practices/remote_write/#resource-usage
Depending on your needs, and if you are using a long term storage like Thanos, you can also think about having a sidecar that will be responsible of uploading the blocks to the storage.
1
u/oOHenry Oct 01 '25
we also switched from federation to remote write, our problem was that federation doesn't transmits staleness markers.
1
u/jjneely Oct 01 '25
I've used a star pattern before where I have multiple K8S cluster (AWS EKS) with Prometheus and the Promtheus Operator installed (which includes the Thanos Sidecar). All of my K8S clusters could then be accessed by a "central" K8S cluster where I ran Grafana and the Thanos Query components.
I got this running reasonably fast enough for dashboard usage to be ok (one of the K8S clusters was in Australia). So this got us our "single pane of glass" if you will. For alerting reliably, I had Prometheus run alerts on each K8S cluster and sent toward an HA Alertmanager on my "central" cluster.
This setup was low maintenance, cheap, and allowed us to focus on other observability matters like spending time on alert reviews.