docs: clarify API routing (and with --web.route-prefix)

Signed-off-by: Adam Shannon <adamkshannon@gmail.com>
This commit is contained in:
Adam Shannon 2019-06-10 11:43:04 -05:00
parent c16e90ef6f
commit 4440caa94e
1 changed files with 12 additions and 10 deletions

View File

@ -71,10 +71,10 @@ route:
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would # multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# be batched into a single group. # be batched into a single group.
# #
# To aggregate by all possible labels use '...' as the sole label name. # To aggregate by all possible labels use '...' as the sole label name.
# This effectively disables aggregation entirely, passing through all # This effectively disables aggregation entirely, passing through all
# alerts as-is. This is unlikely to be what you want, unless you have # alerts as-is. This is unlikely to be what you want, unless you have
# a very low alert volume or your upstream notification system performs # a very low alert volume or your upstream notification system performs
# its own grouping. Example: group_by: [...] # its own grouping. Example: group_by: [...]
group_by: ['alertname', 'cluster'] group_by: ['alertname', 'cluster']
@ -180,15 +180,17 @@ receivers:
## API ## API
The current Alertmanager API is version 2. This API is fully generated via the The current Alertmanager API is version 2. This API is fully generated via the
[OpenAPI [OpenAPI project](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)
project](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md)
and [Go Swagger](https://github.com/go-swagger/go-swagger/) with the exception and [Go Swagger](https://github.com/go-swagger/go-swagger/) with the exception
of the HTTP handlers themselves. The API specification can be found in of the HTTP handlers themselves. The API specification can be found in
[api/v2/openapi.yaml](api/v2/openapi.yaml). A HTML rendered version can be [api/v2/openapi.yaml](api/v2/openapi.yaml). A HTML rendered version can be
accessed accessed [here](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/prometheus/alertmanager/master/api/v2/openapi.yaml).
[here](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/prometheus/alertmanager/master/api/v2/openapi.yaml). Clients can be easily generated via any OpenAPI generator for all major languages.
Clients can be easily generated via any OpenAPI generator for all major
languages. With the default config, endpoints are accessed under a `/api/v1` or `/api/v2` prefix.
The v2 `/status` endpoint would be `/api/v2/status`. If `--web.route-prefix` is set then API routes are
prefixed with that as well, so `--web.route-prefix=/alertmanager/` would
relate to `/alertmanager/api/v2/status`.
_API v2 is still under heavy development and thereby subject to change._ _API v2 is still under heavy development and thereby subject to change._