A library for posting metrics to a Carbon daemon.
- A Spark Core
- A Carbon daemon
- Set up a TCPClient to use with SparkCarbon.
- Instantiate the SparkCarbon library. We'll use a variables named
tcpClient
andcarbon
for this example. - In
setup()
, "begin" the library usingcarbon.begin()
.carbon.begin()
will work with a few variations.- IP Address without port (defaults to 2003):
carbon.begin(tcpClient, { 127, 0, 0, 1 });
- IP Address with port:
carbon.begin(tcpClient, { 127, 0, 0, 1}, 2003);
- DNS name without port (defaults to 2003):
carbon.begin(tcpClient, "my-carbon-server.mydomain.com", 2003);
- DNS name with port:
carbon.begin(tcpClient, "my-carbon-server.mydomain.com", 2003);
- IP Address without port (defaults to 2003):
- Finally, elsewhere in your code, you can use
carbon.sendData("stats.spark-test", 1, 1302905160)
(metric, value, timestamp) to post data to your Carbon daemon.