This could be operator error, but I'm seeing very strange behavior when building graphs in Grafana. I've tried to provide a minimal example case below, which shows that a metric recorded using increment, which should result in the c counter type in the statsd protocol, gets incorrectly rolled up across time buckets, as if Graphite thinks it is a gauge metric:
In the first response, we see 8 increment events for the metric, but in the second response there are only 6. The same glitch happens if I change the time window from 24hr to 48hr, of course, so I can't build correct graphs on this metric. Am I using Graphite wrong? Is the metric stored using the wrong type?
Strangely, in this example I see the data rolled up correctly:
https://graphite.wikimedia.org/render?target=MediaWiki.FileImporter.error.byRecoverable.false.byType.duplicateFiles.sum&from=1560095200&until=1560981659&format=json&noNullPoints=1
->
I have a punchline. The default consolidateBy function is to average data points in each time bucket. This is only correct behavior for a gauge, but not for a counter. AFAICT, graphite has no concept of metric type, so I'm pretty sure this is doing the wrong thing in... lots of graphs. In our case, I was able to get the expected totals by wrapping the sumSeries like so:
consolidateBy(sumSeries(MediaWiki.FileImporter.error.byRecoverable.*.byType.*.sum), 'sum')