Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Incomplete AlertManager API Documentation #2228
Comments
This only documents the API documentation. Given that you stumbled over it, it might make sense to add a note in there. (PRs are welcome.)
On the projects readme there is an API section which should give some more insights. The easiest way to construct your curl commands is probably the interactive swagger ui. Let me know if this helps. Again, as this is an open source project it heavily depends on contributions, especially in the form of documentation. Thus if you find anything that would have helped you, please file a pull request. |
|
I agree with @mxinden: it would be good to mention the API specification in the official documentation. |
|
@mxinden This is what I am using so far: The response is an empty list. |
|
I don't have much experience with amtool. In addition as this would be a usage question the mailing list is the best place to ask https://groups.google.com/forum/#!forum/prometheus-users. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

@mxinden
Either I don't know what I am doing or the Alert Manager API is not working as expected.
Your assistance is greatly appreciated.
I am trying to get a list of active alerts using a filter and it does not work as expected.
In all cases, I receive the complete list of active alarms.
Example 1:
curl -X GET http://10.44.0.3:9093/api/v2/alerts
Here I get the full list of active alerts.
So far so good!
Example 2:
curl -X GET http://10.44.0.3:9093/api/v2/alerts?name=my_receiver
Here I still get the full list of active alerts.
Example 2:
curl -X GET http://10.44.0.3:9093/api/v2/alerts?alertname=my_alert.*
Here I still get the full list of active alerts.
Unfortunately the AlertManager API documentation is poor vs Prometheus Server API documentation.
See link below:
https://prometheus.io/docs/alerting/management_api/
Below is the Alert Manager OPEN API spec but I don't know how to use it:
https://github.com/prometheus/alertmanager/blob/master/api/v2/openapi.yaml
/alerts:
get:
tags:
- alert
operationId: getAlerts
description: Get a list of alerts
parameters:
- in: query
name: active
type: boolean
description: Show active alerts
default: true
- in: query
name: silenced
type: boolean
description: Show silenced alerts
default: true
- in: query
name: inhibited
type: boolean
description: Show inhibited alerts
default: true
- in: query
name: unprocessed
type: boolean
description: Show unprocessed alerts
default: true
- name: filter
in: query
description: A list of matchers to filter alerts by
required: false
type: array
collectionFormat: multi
items:
type: string
- name: receiver
in: query
description: A regex matching receivers to filter alerts by
required: false
type: string
Can you provide examples showing how to construct alert queries with filters?
The text was updated successfully, but these errors were encountered: