From face3d57bf9b694d7302ec81b80078d1f1a1300e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 3 Dec 2019 19:32:57 +0200 Subject: [PATCH] app/vmselect: add placeholders for `/api/v1/rules` and `/api/v1/alerts` --- app/vmselect/main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 1f2d1a1ff1..266b1785bb 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -167,6 +167,18 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool { return true } return true + case "/api/v1/rules": + // Return dumb placeholder + rulesRequests.Inc() + w.Header().Set("Content-Type", "application/json") + fmt.Fprintf(w, "%s", `{"status":"success","data":{"groups":[]}}`) + return true + case "/api/v1/alerts": + // Return dumb placehloder + alertsRequests.Inc() + w.Header().Set("Content-Type", "application/json") + fmt.Fprintf(w, "%s", `{"status":"success","data":{"alerts":[]}}`) + return true case "/api/v1/admin/tsdb/delete_series": deleteRequests.Inc() authKey := r.FormValue("authKey") @@ -228,4 +240,7 @@ var ( federateRequests = metrics.NewCounter(`vm_http_requests_total{path="/federate"}`) federateErrors = metrics.NewCounter(`vm_http_request_errors_total{path="/federate"}`) + + rulesRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/rules"}`) + alertsRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/alerts"}`) )