Skip to content

Data Metrics cleanup (Prometheus windows Version) #12786

Answered by roidelapluie
AboSalah-1982 asked this question in Q&A
Discussion options

You must be logged in to vote

To set a time-based data retention policy in Prometheus on Windows, use the --storage.tsdb.retention.time flag:

prometheus.exe --storage.tsdb.retention.time=5d

To set a size-based retention policy, use the --storage.tsdb.retention.size flag:

prometheus.exe --storage.tsdb.retention.size=5GB

You can combine both flags to enforce both time and size limits:

prometheus.exe --storage.tsdb.retention.time=5d --storage.tsdb.retention.size=5GB

Update these flags in your service configuration if you're running Prometheus as a service, then restart it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AboSalah-1982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #12752 on September 03, 2023 21:08.