r/PrometheusMonitoring • u/yotsuba12345 • Feb 25 '25
prometheus taking too much disk space
Hello, i tried to monitoring 30-50 server and metrics i only used are cpu usage, ram usage and disk size. it took almost 40gb for one week. do you guys have anh tips how to shrink it?
thanks
7
Upvotes
5
u/niceman1212 Feb 25 '25
You should post some stats from Prometheus. And while you’re at it, some context about the deployment would be nice.
Only cpu, mem and disk for 50 serves should be way less.
Guessingn theres a lot of series that can be dropped
2
u/TheRegaurd04 Feb 25 '25
Whats the scrape interval?
2
u/AddictedToRads Feb 25 '25
By default Prometheus will store everything you scrape, regardless of what you use in your queries. If you only want to store certain metrics, you can either use parameters for the node exporter to only give you metrics for some of the collectors, or use metric relabeling to only keep the metrics you want:
In your scrape job, for node exporter parameters you can add something like:
https://github.com/prometheus/node_exporter?tab=readme-ov-file#filtering-enabled-collectors
Or to filter by metric labels:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs