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 GitHub
parent b385fa622b
commit 7bbff7fb86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -387,8 +387,8 @@ 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 "/api/v1/alerts":
// Return dumb placehloder for https://prometheus.io/docs/prometheus/latest/querying/api/#alerts
case "/api/v1/alerts", "/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":[]}}`)