Health Check
2 分钟阅读
Health Check 运行状况检查
Liveness and readiness probes middleware for Fiber that provides two endpoints for checking the liveness and readiness state of HTTP applications.
Liveness 和 readiness 探测中间件,用于 Fiber,它提供两个端点来检查 HTTP 应用程序的 liveness 和 readiness 状态。
Overview 概述
Liveness Probe: Checks if the server is up and running.
运行状况探测:检查服务器是否启动并运行。
- Default Endpoint:
/livez
默认端点:/livez
- Behavior: By default returns
true
immediately when the server is operational. 行为:默认情况下,当服务器运行时立即返回true
。
- Default Endpoint:
Readiness Probe: Assesses if the application is ready to handle requests.
就绪探测:评估应用程序是否准备好处理请求。
- Default Endpoint:
/readyz
默认端点:/readyz
- Behavior: By default returns
true
immediately when the server is operational. 行为:默认情况下,当服务器运行时立即返回true
。
- Default Endpoint:
HTTP Status Codes:
HTTP 状态代码:
200 OK
: Returned when the checker function evaluates totrue
.200 OK
:当检查器函数评估为true
时返回。503 Service Unavailable
: Returned when the checker function evaluates tofalse
.503 Service Unavailable
:当检查器函数评估为false
时返回。
Signatures 签名
|
|
Examples 示例
Import the middleware package that is part of the Fiber web framework
导入 Fiber Web 框架的一部分中间件包
|
|
After you initiate your Fiber app, you can use the following possibilities:
在启动 Fiber 应用后,您可以使用以下可能性:
|
|
Config 配置
|
|
Default Config 默认配置
The default configuration used by this middleware is defined as follows:
此中间件使用的默认配置定义如下:
|
|