does Prometheus always preserve raw metrics?

25 views
Skip to first unread message

sam j

unread,
Mar 18, 2020, 7:15:04 PM3/18/20
to Prometheus Users

I couldn't get a clear answer from online references. Does Promestheus always keep raw metrics in storage in addition to records set up in recording rules configuration containing aggregations? Is there a way to discard raw metrics after evaluation interval? This is especially useful in a master-slave topology where the higher level nodes (master) store only aggregated data after federating metrics from slave nodes. A number of articles mention this but none clarify if and how long raw data is stored in master collected from slaves.

Brian Candler

unread,
Mar 19, 2020, 5:03:14 AM3/19/20
to Prometheus Users
The original metrics are stored as well as the aggregated ones.  This is so that (for example) you can run alerting rule queries directly on the original metrics.

If you are federating, then you can set a short retention period - say 1 day.  This will apply to everything, both raw and aggregated metrics.

sam j

unread,
Mar 19, 2020, 10:55:36 AM3/19/20
to Prometheus Users
Thanks. So there is no way to set retention times for raw and aggregated metrics differently? e.g. I want to keep the agg metrics for 1 month but discard raw metrics everyday.

Ben Kochie

unread,
Mar 19, 2020, 10:57:06 AM3/19/20
to sam j, Prometheus Users
This is part of what Federation is designed to do. You federate the stuff you want to keep longer, and reduce the retention for the raw collector.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/44c6dc44-4ecb-4e7b-bf4a-487c9f33c99f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages