GET/health健康检查
Try it 面板需要启用 JavaScript。
返回服务存活状态与依赖连通性;供负载均衡器探活与部署发布门禁使用。无需认证。
Request
Headers
该 jsonschema:headers 围栏未声明任何属性
Response
Body
| Name | Data Type | Required | Description |
|---|---|---|---|
| status | string | Yes | ok 全部依赖健康 / degraded 部分依赖异常(服务仍可用) |
| service | string | Yes | 服务标识 |
| version | string | Yes | 构建版本号 |
| uptimeSeconds | number | Yes | 进程存活时长(秒) |
| checks | object | No | 各依赖项连通状态映射 |
type ResponseBody = {
/** ok 全部依赖健康 / degraded 部分依赖异常(服务仍可用) */
status: string
/** 服务标识 */
service: string
/** 构建版本号 */
version: string
/** 进程存活时长(秒) */
uptimeSeconds: number
/** 各依赖项连通状态映射 */
checks?: Record<string, unknown>
}{
"status": "ok",
"service": "api_service",
"version": "1.0.0",
"uptimeSeconds": 86400,
"checks": {
"nats": "ok",
"postgres": "ok"
}
}HTTP Code
| HTTP Status | Meaning | Notes |
|---|---|---|
| 200 | 存活 | status 为 ok 或 degraded |
| 503 | 不可用 | 进程无法服务(启动中或致命故障) |
Examples
GET /health
{
"status": "ok",
"service": "api_service",
"version": "1.0.0",
"uptimeSeconds": 86400,
"checks": { "nats": "ok", "postgres": "ok" }
}
Remarks
同一端点同时部署在 api_service 与 apps/openapi;业务服务(identity / payment 等)不直接暴露 HTTP,其存活经各自进程内健康检查上报,不在本页范围。