Skip to documentation
OrbitMeshDocs
Browse documentation
Docs/Platform Systems

PLATFORM SYSTEMS

Health Engine

Health Engine 判断 Node、RuntimeBinding、CapabilityBinding、Endpoint、线路、供应商、地区和目标服务是否可用,并为 Traffic Policy Engine 提供决策输入。
View source

1. 定位

Health Engine 判断 Node、RuntimeBinding、CapabilityBinding、Endpoint、线路、供应商、地区和目标服务是否可用,并为 Traffic Policy Engine 提供决策输入。

2. 健康维度

  • Node Health。
  • Edge Runtime Health。
  • Runtime Binding Health。
  • Capability Binding Health。
  • Endpoint Health。
  • Service Health。
  • Provider Health。
  • Region Health。
  • Traffic Policy Health。

3. 探测目标

开发者服务:

  • github.com。
  • api.github.com。
  • githubusercontent.com。
  • registry-1.docker.io。
  • registry.npmjs.org。
  • pypi.org。
  • api.openai.com。
  • api.anthropic.com。
  • googleapis.com。

系统目标:

  • Edge Runtime。
  • runtime process。
  • Traffic Entry endpoint。
  • Traffic Entry -> Traffic Exit path。
  • Control Plane API。

4. 探测指标

  • DNS time。
  • TCP connect time。
  • TLS handshake time。
  • TTFB。
  • total time。
  • HTTP status。
  • packet loss。
  • error message。

5. 健康状态

healthy
degraded
unavailable
unknown

转换规则:

  • 连续 1 次失败:degraded。
  • 连续 3 次失败:unavailable。
  • 连续 2 次成功:healthy。

MVP 可配置。

6. 探测执行位置

Edge Runtime 执行:

  • Node 本地 runtime。
  • RuntimeBinding process。
  • Endpoint readiness。
  • Traffic Exit 到服务的出口探测。
  • Traffic Entry 到 Traffic Exit path。

Control Plane 执行:

  • 聚合。
  • 状态计算。
  • 告警。
  • 路由评分。

7. API

Edge Runtime 上报:

POST /api/v1/edge-runtime/health

请求:

{
  "node_id": "node_tokyo",
  "runtime_binding_id": "rb_sing_box_tokyo",
  "capability_binding_id": "cb_exit_tokyo",
  "checks": [
    {
      "target": "github",
      "status": "healthy",
      "connect_ms": 42,
      "tls_ms": 80,
      "total_ms": 180
    }
  ]
}

8. 与 Traffic Policy Engine 联动

Traffic Policy Engine 查询:

  • 当前服务可用 Traffic Exit。
  • exit health score。
  • 最近错误。
  • failover 候选。

9. 数据表

health_checks:

  • id。
  • tenant_id。
  • node_id。
  • runtime_binding_id。
  • capability_binding_id。
  • endpoint_id。
  • target。
  • status。
  • dns_ms。
  • connect_ms。
  • tls_ms。
  • total_ms。
  • error。
  • checked_at。

10. 验收标准

  • Traffic Exit 能上报 GitHub 探测结果。
  • 连续失败后 CapabilityBinding 状态变 degraded。
  • Traffic Policy Engine 能避开 unavailable exit。
  • Console 能显示最近健康错误。
OrbitMesh DocumentationContent follows the repository's main branch.