Minimal wrapper library for general metrics writing using telegraf. Telegraf is a micro service provided by InfluxData for making metrics reporting easy for multiple services - see their docs for more information.
Install
Add it to your Cargo.toml:
[dependencies]
telegraf = "0.2.1"
Usage
Using this library assumes you have a socket listener input setup in your telegraf config, like so (currently only tcp is supported, but udp and unix are planned):
[[inputs.socket_listener]]
service_address = "tcp://localhost:8094"
Example usage:
use ;
let c = new.unwrap;
let p = point!;
c.write_point
Or directly from the Point::new
method:
use ;
let c = new.unwrap;
let p = new;
c.write_point
The second value in the field tuples can be any type that implements the IntoFieldData
trait provided by this lib. Out of the box support is provided for common types. You can always implement this trait on your own custom types or types I forgot!