Add case prometheus/rules for grafana 8 (#1502)

This commit is contained in:
arnoldyahad 2021-07-29 06:15:35 +03:00 committed by Aliaksandr Valialkin
parent a483044557
commit 00af4ff5a4

View file

@ -387,6 +387,12 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "%s", `{"status":"success","data":{"groups":[]}}`)
return true
case "prometheus/rules":
// Return dumb placeholder for https://prometheus.io/docs/prometheus/latest/querying/api/#rules
rulesRequests.Inc()
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "%s", `{"status":"success","data":{"groups":[]}}`)
return true
case "/api/v1/alerts":
// Return dumb placehloder for https://prometheus.io/docs/prometheus/latest/querying/api/#alerts
alertsRequests.Inc()