【发布时间】:2017-01-26 07:15:30
【问题描述】:
我写过这样的方法:
@Scheduled(fixedDelay = 10_000)
@Monitor(name = "componentMonitor", type = DataSourceType.COUNTER)
public int method() {
log.info("ping");
return RandomUtils.nextInt();
}
它被调用并且ping 出现在控制台中,但componentMonitor 没有出现在/metrics 中,这个指标不会发送到org.springframework.boot.actuate.autoconfigure.ExportMetricReader。那么如何配置servo/spectacor 来使@Monitor 注释起作用呢?
注意
通过com.netflix.spectator.api.Registry 报告其他指标有效。所以通常度量报告和伺服本身是有效的。
【问题讨论】:
标签: java spring spring-cloud netflix-servo