prometheus delete old data files

2,290 views
Skip to first unread message

Johny

unread,
Sep 12, 2020, 9:35:30 PM9/12/20
to Prometheus Users
I am reducing data retention from 20 days to 10 days in my Prometheus nodes (v. 2.17). When I change storage.tsdb.retention.time to 10d and restart my instances, this does not get delete data older than 10 days. Is there a command to force cleanup?

In general, what is best practice to delete older data in Prometheus? 


Ben Kochie

unread,
Sep 13, 2020, 3:28:46 AM9/13/20
to Johny, Prometheus Users
TSDB blocks are automatically cleaned up, but it does this on the 2 hour block management schedule. Blocks also must be fully expired (maxTime) before they are deleted.

You probably just need to wait for the maxTime on the oldest block to expire. Look in the meta.json in the TSDB block directories.

On Sun, Sep 13, 2020 at 3:35 AM Johny <mailitt...@gmail.com> wrote:
I am reducing data retention from 20 days to 10 days in my Prometheus nodes (v. 2.17). When I change storage.tsdb.retention.time to 10d and restart my instances, this does not get delete data older than 10 days. Is there a command to force cleanup?

In general, what is best practice to delete older data in Prometheus? 


--
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/e883c687-6534-4562-a775-575e81289e4bn%40googlegroups.com.

Johny

unread,
Sep 15, 2020, 10:05:33 AM9/15/20
to Prometheus Users
Great, thanks. I will make this change and verify the behavior.
Reply all
Reply to author
Forward
0 new messages