Reputation: 6578
I have deployed Grafana monitoring system, it saves the databases on "/home/user/data" directory, the problem is that the data persists for ever so the filesystem is full usage and I would like to remove this data, for example weekly.
Upvotes: 4
Views: 11069
Reputation: 7969
You do not say what data you would like to remove or what is generating all the data (it is logs?). It seems strange to just delete data from your database? Will your users not miss their dashboards?
I am going to assume you want to remove data from the database. There are a few ways to do this.
Save a clean copy of the Sqlite database and then replace the database file once a week. This will lose all your data.
For most data saved in the database, you could use the Grafana API to remove data.
An example, would be to remove dashboards. With curl and basic auth:
curl -X DELETE http://admin:admin@localhost:3000/api/dashboards/db/testdash
Use the sqlite cli to write sql queries to delete data directly.
Upvotes: 2