简体   繁体   English

需要一个找不到的“io.micrometer.core.instrument.MeterRegistry”类型的bean

[英]required a bean of type 'io.micrometer.core.instrument.MeterRegistry' that could not be found

Recently we upgraded spring-boot version to 2.7.2 and spring framework version to 5.3.22.最近我们将 spring-boot 版本升级到 2.7.2,将 spring 框架版本升级到 5.3.22。 Since then we are seeing this error in one of the apps从那时起,我们在其中一个应用程序中看到了这个错误

"required a bean of type 'io.micrometer.core.instrument.MeterRegistry' that could not be found." “需要一个找不到的 'io.micrometer.core.instrument.MeterRegistry' 类型的 bean。”

Spring documentation says that if there is a dependency called micrometer-registry-<?> then it will autowire the required MeterRegistry. Spring 文档说,如果有一个名为 micrometer-registry-<?> 的依赖项,那么它将自动连接所需的 MeterRegistry。 We do have that dependency in out project.我们在 out 项目中确实有这种依赖关系。 But it is not happening.但它没有发生。

We do have the following properties in application.yml.我们在 application.yml 中有以下属性。 But actuator is also not working但执行器也不工作

management:
  metrics:
    export:
      statsd:
        enabled: true
        flavor: datadog
        host: localhost
        port: 8125
  endpoints:
    web:
      exposure:
        include: "*"
  metrics:
    enabled: true

Can some one please tell me what i am missing here?有人可以告诉我我在这里缺少什么吗?

You need spring-boot-starter-actuator on your classpath.您的类路径上需要spring-boot-starter-actuator

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM