Graphite rendering scales data incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Graphite |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have a bunch of sparse data being fed in from StatsD. Because it's counter data, StatsD logs a "0" to carbon when no data is received in a given time period. Therefore the time series might look like:
0, 0, 0, 0, 100, 0, 0, 0, 0 ...
When I go to render this, the graph looks like a series of spikes. The problem is that the height of the spikes can change as I vary the time period. At 0 - 6 hours the height of the spikes will be 100, but at 0 - 5 hours the height will be 50. Is this a discretization issue? Is the rendering engine trying to interpolate between values for certain time periods?
The reason I think this is solely a rending issue is that the data is correct for all time periods when I fetch data using the JSON API.
Some thoughts (if it is indeed the rendering that is doing some interpolation):
- Perhaps it's an application/StatsD issue. ie: we shouldn't be logging "0" values when there is no data. That way graphite won't try and interpolate
- Maybe there should be an aggregationMethod variable for rendering, similar to storage-
Hmmm digging into the code I see that the TimeSeries class has a "consolidate" property that defaults to average... sounds promising, but how do I use it and change it to "sum"? Can someone point me to the documentation?