springboot actuator jvm监控丢失"/>
springboot actuator jvm监控丢失
1、背景
系统接入了监控prometheus和grafana,某天grafana突然发现只有几台机器可以看到指标。
随便点击一个地址http://192.168.0.76:8681/lms/actuator/prometheus访问指标,发现JVM相关指标全部丢失
2、解决方法
从网上查找相关资料,逐一排查,发现可能是组件问题、配置文件或者是依赖的版本问题。
检查git代码,没发现配置或者依赖的变动。
参考文档:/
然后在项目的启动类里注入bean就行了
@Bean
@Lazy(value = false)
InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor, PrometheusMeterRegistry registry) {return () -> meterRegistryPostProcessor.postProcessAfterInitialization(registry, "");
}
更多推荐
springboot actuator jvm监控丢失
发布评论