timescale / prometheus-postgresql-adapter

Use PostgreSQL as a remote storage database for Prometheus
Apache License 2.0
335 stars 66 forks source link

how to clean data in timescaledb #101

Open FunkyYang opened 4 years ago

FunkyYang commented 4 years ago

I hava running this in days,and the db size is too big for me,How can I cut this?

krisavi commented 4 years ago

If you are using TimescaleDB as well, probably could use something like: https://docs.timescale.com/latest/using-timescaledb/data-retention

If not, put pg_agent and scheduler to set up data retention using delete. I think that is the way to do it. The whole point of using DB as storage is to extend performance and having more reliable source for data retention than Prometheus internal file based storage that has the default retention period of 15 days. There are also ways to filter what Prometheus sends to adapter to cut down the data going to DB.