【问题标题】:Actuator don't expose endpoints in Spring Boot v2.4.3在 Spring Boot v2.4.3 中执行器不公开端点
【发布时间】:2021-06-25 13:24:14
【问题描述】:

我想公开我的应用程序中的所有端点。我包括了执行器工作所必需的这些依赖项:

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

还有我的 application.properties 文件:

management.endpoints.web.exposure.include= '*'

启动应用程序后(通过 Intellij 或命令 mvn spring-boot: run),日志包含以下行:

2021-06-25 15:07:39.253  INFO 21068 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'

这些端点是信息和健康。当我发送这个 URL 时:http://localhost:8080/actuator/metrics 然后我得到 404。

【问题讨论】:

    标签: spring-boot endpoint spring-boot-actuator


    【解决方案1】:

    不要引用 *

    改为使用:

    management.endpoints.web.exposure.include=*
    

    【讨论】:

      猜你喜欢
      • 2019-05-07
      • 2018-12-06
      • 1970-01-01
      • 2016-03-05
      • 1970-01-01
      • 2019-03-11
      • 2016-08-26
      • 1970-01-01
      • 2016-08-07
      相关资源
      最近更新 更多