0
votes

I'm using graphite, when i send the metric stats_count it shows up in the metrics data points json, but after some time it resets to zero.

ex: initially [0, 1426770240] [449.968673, 1426770300] later [0, 1426770240] [0, 1426770300] [0, 1426770360]

retentions = 10s:7d,5m:30d,15m:5y

1

1 Answers

0
votes

You're likely using a wrong aggregation function in Graphite, so it's aggregating your counts by averaging them instead of summing them up.

From https://kevinmccarthy.org/blog/2013/07/18/10-things-i-learned-deploying-graphite/#aggregating-data-what:

The other thing that can trip you up is aggregating counts. What happens when we average 60 seconds of counts? Well, we lose around 1/60th of the events that happened. So for count statistics, we actually want to sum the number of times that something happened.

Check this section on the statsd docs about how to configure Graphite for statsd. The key here is:

# conf/storage-aggregation.conf:
[count]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum

As you can see the aggregation method used is sum. By default Graphite averages metrics when downsamping.