Spring Boot 2 - Actuator Metrics Endpoint not working

前端 未结 12 1360
迷失自我
迷失自我 2020-12-08 00:35

In my Spring Boot App (2.0.0.M7) application.properties I set

management.endpoint.metrics.enabled=true

However, when i hit

         


        
相关标签:
12条回答
  • 2020-12-08 01:20

    You need to add the below props in your application.properties file. I had the same issue until I added the below props.

    management.endpoints.beans.enabled=false
    management.endpoints.web.exposure.include=*
    
    0 讨论(0)
  • 2020-12-08 01:20

    Had the same issue upgrading from Spring Boot 1.5.15 to 2.1.4

    Needed to modify the original dependency for the Spring Boot actuator in my pom.xml from:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-actuator</artifactId>
    </dependency>
    

    to:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    

    notice the addition of the word starter in the artifactId.

    0 讨论(0)
  • 2020-12-08 01:22

    Adding the below property in application.properties solved the issues for me:

    management.health.defaults.enabled=false
    
    0 讨论(0)
  • 2020-12-08 01:24

    What worked for me is the following (in YAML format) working with spring boot 2 release:

    management:
      endpoints:
        web:
          exposure:
            include: info, health, metrics
      metrics:
        export:
          atlas:
            enabled: false
    

    also specific documentation can be found here

    0 讨论(0)
  • 2020-12-08 01:26
    management:
      endpoints:
        web:
          base-path: "/"
          exposure:
            include: '*'
    

    it should works like that. * means expose all endpoints

    0 讨论(0)
  • 2020-12-08 01:30

    The following configuration works for me

    server.servlet.context-path=/travel management.endpoints.web.exposure.include=*

    Then you need to add context path: http://localhost:8080/travel/actuator/metrics/

    0 讨论(0)
提交回复
热议问题