vmselect: add stub for graphite/functions requests

The request `graphite/functions` is sent by Grafana datasource
and results into error logs in vmselect.
This commit is contained in:
Roman Khavronenko 2021-09-15 09:44:05 +03:00 committed by Aliaksandr Valialkin
parent 3f8de4f82f
commit 05bf6cca82

View file

@ -496,6 +496,11 @@ 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()
@ -649,6 +654,8 @@ 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"}`)
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"}`)
metadataRequests = metrics.NewCounter(`vm_http_requests_total{path="/select/{}/prometheus/api/v1/metadata"}`)