Issue
I'm trying to use MeterRegistry object in the constructor, but Intelij show me a message Could not autowire. No beans of 'MeterRegistry' type found.
src="https://i.stack.imgur.com/XRG7k.png" alt="enter image description here" />
I'm using this dependency:
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.5'
I have these properties in application.properties file
management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
so I'm wondering why it's not autowired by Spring ? what I'm missing here ?
Solution
you are missing actuator jar : implementation("org.springframework.boot:spring-boot-starter-actuator")
Answered By - hitesh
Answer Checked By - Katrina (JavaFixing Volunteer)