Alerting: modify prometheus endpoints for proxying using the datasource UID (#48052)
* Modify prometheus endpoints to expect the data source UID * Update frontend
This commit is contained in:
@@ -43,11 +43,11 @@ func (f *ForkedPrometheusApi) RouteGetRuleStatuses(ctx *models.ReqContext) respo
|
||||
func (api *API) RegisterPrometheusApiEndpoints(srv PrometheusApiForkingService, m *metrics.API) {
|
||||
api.RouteRegister.Group("", func(group routing.RouteRegister) {
|
||||
group.Get(
|
||||
toMacaronPath("/api/prometheus/{DatasourceID}/api/v1/alerts"),
|
||||
api.authorize(http.MethodGet, "/api/prometheus/{DatasourceID}/api/v1/alerts"),
|
||||
toMacaronPath("/api/prometheus/{DatasourceUID}/api/v1/alerts"),
|
||||
api.authorize(http.MethodGet, "/api/prometheus/{DatasourceUID}/api/v1/alerts"),
|
||||
metrics.Instrument(
|
||||
http.MethodGet,
|
||||
"/api/prometheus/{DatasourceID}/api/v1/alerts",
|
||||
"/api/prometheus/{DatasourceUID}/api/v1/alerts",
|
||||
srv.RouteGetAlertStatuses,
|
||||
m,
|
||||
),
|
||||
@@ -73,11 +73,11 @@ func (api *API) RegisterPrometheusApiEndpoints(srv PrometheusApiForkingService,
|
||||
),
|
||||
)
|
||||
group.Get(
|
||||
toMacaronPath("/api/prometheus/{DatasourceID}/api/v1/rules"),
|
||||
api.authorize(http.MethodGet, "/api/prometheus/{DatasourceID}/api/v1/rules"),
|
||||
toMacaronPath("/api/prometheus/{DatasourceUID}/api/v1/rules"),
|
||||
api.authorize(http.MethodGet, "/api/prometheus/{DatasourceUID}/api/v1/rules"),
|
||||
metrics.Instrument(
|
||||
http.MethodGet,
|
||||
"/api/prometheus/{DatasourceID}/api/v1/rules",
|
||||
"/api/prometheus/{DatasourceUID}/api/v1/rules",
|
||||
srv.RouteGetRuleStatuses,
|
||||
m,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user