【问题标题】:Spring boot actuaor mix with micrometer for prometheus returnes empty result用于普罗米修斯的弹簧启动执行器与千分尺混合返回空结果
【发布时间】:2019-11-07 22:50:35
【问题描述】:

我将我的 Spring Boot 应用程序配置为导出 Prometheus 的执行器数据,如 https://www.callicoder.com/spring-boot-actuator-metrics-monitoring-dashboard-prometheus-grafana/ 中所述,但与文档不同的是,当我调用 /actuator/prometheus 时,会显示一个空白页面。

我做过的事情: - 添加 spring-boot-starter-actuator 依赖并检查结果(/actuator),它工作 - 添加 io.micrometer:micrometer-registry-prometheus 并检查结果(/actuator/prometheus)不起作用 - 更改 management.endpoints.web.exposure.include: "*",仍然 /actuator/prometheus 不起作用 - 使用上述配置和 /actuator/prometheus 创建一个新的空项目!

所以我的项目有问题

【问题讨论】:

    标签: spring-boot prometheus spring-boot-actuator spring-micrometer


    【解决方案1】:

    经过一整天的研究,我发现我的项目中有一个从 WebMvcConfigurerAdapter 扩展的类和一个覆盖 configureMessageConverters(List<HttpMessageConverter<?>> converters) 的方法,当我评论方法 /actuator/prometheus 时它会正常工作

    【讨论】:

    • 您也可以不将请求中的“Accept”HTTP 标头发送到执行器/prometheus。这样就不需要转换了。
    猜你喜欢
    • 1970-01-01
    • 2018-08-16
    • 2020-12-13
    • 1970-01-01
    • 2020-08-29
    • 2018-10-30
    • 2021-11-19
    • 1970-01-01
    • 2019-09-20
    相关资源
    最近更新 更多