访问 localhost:8080/actuator 端点(使用弹簧引导执行器)

hay*_*art 1 endpoint spring-boot spring-boot-actuator

在 spring文档中,我已经阅读了由执行器依赖项提供的名为“执行器”的端点,但我没有设法在我的本地测试应用程序上访问它。

问题:有人知道如何访问该端点吗?如果可能的话,粗略的:)
子问题 1:如果这个端点存在,那么为什么它是隐藏的?
子问题 2:如果此端点不存在,我们如何通知 spring.io 更正文档页面(打开某种票证)?

细节:

  • 我想完全访问“执行器”端点,而不是 Spring Boot 执行器提供的其他端点(本地主机:8080/actuator)
  • 是的,我尝试在属性文件中手动启用该端点(endpoints.enabled=true OR endpoints.actuator.enabled=true)
  • 是的,我尝试启用/禁用 endpoints.sencitive 属性
  • 是的,执行器的其他端点工作正常
  • 我没有特别的理由需要它,只是想尝试一下(只是学习新东西:))
  • 请不要只回答“没有这样的端点老兄!”,应该有某种原因将它写在文档中
  • 请使用我现在使用的 spring boot 版本,然后再回答“它对我有用这些配置”(spring boot 版本:1.5.4.RELEASE
  • 先感谢您 :)

Kyl*_*son 5

您必须包含Spring Hateoas依赖项才能使/actuator端点可用:

<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

根据文档

为其他端点提供基于超媒体的“发现页面”。需要 Spring HATEOAS 在类路径上。