mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
app/vmselect: add a placeholder for /api/v1/metadata
, which could be requested by Grafana
See https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata VictoriaMetrics doesn't collect any metadata for metrics, so just return empty response.
This commit is contained in:
parent
7cde594696
commit
e6bf88a4d4
@ -263,6 +263,12 @@ func selectHandler(w http.ResponseWriter, r *http.Request, p *httpserver.Path, a
|
|||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
fmt.Fprintf(w, "%s", `{"status":"success","data":{"alerts":[]}}`)
|
fmt.Fprintf(w, "%s", `{"status":"success","data":{"alerts":[]}}`)
|
||||||
return true
|
return true
|
||||||
|
case "prometheus/api/v1/metadata":
|
||||||
|
// Return dumb placeholder
|
||||||
|
metadataRequests.Inc()
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
fmt.Fprintf(w, "%s", `{"status":"success","data":{}}`)
|
||||||
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -329,4 +335,5 @@ var (
|
|||||||
|
|
||||||
rulesRequests = metrics.NewCounter(`vm_http_requests_total{path="/select/{}/prometheus/api/v1/rules"}`)
|
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"}`)
|
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"}`)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user