04-12-2017, 02:05 PM
I use Grafana and InfluxDB at work, and it's fairly quick and easy to set up for graphing time-series data (especially if you have a Docker host, which I do).  I decided it might be interesting to try integrating it with CQC.  There are a few ways to get data in, and one of the more straightforward methods is by doing an HTTP POST.  Here is an example of how you would do it using curl:
You can also log multiple points with one call, which is much more efficient:
I did a bit of searching in the forum but didn't immediately find anything.  Is there a way to do something like this in CQC?  If so, it would be fun to write a CML macro that runs periodically and logs various CQC device properties for graphing.
Code:
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
You can also log multiple points with one call, which is much more efficient:
Code:
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server02 value=0.67
cpu_load_short,host=server02,region=us-west value=0.55 1422568543702900257
cpu_load_short,direction=in,host=server01,region=us-west value=2.0 1422568543702900257'
I did a bit of searching in the forum but didn't immediately find anything.  Is there a way to do something like this in CQC?  If so, it would be fun to write a CML macro that runs periodically and logs various CQC device properties for graphing.