知识卡片
健康检查保持轻量
消费者需要判断依赖服务是否健康,但频繁探测本身也可能增加服务负载。
健康接口提供当前pass/fail/warn及必要版本、依赖检查信息,供消费者判断接口可用性。书中参考当时的Health Check draft-06,用/health、application/health+json及作者采用的health-check关系公布。
应通过GET配缓存头和ETag减少轮询压力,客户端也应遵守;匿名调用可只返回状态,授权用户才看更多细节。它是可用性信号,不能替代诊断或泄露内部调试数据。主动向每个订阅者回调可能反而压垮健康服务。草案及关系约定须按历史背景理解。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 超媒体服务 · 查看原书依据
In most cases, health checks are helpful when they stick to the basics. Reporting pass, fail, and warn is usually more than enough for service consumers. It is not a good idea to try to use health checks as a debugging or diagnostic tool. The health check reflects the state of the interface, not the service behind that interface.
参考来源
- 位置:《RESTful Web API Patterns and Practices Cookbook》第5章《Hypermedia Services》(来源项目book-sources:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch05.xhtml,配方5.11)
- 结论依据:原文以Health Check draft-06定义基本健康字段,讨论缓存、权限上下文及大量回调的负担。
- 原始内容:In most cases, health checks are helpful when they stick to the basics. Reporting pass, fail, and warn is usually more than enough for service consumers. It is not a good idea to try to use health checks as a debugging or diagnostic tool. The health check reflects the state of the interface, not the service behind that interface.