From 348f705d95b3e720ac02cbd04ee919108fbdf8e1 Mon Sep 17 00:00:00 2001 From: f41gh7 Date: Thu, 16 Sep 2021 11:21:07 +0300 Subject: [PATCH] follow-up after e2f99214f3e518f79c1c96ff918820a69d350ba1 --- app/vmselect/main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/vmselect/main.go b/app/vmselect/main.go index caedc41af..2ade0922b 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -303,6 +303,12 @@ func selectHandler(startTime time.Time, w http.ResponseWriter, r *http.Request, } return true } + if strings.HasPrefix(p.Suffix, "graphite/functions") { + graphiteFunctionsRequests.Inc() + w.Header().Set("Content-Type", "application/json; charset=utf-8") + fmt.Fprintf(w, "%s", `{}`) + return true + } switch p.Suffix { case "prometheus/api/v1/query": @@ -496,11 +502,6 @@ func selectHandler(startTime time.Time, w http.ResponseWriter, r *http.Request, return true } return true - case "graphite/functions": - graphiteFunctionsRequests.Inc() - w.Header().Set("Content-Type", "application/json; charset=utf-8") - fmt.Fprintf(w, "%s", `{}`) - return true case "prometheus/api/v1/rules", "prometheus/rules": // Return dumb placeholder for https://prometheus.io/docs/prometheus/latest/querying/api/#rules rulesRequests.Inc() @@ -654,7 +655,7 @@ var ( graphiteTagsDelSeriesRequests = metrics.NewCounter(`vm_http_requests_total{path="/select/{}/graphite/tags/delSeries"}`) graphiteTagsDelSeriesErrors = metrics.NewCounter(`vm_http_request_errors_total{path="/select/{}/graphite/tags/delSeries"}`) - graphiteFunctionsRequests = metrics.NewCounter(`vm_http_request_errors_total{path="/select/{}/graphite/functions"}`) + graphiteFunctionsRequests = metrics.NewCounter(`vm_http_request_total{path="/select/{}/graphite/functions"}`) rulesRequests = metrics.NewCounter(`vm_http_requests_total{path="/select/{}/prometheus/api/v1/rules"}`) alertsRequests = metrics.NewCounter(`vm_http_requests_total{path="/select/{}/prometheus/api/v1/alerts"}`)