java - 如何在 Spring Boot 执行器中实现自定义端点以健康
问题描述
我将如何在 SpringBoot 中实现自定义端点以实现以下目标:
http://localhost:8080/actuator/health/custom
其中“自定义”是我想要实现的扩展健康的端点。
解决方案
该 url 用于公开应用程序的健康检查,如果这是您的情况,您只需要包含执行器的依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
你可以看到应用程序的状态。
如果您需要更具体的内容,只需配置依赖项,如您在此处看到的那样。
您也可以覆盖健康检查的行为,但该依赖项具有很多功能。
推荐阅读
- javascript - getaddrinfo ENOTFOUND https://graph.facebook.com/
- qt - ListModel 包含委托的数据属性
- ruby-on-rails - 如何在 Rails 中使用 PostgreSQL 的 BETWEEN 来避免重复时间戳?
- vue.js - 如何在 Nuxt.js 中创建骨架加载?
- javascript - 我无法使用 RNFS 使用从 RNCameraRoll 获取的 phasset 读取文件
- python - 将键添加到键中已有的值,然后根据键名添加额外的值和键
- android - 如何将下一行从 Java 转换为 Kotlin
- android - 即使在应用程序被杀死后如何缓存数据一段时间?
- javascript - 如何设置picker的边框
- python - tensorflow中是否有类似的代码torch.backends.cudnn.benchmark/torch.cuda.synchronize()?