2

Is there any configuration to delete older carbon data automatically after certain period of time?

I tried searching it but could not find anything about it.

Thanks in advance for any suggestion and answer.

Machavity
  • 30,841
  • 27
  • 92
  • 100
Sachin Singh
  • 7,107
  • 6
  • 40
  • 80

2 Answers2

4

Graphite as such doesn't support deletion yet. I would advice decreasing the storage-schema to store data only until the point you need it, so as to really solve this 'problem'.

Still- you can run a cron at regular intervals to do so. The following would delete any wsp file that hasn't been touched in a day-

Using GNU find:

find /opt/graphite/storage/whisper/* -name '*\.wsp' -mtime 1 -delete

Yaron
  • 1,199
  • 1
  • 15
  • 35
erbdex
  • 1,899
  • 3
  • 22
  • 40
0

Is this for whisperfiles that are no longer being written to? Or is this just for older data in an existing metric?

if the former you can run something like

find <whisperpath> -iname "*.wsp" -mtime +<number of days lower limit>

that will list how many that fit the criteria, if you want to delete them in the same command append -delete

find <whisperpath> -iname "*.wsp" -mtime +<number of days lower limit> -delete
Fred S
  • 26
  • 2