Skip to content

A reporter for metrics which announces measurements to an InfluxDB server.

License

Notifications You must be signed in to change notification settings

isabella232/metrics-influxdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The library provide :

  • a lighter client than influxdb-java to push only series to an InfluxDB server.
  • A reporter for metrics which announces measurements.

The library provide a lighter client than influxdb-java to push only metrics.

Dependencies :

  • slf4j-api for logging.
  • metrics-core, to provide, if you use InfluxdbReporter.

Usage sample :

private static InfluxdbReporter startInfluxdbReporter(MetricRegistry registry) throws Exception {
	final InfluxdbHttp influxdb = new InfluxdbHttp("127.0.0.1", 8086, "mydb", "user", "pass"); // http transport
	// = new InfluxDbUdp("127.0.0.1", 1234); // udp transport
	//influxdb.debugJson = true; // to print json on System.err
	//influxdb.jsonBuilder = new MyJsonBuildler(); // to use MyJsonBuilder to create json
	final InfluxdbReporter reporter = InfluxdbReporter
			.forRegistry(registry)
			.prefixedWith("test")
			.convertRatesTo(TimeUnit.SECONDS)
			.convertDurationsTo(TimeUnit.MILLISECONDS)
			.filter(MetricFilter.ALL)
			.skipIdleMetrics(true) // Only report metrics that have changed.
			.build(influxdb);
	reporter.start(10, TimeUnit.SECONDS);
	return reporter;
}

CC0
To the extent possible under law, Novaquark has waived all copyright and related or neighboring rights to this work.

Bitdeli Badge

About

A reporter for metrics which announces measurements to an InfluxDB server.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%