adds /rules and /alerts api for grafana (#1504)

Co-authored-by: Aliaksandr Valialkin <valyala@gmail.com>
This commit is contained in:
Nikolay 2021-08-02 17:28:09 +03:00 committed by Aliaksandr Valialkin
parent e127dcf013
commit 3f3ad13753

View File

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