我已经在我的应用程序中实现了 Dropwizard 指标。我正在使用以下代码向 Graphite 发送指标。
final Graphite graphite = new Graphite(new InetSocketAddress("xxx.xxx.xxx.xxx", xxxx));
final GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metricRegistry)
.prefixedWith(getReporterRootTagName())
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.filter(MetricFilter.ALL)
.build(graphite);
graphiteReporter.start(Integer.parseInt(getTimePeriod()), timeUnit);
我想添加自定义 MetricFilter,这样就不会将所有指标发送到 Graphite,而只会发送几个特定的指标。
例如。最大值、平均值、最小值、平均值。
请发布 MetricFilter 使用情况。