grafana-datasource icon indicating copy to clipboard operation
grafana-datasource copied to clipboard

Grafana API datasource health check returns 400

Open eserte opened this issue 4 months ago • 1 comments

When using the grafana API datasource health check against a datasource using the victoriametrics-datasource plugin, e.g. using /api/datasources/uid/abcdefghijklmn/health then it fails with a 400 status and a JSON body

{"message":"got response code 400","status":"ERROR"}

The datasource is configured with the URL http://vmselect-aggregator-clusterip.vm-output.svc.cluster.local:8481/select/1234/prometheus (note the multi-tenant setup) and otherwise works fine, only the above health check does not.

If I understand the source code correctly, then the health check is done in this function https://github.com/VictoriaMetrics/victoriametrics-datasource/blob/main/pkg/plugin/datasource.go#L169 The /-/healthy part is just added to the configured URL, so the result would be http://vmselect-aggregator-clusterip.vm-output.svc.cluster.local:8481/select/1234/prometheus/-/healthy which does not work. It returns an error message containing ... unsupported path requested: "/select/1234/prometheus/-/healthy" and the http status is 400 which looks like it is propagated.

eserte avatar Oct 10 '24 14:10 eserte