follow-up after e2f99214f3e518f79c1c96ff918820a69d350ba1

This commit is contained in:
f41gh7 2021-09-16 11:21:07 +03:00 committed by Aliaksandr Valialkin
parent 05bf6cca82
commit 348f705d95

View file

@ -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"}`)