【问题标题】:Is there a property in micrometer than can disable sending SFx metrics?是否有以微米为单位的属性可以禁用发送 SFx 指标?
【发布时间】:2020-02-03 09:20:14
【问题描述】:
我正在开发一个 spring-boot 项目,该项目使用 SignalFx (APM) 进行监控,使用千分尺和执行器完成检测。
当我在本地运行应用程序时,即当我的个人资料设置为 local 时,我不希望将指标发送到 SFx。
是否有可用于禁用从本地发送的指标的属性?
我可以配置配置文件的特定属性。
【问题讨论】:
标签:
monitoring
spring-boot-actuator
micrometer
spring-micrometer
apm
【解决方案1】:
看看org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration中的spring-boot-actuator-autoconfigure模块Available Here
此类加载与 SignalFx 相关的 bean。
仅当属性management.metrics.export.signalfx.enabled 具有值true 或根本未定义时才会加载。
因此,在本地配置文件中,您可以创建 application-local.properties 文件,该文件将包含:
management.metrics.export.signalfx.enabled=false
当然,基于 yaml 的配置也是如此。