prometheus get-alerts
Get the list of active alerts
Description
Returns a list of active alerts
Synopsis
Arguments
site
- (string)
Site where this command will be executed
Example: --site "site-1"
Default: input.site
Attributes: optional
cluster
- (string)
Name of prometheus cluster
Example: --cluster "prometheus-default"
Default: prometheus-default
Attributes: optional
Examples
Input:
Output:{
"status": "success",
"data": {
"alerts": [
{
"labels": {
"alertname": "InstanceDown",
"instance": "localhost:9100",
"job": "node-exporter",
"severity": "critical"
},
"annotations": {
"description": "[localhost:9100] of job [node-exporter] has been down for more than 1 minute.",
"summary": "Instance [localhost:9100] down"
},
"state": "firing",
"activeAt": "2021-10-13T12:05:20.566139241Z",
"value": "0e+00"
},
{
"labels": {
"alertname": "InstanceDown",
"instance": "localhost:1234",
"job": "kafka",
"severity": "critical"
},
"annotations": {
"description": "[localhost:1234] of job [kafka] has been down for more than 1 minute.",
"summary": "Instance [localhost:1234] down"
},
"state": "firing",
"activeAt": "2021-10-13T12:05:20.566139241Z",
"value": "0e+00"
}
]
}
}
Access Control
To use this command, you need access to the following:
Field | Value |
---|---|
Action | "read" |
Service Type | "prometheus" |
Service Instance | cluster |
Namespace | |
Object Type | "alert" |
Object ID |
Please see Access Control for details.