简体   繁体   English

Spring 引导执行器发现端点返回 404

[英]Spring Boot Actuator discovery endpoint returns 404

I'm running into an issue of Spring Boot Actuator not exposing discovery page with the links to exposed actuators.我遇到了 Spring Boot Actuator 的问题,它没有公开包含指向公开执行器的链接的发现页面。 At the same time, I'm able to access actuators such as info , health and metrics .同时,我可以访问执行器,例如infohealthmetrics

I'm using Spring Boot 2.1.8 and my application.yml looks like this:我正在使用 Spring Boot 2.1.8,我的application.yml看起来像这样:

info:
  artifact: spring-actuator-example
  name: Spring Boot Actuator Example
  description: Spring Boot Actuator Example
  version: 1.0.0

#Exposes Spring actuator endpoints
management:
  server:
    port: 7979
    servlet:
      context-path: /actuator
  endpoint:
    health:
      show-details: always
  endpoints:
    web:
      base-path: /
      exposure:
        include: "*"

If I try to access /actuator endpoint I get如果我尝试访问/actuator端点,我会得到

{
  timestamp: "2019-09-18T19:55:25.622+0000",
  status: 404,
  error: "Not Found",
  message: "No message available",
  path: "/actuator/"
}

instead of something like而不是像

{
  "_links": {
    "self": { 
      "href": "http://localhost:7979/actuator",
      "templated": false
    },
    "info": { 
      "href": "http://localhost:7979/actuator/info",
      "templated": false
    },
    "health": { 
      "href": "http://localhost:7979/actuator/health",
      "templated": false
    },
    "metrics": { 
      "href": "http://localhost:7979/actuator/metrics",
      "templated": false
    }
  }
}

Is there any configuration I'm missing?有没有我缺少的配置?

I have created a small example project here for you to try it out.我在这里创建了一个小示例项目供您试用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM