Skip to content

Health Check

获取 OmniCortex 网关服务器的实时运行健康状态。系统将自动探测并检测网关底层核心组件的连通性与健康度(包括配置中心 config_store、审计日志持久化 log_store 以及语义向量缓存 vector_store 等)。

TIP

免鉴权探针设计/health 端点在网关鉴权中间件中配置了系统白名单,无需携带任何 Token 凭证即可发起探测,完美契合 Kubernetes 的存活探针(Liveness Probe)、就绪探针(Readiness Probe)以及云厂商负载均衡器(SLB/ALB)的健康巡检调用。

GET/health

鉴权与参数说明 (Authentication & Parameters)

无需鉴权凭证publicheader
本端点无需携带 Authorizationx-api-key 请求头,任何监控探针均可直接发起 GET 请求探测。

响应体字段释义 (Response Fields)

statusstringbodyrequired
网关系统的整体运行健康状态。服务完全正常时固定返回 ok
componentsobjectbody
网关底层各独立支撑组件的健康状态映射表。各组件正常运行时状态均为 ok
  • config_store: 动态配置中心(PostgreSQL / SQLite / 配置文件)连接状态。
  • log_store: 全量调用审计与安全日志持久化存储(PostgreSQL / ClickHouse / 本地文件)就绪状态。
  • vector_store: 语义缓存及向量数据库(Weaviate / Qdrant / Redis / Pinecone)网络连通状态。
Health Check
HTTP / SDK
bash
curl --request GET \
  --url http://localhost:8080/health
python
import requests

# 发送轻量探测请求
response = requests.get("http://localhost:8080/health", timeout=5)

if response.status_code == 200:
    print("OmniCortex Gateway is healthy:", response.json())
else:
    print(f"Health check failed with status {response.status_code}:", response.text)
typescript
async function checkGatewayHealth() {
  const res = await fetch('http://localhost:8080/health');
  
  if (res.ok) {
    const data = await res.json();
    console.log('OmniCortex Gateway is healthy:', data);
  } else {
    console.error(`Health check failed (${res.status}):`, await res.text());
  }
}

checkGatewayHealth();
Response
json
{
  "status": "ok",
  "components": {
    "config_store": "ok",
    "log_store": "ok",
    "vector_store": "ok"
  }
}