当前位置: 首页 > 知识库问答 >
问题:

执行器暴露endpoint不工作

公西永嘉
2023-03-14

我正在使用spring Boot2.0.4,并希望公开我的执行器endpoint。当向application.yml仅添加以下信息时,健康状况将被公开。

management:
  endpoints:
    web:
      exposure:
        include: "*"

当我运行http://localhost:8080/acturet时,我会得到

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

共有1个答案

方季同
2023-03-14

Spring Boot2.0采用了一种略有不同的方法来确保webendpoint的安全性。默认情况下,大多数Webendpoint都已禁用(仅公开/health和/infoendpoint),并且Management.Security.Enabled属性已被删除。执行器不再有单独的安全自动配置,可以通过application.properties文件中的配置启用/禁用和/或公开各个endpoint。例如:

# disable beans endpoint  
management.endpoints.beans.enabled=false  
# expose all endpoints:
management.endpoints.web.exposure.include=*  

请参阅其他信息Spring官方文档:https://github.com/spring-projects/spring-boot/wiki/spring-boot-2.0-migration-guide#endpoints

 类似资料:
  • 我试图在我的spring boot应用程序中公开/actuator/healthendpoint,但我的日志表明没有公开任何endpoint。我看过一些文档,其中指出健康endpoint是默认启用的唯一endpoint,但它为我返回404。 从应用程序启动的日志: 访问 /actuator 还显示未公开任何endpoint: 我看了其他几个类似的帖子,但是没有一个补丁对我有效。我在@RestCon

  • 基于48.3定制管理服务器端口 使用默认HTTP端口公开管理endpoint对于基于云的部署是一个明智的选择。但是,如果您的应用程序在您自己的数据中心内运行,您可能更愿意使用不同的HTTP端口公开endpoint。 有一个不同的端口让执行器健康endpoint运行的价值是什么?在什么样的场景下? 通常,一个端口用于所有服务endpoint是否足够好?在另一个上实现设置健康endpoint是否为标准

  • 我在库中公开了一个方法,该方法返回一个CompletableFuture。该方法的计算发生在单线程执行器上,这是我的瓶颈,因此我不希望任何后续工作发生在同一个线程上 如果我使用返回“SupplySync”结果的简单方法,我将向调用者公开我宝贵的线程,调用者可能会添加同步操作(例如通过Accept),这可能会在该线程上花费一些CPU时间 复制如下: 这确实打印出: 我发现的一个解决方案是引入另一个执

  • 从DSYER的例子开始:https://github.com/dsyer/spring-boot-jersey/tree/master/spring-boot-sample-jersey1 为了重新迭代,我使用的是Jersey v1,而不是V2。 我注意到jersey掩盖了spring-boot-actuatorendpoint,如/env和/health。我遵循Spring Boot Jerse

  • 对于一些老客户,我们希望公开一些用于运行状况监视的指标。正在查看Spring启动应用程序,其中它公开了来自本地JVM的许多有用指标。如果我在服务器中单独安装冲刺 (sprint) 引导执行器应用程序,它是否可能从远程 JVM 公开所有这些信息?还有其他建议//替代路径是值得赞赏的吗?