Alerting: Implement /status for the notification system (#33227)

* Alerting: Implement /status for the notification system

Implements the necessary plumbing to have a /status endpoint on the
notification system.

* Add API examples

* Update API specs

* Update prometheus/common dependency

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
This commit is contained in:
gotjosh
2021-06-15 19:14:02 +03:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent 283572fcbc
commit f7ed35336d
14 changed files with 606 additions and 376 deletions
@@ -26,6 +26,7 @@ type AlertmanagerApiService interface {
RouteDeleteSilence(*models.ReqContext) response.Response
RouteGetAMAlertGroups(*models.ReqContext) response.Response
RouteGetAMAlerts(*models.ReqContext) response.Response
RouteGetAMStatus(*models.ReqContext) response.Response
RouteGetAlertingConfig(*models.ReqContext) response.Response
RouteGetSilence(*models.ReqContext) response.Response
RouteGetSilences(*models.ReqContext) response.Response
@@ -81,6 +82,15 @@ func (api *API) RegisterAlertmanagerApiEndpoints(srv AlertmanagerApiService, m *
m,
),
)
group.Get(
toMacaronPath("/api/alertmanager/{Recipient}/api/v2/status"),
metrics.Instrument(
http.MethodGet,
"/api/alertmanager/{Recipient}/api/v2/status",
srv.RouteGetAMStatus,
m,
),
)
group.Get(
toMacaronPath("/api/alertmanager/{Recipient}/config/api/v1/alerts"),
metrics.Instrument(