app/vmselect: return data:null instead of data:[] from /api/v1/query_exemplars, since Grafana throws an error otherwise

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1186
This commit is contained in:
Aliaksandr Valialkin 2021-04-07 23:33:40 +03:00
parent 276dbc2133
commit 9ce3b7e1dd

View File

@ -451,7 +451,7 @@ func selectHandler(startTime time.Time, w http.ResponseWriter, r *http.Request,
// Return dumb placeholder for https://prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars
queryExemplarsRequests.Inc()
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "%s", `{"status":"success","data":[]}`)
fmt.Fprintf(w, "%s", `{"status":"success","data":null}`)
return true
default:
return false