From c7aad8d441cc5731cd38328031658c4717516604 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Fri, 29 Apr 2022 10:36:28 +0200 Subject: [PATCH] app/vmselect: adds API /api/v1/status/buildinfo (#2515) * app/vmselect: adds API /api/v1/status/buildinfo it should fix an compability error with grafana 8.5 prometheus datasource https://github.com/grafana/grafana/pull/46771 * Update main.go --- app/vmselect/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 366e1e9e7..2f8dbe10d 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -439,6 +439,11 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool { } w.WriteHeader(http.StatusNoContent) return true + case "/api/v1/status/buildinfo": + buildInfoRequests.Inc() + w.Header().Set("Content-Type", "application/json") + fmt.Fprintf(w, "%s", `{"status":"success","data":{}}`) + return true default: return false } @@ -554,5 +559,6 @@ var ( rulesRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/rules"}`) alertsRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/alerts"}`) metadataRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/metadata"}`) + buildInfoRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/buildinfo"}`) queryExemplarsRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/query_exemplars"}`) )