1
votes
  • I downloaded statsd and graphite 0.9.x
  • I used the stats-client provided with source of statsd as follows:
    • ./statsd-client.sh 'development.com.alpha.operation.testing.rate:1|c'
  • I did the above operation 10 times.

Then I tried querying for a summary for last 24 hours:

http://example.com/render?format=json&target=summarize(stats.development.com.alpha.operation.testing.rate, "24hours", "sum",true)&from=-24hours&tz=UTC

I get 1 datapoint as follows:

"datapoints": [[0.0, 1386277560]]}]

Why I am getting 0.0? Even Graphite Composer does not display anything

I was expecting a value of "10" as I performed the operation 10 times. What did I do wrong?

storage-schemas.conf

[carbon]
pattern = ^carbon\.
retentions = 60:90d

[default_1min_for_1day]
pattern = .*
retentions = 60s:1d

Please help me understand the problem.

EDIT:

As per answer below, I changed storage-aggregation and I get following response after running whisper-info on metric_file.wsp. But I am still getting "0.0" as value in datapoint and Graphite browser does not display anything.

maxRetention: 86400
xFilesFactor: 0.0
aggregationMethod: sum
fileSize: 17308

Archive 0
retention: 86400
secondsPerPoint: 60
points: 1440
size: 17280
offset: 28

I also looked at stats_counts Tree as suggested in another answer, but its the same.

What is wrong with my setup. I am using default setting for everything but the changes suggested by an answer below in storage-aggregation

2
Use carbon's debug logs. Refer- stackoverflow.com/questions/20406789/… - erbdex
1. It means that graphite will store one data-point every 60 seconds for 1 day. So technically, the data that you send across to graphite is chipped into 60s intervals and stored. Here, according to your config, the expected behavior is that Graphite sums up whatever it gets within that 60s window. xfilesfactor means that do write to the file even if you receive very few datapoints in the window. - erbdex
2. If you do not apply summarize(), what is the nature of the graph? All zeroes? - erbdex
2. Yes, without summarize all are null but last two are 0.0. I ran ./statsd_client.sh 10 times in less than 20secs. After sometime, if I query again, last 5 are 0.0 - GJain
summarize() will render the same result, unless that 5 min interval falls on both sides of the 24 hour window. Try this- put the metric sending script into an infinite loop with a 1 second sleep. - erbdex

2 Answers

5
votes

Within the whisper package, you will get a script- whisper-info.py. Invoke it on the appropriate metric file-

/whisper-info.py /opt/graphite/storage/whisper/alpha/beta/charlie.wsp

You will get something like this-

maxRetention: 31536000
xFilesFactor: 0.0
aggregationMethod: sum
fileSize: 1261468

Archive 0
retention: 31536000
secondsPerPoint: 300
points: 105120
size: 1261440
offset: 28

Here, make sure that aggregationMethod is sum, and xFilesFactor is 0.0. Most probably it is not, since this isn't graphite's default behavior. Now make a regex that picks up your metrics and put it at the beginning of the config file storage-aggregation.conf. This will ensure that the newly created metrics follow this new aggregation rule. You can read more about how xFilesFactor works here.

1
votes

Have you tried using the stats_counts tree instead of stats? StatsD populates both for regular counters. stats by default does some fancy averaging which can tend make low-intensity stat signals disappear, whereas stats_counts just gives you the straight-up count, which sounds like what you want.