springboot actuator jvm监控丢失

编程入门 行业动态 更新时间:2024-10-22 10:35:30

<a href=https://www.elefans.com/category/jswz/34/1769943.html style=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监控丢失

本文发布于:2023-11-16 23:53:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634611.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:springboot   actuator   jvm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!