Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to fill in missing data in graphite when using statsD?

I'm using statsD to report counter data to graphite; sends a tick everytime I get a message. This works great, except in the situation when statsD has to restart for whatever reason. Then I get huge holes in my graphs, since statsD is now no longer sending '0' every 10 seconds for periods when I didn't get any messages.

I'm reporting for various different message types and queues, and sometimes I don't get a message for a particular queue for a long time.

Is there any existing way to 'fill-in' the missing data with a default value I specify (in my case this would be 0)?

I thought about sending a '0' count for a given metric so that statsD starts sending 0's for it, but I don't always know the set of metrics I'll be reporting in advance.

like image 331
BigBen Avatar asked Dec 06 '12 04:12

BigBen


Video Answer


2 Answers

Check out the function transformNull that Graphite provides. e.g.

transformNull(stats.timers.deploys.all.duration.total.mean, 0)

This will map sections with null data to 0.

like image 118
ferrouswheel Avatar answered Oct 24 '22 08:10

ferrouswheel


You can use the "keepLastValue(requestContext, seriesList)" function in graphite to deal with missing data. It "[c]ontinues the line with the last received value when gaps (‘None’ values) appear in your data, rather than breaking your line."

like image 12
perfectfromnowon Avatar answered Oct 24 '22 08:10

perfectfromnowon