GET /api/v1/alerts/incidents/{id}/source
alerts.incidents.read。这类事件带标签 alert.source=external,rule_id 是来源的 ID。
| 字段 | 说明 |
|---|---|
source | 来源,字段见列出告警来源;来源已删除时为 null。 |
dedup_key | 去重键。 |
last_event_at | 这个去重键上用过的最晚的发送方时间(微秒),比它早的消息被忽略;API 类型为 null。 |
last_intake_at | 最近一次收到这条告警的时间(微秒)。 |
members | Alertmanager 与 Grafana 的通知分组里的告警,最多 100 条:status(firing 或 resolved)、labels、summary、starts_at、ends_at 和回到发送方的 url;其他类型为空。 |
curl http://localhost:5080/api/v1/alerts/incidents/$INCIDENT_ID/source \
-H "authorization: Bearer $MS_TOKEN"
{
"source": { "id": "3KEJ1mZqf0bY0b8XUgD4tkd2Vwq", "name": "Production Prometheus", "kind": "alertmanager", "...": "..." },
"dedup_key": "http://alertmanager.example.com:9093|{}:{alertname=\"HighCPU\"}",
"last_event_at": 1790000240000000,
"last_intake_at": 1790000300000000,
"members": [
{
"status": "firing",
"labels": { "alertname": "HighCPU", "instance": "web-1:9100", "job": "node" },
"summary": "CPU above 90% on web-1",
"starts_at": 1790000000000000,
"url": "http://prometheus.example.com:9090/graph"
}
]
}
| 状态码 | 原因 |
|---|---|
404 | 事件不存在,或不是告警来源开的。 |