【发布时间】:2018-04-17 08:00:55
【问题描述】:
我正在使用spring-boot 2 和graphite。我想为我的所有指标添加前缀。
@Bean
public MeterRegistry graphiteRegistsry() {
return new GraphiteMeterRegistry(
GraphiteConfig.DEFAULT, Clock.SYSTEM,
(id, convention) -> "prefix." +
HierarchicalNameMapper.DEFAULT.toHierarchicalName(id,convention));
}
如果我使用此代码,这实际上是添加前缀,但也会创建一些没有前缀的指标。似乎他们几乎所有的指标都是重复的。
如何添加此前缀?并且从这个应用程序到石墨的所有指标都将包含前缀?
谢谢。
【问题讨论】:
标签: java spring-boot metrics graphite micrometer