【问题标题】:spring.metrics.export.statsd.prefix on Spring boot 2.1.6Spring Boot 2.1.6 上的 spring.metrics.export.statsd.prefix
【发布时间】:2019-08-12 13:21:03
【问题描述】:

在 Spring Boot 2.1.6 上,他们更改了属性文件中 statsd 的配置。

所以

spring.metrics.export.statsd.host=localhost
spring.metrics.export.statsd.port=8125

改为

management.metrics.export.statsd.host=localhost
management.metrics.export.statsd.port=8125

但是没有

management.metrics.export.statsd.prefix=myapp

是否有任何等效的方法可以获得相同的结果

spring.metrics.export.statsd.prefix=myapp

【问题讨论】:

  • 你有这个问题的答案吗?你可以让我在这里吗?

标签: spring-boot statsd


【解决方案1】:

这里的答案是,statsd 的前缀已在 micrometer->statsd 中删除。我们需要自己为需要从代码发送到 statsd 的指标附加前缀。

目前,它正在向 statsd -> 石墨发送指标。 注意:将其附加到 counter 和 gauges 的 builder 方法中。

【讨论】:

  • 你能分享一个如何做到这一点的代码示例吗?
  • 在要添加计数器/量具名称的位置添加前缀(前缀 + + counterName)
猜你喜欢
  • 2021-08-11
  • 2020-04-10
  • 1970-01-01
  • 2019-12-20
  • 1970-01-01
  • 2020-11-01
  • 1970-01-01
  • 2019-11-09
  • 1970-01-01
相关资源
最近更新 更多