【问题标题】:How to implement custom endpoint in Spring Boot actuator to health如何在 Spring Boot 执行器中实现自定义端点以健康
【发布时间】:2019-09-12 23:28:36
【问题描述】:

我将如何在 SpringBoot 中实现自定义端点以实现以下目标:

http://localhost:8080/actuator/health/custom

“自定义”是我想要实现的扩展健康的端点。

【问题讨论】:

标签: java endpoint spring-boot-actuator health-monitoring


【解决方案1】:

该 url 用于公开应用程序的健康检查,如果这是您的情况,您只需要包含执行器的依赖项:

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

你可以看到应用的状态。

如果您需要更具体的内容,只需配置依赖项,如您所见 here .

您还可以覆盖运行状况检查的行为,但该依赖项具有很多功能。

【讨论】:

  • 您好,这只会注入允许我使用默认执行器端点的执行器依赖项,例如:/health、/info、/metrics... 我想知道如何扩展自定义端点;例如,“/actuator/health/custom”
猜你喜欢
  • 1970-01-01
  • 2019-03-10
  • 2023-03-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多