AIX health-check
AIX health-check 通过 [healthcheck] 配置 TCP/HTTP 可用性检查,默认关闭。检查结果按指标数据上报。
配置¶
[healthcheck]
# 是否启用 health-check。
enabled = false
# TCP/HTTP health-check 间隔。
interval = "10s"
[[healthcheck.tcp]]
name = "ssh"
# TCP 探测目标,格式为 host:port。
address = "127.0.0.1:22"
timeout = "5s"
[[healthcheck.http]]
name = "local-api"
url = "http://127.0.0.1:8080/health"
method = "GET"
# 期望 HTTP 状态码。
status_code = 200
timeout = "5s"
指标¶
host_healthcheck¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
主机名。 |
| name ( tag) |
探测名称。 |
| type ( tag) |
探测类型,取值为 tcp 或 http。 |
| target ( tag) |
探测目标。HTTP URL 中的敏感参数会被脱敏。 |
| status ( tag) |
探测状态,取值为 ok 或 fail。 |
| reason ( tag) |
探测结果原因,如 none、connection_timeout、connection_refused、status_mismatch。 |
| success | 探测是否成功,1 表示成功,0 表示失败。Type: int | (gauge) Unit: count |
| latency_ms | 探测成功时的耗时。 Type: int | (gauge) Unit: time,ms |