use of io.dropwizard.metrics.influxdb.InfluxDbHttpSender in project light-4j by networknt.
the class SendToLocalInfluxDB method startInfluxDbReporter.
private static InfluxDbReporter startInfluxDbReporter(MetricRegistry registry) throws Exception {
final InfluxDbHttpSender influxDb = new InfluxDbHttpSender("http", "127.0.0.1", 8086, "dropwizard", "root", "root");
final Map<String, String> tags = new HashMap<>();
tags.put("host", "localhost");
final InfluxDbReporter reporter = InfluxDbReporter.forRegistry(registry).withTags(tags).skipIdleMetrics(true).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL).build(influxDb);
reporter.start(10, TimeUnit.SECONDS);
return reporter;
}
Aggregations