grafana-datasource
grafana-datasource copied to clipboard
Grafana API datasource health check returns 400
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.