1
votes

I have a Spring Boot Application and I have this dependency:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
  <version>2.1.7.RELEASE</version> // From Parent
</dependency>

I have also configured my application.yml file to expose metrics:

management:
  endpoints:
    web:
      exposure:
        include: info, health, metrics

I have also created a Metrics bean for Kafka:

@Bean
public KafkaConsumerMetrics kafkaConsumerMetrics() {
  return new KafkaConsumerMetrics();
}

But when I hit the endpoint GET http://localhost:8080/actuator/metrics I get a 404 Page Not Found error.

The other endpoints (info/health) works: http://localhost:8080/actuator/info and http://localhost:8080/actuator/health

What am I missing to get micrometer data?

1
Do you have spring security for restricted endpoints? - Mahendran Ayyarsamy Kandiar
I don't think I do. How do I check or disable it? - George
Posted my answer. Let me know if it helped - Mahendran Ayyarsamy Kandiar

1 Answers

4
votes

you can try enabling metrics from the configuration, though it should be enabled by default

management:
  endpoint:
    metrics:
      enabled: true

More details on actuator properties https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#actuator-properties