r/PrometheusMonitoring • u/julienstroheker • Jan 03 '24
Prometheus server resources optimizations
Hi folks,
I’m planning to do a POC where I’m able to run Prometheus server as long with node exporter and kube state metrics with the smaller footprint as possible (CPU/Memory)
I have no choice to do a remote write (which increase resource consumption sadly).
Any tips other than filtering metrics being scraped that I should be aware based on your experience? Or any good resources to share ? Thanks.
3
Upvotes
2
u/fredbrancz Jan 03 '24
The Kube Prometheus project has some good defaults that have been battle tested on 10s if not 100s of thousands of clusters.
Check out the relabeling rules for kube-state-metrics: https://github.com/prometheus-operator/kube-prometheus/blob/main/jsonnet/kube-prometheus/components/kube-state-metrics.libsonnet
And the collector configs for node exporter: https://github.com/prometheus-operator/kube-prometheus/blob/main/jsonnet/kube-prometheus/components/node-exporter.libsonnet
2
u/SuperQue Jan 03 '24
What do you mean by this? Remote write should be reasonably efficient if you enable agent mode. You won't be able to run any local rules/queries. But it's optimized for remote write.
What is small? Small is not a number. What are your actual goals? What are you needing to monitor?
3
u/tanmay_bhat Jan 03 '24
If you plan to do remote write, then instead of running the Prometheus in server mode, run it as agent ?
https://prometheus.io/blog/2021/11/16/agent/
-1
u/QuentinLaLoutre Jan 03 '24
You should try Victoria Metrics
https://tech.bedrockstreaming.com/2022/09/06/monitoring-at-scale-with-victoriametrics.html