vmselect: update /query_exemplars placeholder (#2000)

Grafana expects `data` in response to be a slice and logs an err
if it is not:
```
err="[]v1.ExemplarQueryResult: decode slice: expect [ or n, but found , error found in #0 byte of ...||..., bigger context ...||..."
```

https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1999
Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
Roman Khavronenko 2021-12-23 11:53:50 +02:00 committed by Aliaksandr Valialkin
parent c1722003a2
commit d1c474c5b3
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -524,7 +524,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")
fmt.Fprintf(w, "%s", `{"status":"success","data":null}`)
fmt.Fprintf(w, "%s", `{"status":"success","data":[]}`)
return true
default:
return false