How and where to set Storage retention configuration?

11,632 views
Skip to first unread message

Digambar Dinde

unread,
Jan 31, 2018, 2:30:34 AM1/31/18
to Prometheus Users
I want to store scraped data for a month on prometheus server. Now data is getting deleted in 15 days.

vteja...@gmail.com

unread,
Jan 31, 2018, 2:41:45 AM1/31/18
to Prometheus Users
Hi,

If you run Prometheus help, you can see some attribute like:
./prometheus -h
--storage.tsdb.retention=15d   How long to retain samples in the storage.

If you want it for 1 month, set this to
--storage.tsdb.retention=30d

Time durations are specified as a number, followed immediately by one of the following units:

  • s - seconds
  • m - minutes
  • h - hours
  • d - days
  • w - weeks
  • y - years
Please correct if I am wrong.

BR,
Teja

Digambar Dinde

unread,
Jan 31, 2018, 4:13:34 AM1/31/18
to Prometheus Users
Thanks, should we set this flag while starting prometheus server? and where to set it?

vteja...@gmail.com

unread,
Jan 31, 2018, 4:21:40 AM1/31/18
to Prometheus Users
Yes, should be set before you start it

g...@recongate.com

unread,
Jun 6, 2018, 3:00:14 AM6/6/18
to Prometheus Users
Is there a place where i can configure the retention so that it will work even after reboot (perhaps a config file)?

Ben Kochie

unread,
Jun 6, 2018, 3:26:33 AM6/6/18
to Gil Goldberger, Prometheus Users
Yes, you include it in however you start your server, init script, systemd unit, etc.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/73a84ed1-942a-4377-af90-71494a9f5914%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

bp3...@gmail.com

unread,
Apr 15, 2019, 1:30:23 PM4/15/19
to Prometheus Users
Is there a way to turn off the retention completely? (i.e. retain everything). Or should I just set my limit to a very high number? (e.g. 5 years)

Ben Kochie

unread,
Apr 15, 2019, 1:38:31 PM4/15/19
to bp3...@gmail.com, Prometheus Users
Setting to a high number like 10 years is the typical solution.

--
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/ea1022fb-79b1-447b-a7a9-a9efef17246b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages