Grafana/Graphite – no graphs/data points after 1 day

Grafana/Graphite doesn’t show any data points after the past 24 hours / 1 day. My problem was the retention configuration in carbon.

You can find it under:

/etc/carbon/storage-schemas.conf

In this file you can declare the timespan configuration.
You can set how long the data points are stored and how accurate the data is after different periods.

[default_1min_for_1day]
pattern = .*
#retentions = 60s:1d
retentions = 1m:2d,5m:10d,30m:90d,360m:4y

The default retention config just saves the data points for 24 hours/1 day with a precision if 60 seconds.
I configured it that 2 days have the accuracy of 1 minute, the last 10 days have a accuracy of 5 minutes and so on.
This means that the data is downsampled and also the disk space is less used.

When you edit your storage-schemas.conf you’ll think you can restart your system and it works. But that’s not everything.

The data points are getting saved in .wsp files and i think that in those files the time ranges with the accuracy are hardcoded.
This means that you have to reconfigure all of those files with a command like this:

root@monitoring:/usr/bin# find /var/lib/graphite/whisper/ -type f -name
 "*.wsp" -exec whisper-resize {} 1m:2d,5m:10d,30m:90d,360m:4y \;
 Traceback (most recent call last):
 File "/usr/bin/whisper-resize", line 70, in 
 for retentionDef in args[1:]]
 File "/usr/lib/python2.7/dist-packages/whisper.py", line 122, in
 parseRetentionDef
 (precision, points) = retentionDef.strip().split(':')
 ValueError: too many values to unpack
 Traceback (most recent call last):
 File "/usr/bin/whisper-resize", line 70, in 
 for retentionDef in args[1:]]
 File "/usr/lib/python2.7/dist-packages/whisper.py", line 122, in
 parseRetentionDef
 (precision, points) = retentionDef.strip().split(':')
 ValueError: too many values to unpack
 Traceback (most recent call last):
 File "/usr/bin/whisper-resize", line 70, in 
 for retentionDef in args[1:]]

As you can see this didn’t worked for me so i took a other method. 😀

 cd /var/lib/graphite/whisper/
 rm -fr *

I removed all of the files and folders and after a reboot and 15 minutes all folders and files were regenerated. Also the graphs were doing their job again. But be in mind that if you remove everything your graphs disappear from the past 😉 So if you want to keep them search for whisper-resize and try it out.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.