-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support data source health check endpoint introduced with Grafana 9 #21
Conversation
ReportWhen running the example, I am receiving this outcome. Apparently, the
Traceback (most recent call last):
File "/Users/amo/dev/panodata/sources/grafana-client/examples/datasource-health.py", line 159, in <module>
run_healthcheck(grafana_client, grafana_version=grafana_version)
File "/Users/amo/dev/panodata/sources/grafana-client/examples/datasource-health.py", line 135, in run_healthcheck
health_info = health_inquiry(grafana, datasource, grafana_version=grafana_version)
File "/Users/amo/dev/panodata/sources/grafana-client/examples/datasource-health.py", line 82, in health_inquiry
health = grafana.datasource.health(datasource_uid=datasource_uid)
File "/Users/amo/dev/panodata/sources/grafana-client/grafana_client/elements/datasource.py", line 31, in health
r = self.client.GET(path)
File "/Users/amo/dev/panodata/sources/grafana-client/grafana_client/client.py", line 131, in __request_runnner
raise GrafanaClientError(
grafana_client.client.GrafanaClientError: Client Error 404: Not found Evaluation
Through this log message, I am sure that I am on Grafana 9, running locally through Docker. The version string is inquired from the instance.
ThoughtsAm I missing something on this matter? Would this endpoint need to be explicitly enabled in the configuration? Is it enterprise only? |
I would say doc is not correct - grafana/grafana@6bb843b#diff-5e6dbad9a85fb156660edecabd16951c3ebbf9f026c063a6504a79b82fbdaccfR607 - it looks like |
Thanks for your quick response. What is implemented right now is the I must be doing something wrong. |
I've just confirmed the behavior also with the current export GRAFANA_VERSION=main
docker run --rm -it \
--publish=3000:3000 \
--env='GF_SECURITY_ADMIN_PASSWORD=admin' \
grafana/grafana:${GRAFANA_VERSION} Do those endpoints actually work on your end, @jangaraj? |
Nope, but I'm trying to figure out how to configure that. It works here - https://play.grafana.org/api/datasources/uid/000000098/health |
I also thought about checking play.grafana.org, thank you for making a start. From a few samples I made, the outcome is 50/50. Both Works200 OK400 Bad RequestNot implemented yet?404 Not Found |
902b847
to
25ead33
Compare
25ead33 adds a small adjustment to the example program in order to compensate for this. Now, when hitting |
Apparently, this is not implemented thoroughly for all data source types yet. Now, when the example program hits a `404 Not Found` response, it transparently falls back to the custom machinery.
25ead33
to
7697f87
Compare
@jangaraj mentioned at #20 (comment), that Grafana 9 features a dedicated data source health check endpoint 1. This patch implements the corresponding client support.
Footnotes
https://grafana.com/docs/grafana/latest/developers/http_api/data_source/#check-data-source-health ↩