监控告警
提供ADP监控、告警、通知相关的接口说明。
查询告警项列表
GET http://{adp-local}/console-backend/api/v1/alerting/alertItems
查询参数 | 描述 |
level | 规则级别,可选项:cluster、node、pod、product、component |
productName | 产品名称 |
componentName | 组件名称 |
返回样例:
{
"code": 1,
"msg": "",
"data": {
"pageNo": 1,
"pageSize": 10,
"records": [
{
"alertName": "NodeNetworkInterfaceFlapping",
"title": "NodeNetworkInterfaceFlapping",
"runbook": "https://runbooks.prometheus-operator.dev/runbooks/general/nodenetworkinterfaceflapping",
"description": "Network interface \"{{ $labels.device }}\" changing its up status often on node-exporter {{ $labels.namespace }}/{{ $labels.pod }}",
"mode": "Expr",
"rules": [
{
"severity": "warning",
"interval": "2m",
"expr": "changes(node_network_up{job=\"node-exporter\",device!~\"veth.+\"}[2m]) > 2",
"summary": "Network interface is often changing its status"
}
],
"subscribeGroups": [
"admin"
],
"uid": "882120946d4c3ee6ad21e4574fc4aa7b",
"creationTimestamp": "2022-06-06T07:07:19Z",
"level": "cluster",
"productName": "",
"componentName": "",
"namespace": "acs-system",
"strategyName": "adp-cluster",
"groupName": "node-network",
"users": [
"admin"
]
},
]
}
}
查询告警消息列表
GET http://{adp-local}/console-backend/api/v1/alerting/messages
查询参数 | 描述 |
level | 消息级别,可选项:cluster、node、pod、product、component |
productName | 产品名称 |
componentName | 组件名称 |
返回样例:
{
"code": 1,
"msg": "",
"data": {
"pageNo": 1,
"pageSize": 10,
"records": [
{
"id": 17,
"createdAt": "2022-06-22 08:41:09",
"updatedAt": "2022-06-22 08:41:09",
"level": "cluster",
"productName": "",
"componentName": "",
"alertUID": "da08a88d9d99ec46beebc1de95bd4803",
"alertName": "KubePersistentVolumeFillingUp",
"title": "KubePersistentVolumeFillingUp",
"runbook": "https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubepersistentvolumefillingup",
"description": "The PersistentVolume claimed by storage-loki-stack-0 in Namespace acs-system is only 2.633% free.",
"alertsCount": 190,
"fingerprint": "fce9a9e66c8c303f",
"severity": "critical",
"summary": "PersistentVolume is filling up.",
"startsAt": "2022-06-22T09:29:00.884Z",
"endsAt": "2022-06-22T10:03:00.884Z",
"status": "active",
"labels": {
"alertname": "KubePersistentVolumeFillingUp",
"endpoint": "https-metrics",
"instance": "172.16.124.158:10250",
"job": "kubelet",
"metrics_path": "/metrics",
"namespace": "acs-system",
"node": "izbp14qtxq58w62ws4pnr3z",
"persistentvolumeclaim": "storage-loki-stack-0",
"prometheus": "acs-system/kube-prometheus-stack-prometheus",
"service": "kube-prometheus-stack-kubelet",
"severity": "critical"
},
"annotations": {
"alertitem": "acs-system/adp-cluster/da08a88d9d99ec46beebc1de95bd4803",
"description": "The PersistentVolume claimed by storage-loki-stack-0 in Namespace acs-system is only 2.633% free.",
"runbook_url": "https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubepersistentvolumefillingup",
"subscribegroups": "admin",
"summary": "PersistentVolume is filling up.",
"title": "KubePersistentVolumeFillingUp"
},
"users": [
"admin"
]
}
]
}
}