GET /api/v1/alerts/sources/{id}/requests
alerts.sources.read。每个来源保留最近 500 次请求,最长 7 天;记在处理请求的集群上。
查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
limit | integer | 最多返回几条,1 到 200,默认 50。 |
| 字段 | 说明 |
|---|---|
received_at | 收到的时间(微秒)。 |
via_cluster | 转来它的联邦集群;本集群直接收到的为空。 |
status | accepted(已处理)、rejected(已拒收)或 forwarded(已转给接收集群)。 |
http_status | 回给发送方的状态码。 |
message | 为什么被拒,或为什么什么都没做。 |
alert_count | 请求里一共几条告警。 |
alerts | 每条告警的动作、去重键、标题、严重度、结果(见接入外部告警)、原因和事件 ID,最多 100 条。 |
body_excerpt | 被拒收的请求体开头,最多 16 KiB。 |
curl "http://localhost:5080/api/v1/alerts/sources/$SOURCE_ID/requests?limit=20" \
-H "authorization: Bearer $MS_TOKEN"
[
{
"id": "3KEJ4n3yVb1qYtq0eWQ9dUQ7mjo",
"received_at": 1790000300000000,
"via_cluster": "",
"status": "accepted",
"http_status": 200,
"message": null,
"alert_count": 1,
"alerts": [
{
"action": "trigger",
"dedup_key": "http://alertmanager.example.com:9093|{}:{alertname=\"HighCPU\"}",
"summary": "HighCPU",
"severity": "critical",
"outcome": "opened",
"incident_id": "3KEDNEyqouYJeBDTLTMTBui7XHW"
}
],
"body_excerpt": null
}
]