Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph old data using graphite and statsd

Can I enter timestamp to send data to graphite via statsd(javascript statsd)? I need to graph old data.

like image 689
avni goyal Avatar asked Aug 21 '12 08:08

avni goyal


1 Answers

No, you can't do that with statsd, however you can achieve the same by sending your data directly to carbon which accepts tiemstamps.

Statsd just collect real time data and on a configured period sums or average each metric received on that period and send it to graphite carbon daemon with current timestamp.

Sending data to carbon daemon it's very straight forward, you just need to open a socket to carbon common port (has another port if you want to use pickle), and then print on that socket one metric per line with following values: metric_name metric_value metric_timestamp

Carbon will store that value in that timestamp, and you can use any timestamp you want as long as it's in the range configured on the storage of that metric.

There are many examples around, like this one to send with netcat

There's also a Graphite client written in C

like image 61
Valor Avatar answered Oct 06 '22 13:10

Valor