我应该怎么做才能使 "io.micrometer.core.instrument.MeterRegistry" 对象自动装配
what should I do to make "io.micrometer.core.instrument.MeterRegistry" object autowired
我试图在构造函数中使用 MeterRegistry 对象,但 Intelij 向我显示一条消息 Could not autowire. No beans of 'MeterRegistry' type found.
我正在使用这个依赖项:
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.5'
我在 application.properties 文件中有这些属性
management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
所以我想知道为什么 Spring 没有自动装配它?我在这里缺少什么?
您缺少执行器罐子:
实施(“org.springframework.boot:spring-引导启动器执行器”)
我试图在构造函数中使用 MeterRegistry 对象,但 Intelij 向我显示一条消息 Could not autowire. No beans of 'MeterRegistry' type found.
我正在使用这个依赖项:
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.5'
我在 application.properties 文件中有这些属性
management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
所以我想知道为什么 Spring 没有自动装配它?我在这里缺少什么?
您缺少执行器罐子: 实施(“org.springframework.boot:spring-引导启动器执行器”)