0
我在我的應用程序中實現了Dropwizard指標。我使用下面的代碼向Graphite發送指標。如何在GraphiteReporter中添加自定義MetricFilter以僅發送選定的公制
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,這樣,而不是發送所有指標在石墨只有少數特定的指標將被髮送。
例如。最大,平均,最小,僅意味着。
請發佈MetricFilter用法。
謝謝,我想我沒有正確發佈我的問題。實際上我要篩選的定時器指標**計數 平均速率 1分鐘速率 5分鐘的速率 15分鐘的速率 分鐘 最大 意味着 STDDEV 位數 75% 95% 98% 99 % 99.9%**我想要某種方式只將選定的人發送給Graphite。 –
嗯,所以你想要過濾所有這些出/入?你列出的是按計時器/米報告的。如果你想過濾所有這些應該很容易。如果你只想要其中的一部分,這是一個令人討厭的解決方法,但它應該工作 - 那它是哪一個? –
是的,你是對的,我只想**計數,平均數,最小值,最大值**,並且除了默認的1,5,15分鐘之外,在計時器指標中有X分鐘的持續時間是否可行? –