-
Notifications
You must be signed in to change notification settings - Fork 30
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
Introducing the data source health check subsystem #20
Comments
Grafana has introduced API for datasource health: Ref:
I would use this API now. |
Dear Jan, thank you for sharing this information. This is very sweet. I will improve the implementation to use the new endpoint from Grafana 9 onwards. Edit: A draft has been submitted at #21. However, I am still observing problems with the new With kind regards, |
Dear @jangaraj, @chenlujjj, and @peekjef72, with #24 and #25, the data source health check subsystem became mature enough that adding the most prominent missing data sources on behalf of #27 was a real breeze. You can take that as a reference if you need to add health check capabilities for further data sources. Effectively, unless a data source would have a total different shape in terms of query and response formats, the gist is to fill in the gap solely within For testing, I've scanned both The list of supported data sources is now: [
"elasticsearch",
"fetzerch-sunandmoon-datasource",
"grafana-simple-json-datasource",
"graphite",
"influxdb",
"influxdb+flux",
"influxdb+influxql",
"jaeger",
"loki",
"mssql",
"mysql",
"opentsdb",
"postgres",
"prometheus",
"simpod-json-datasource",
"tempo",
"testdata",
"zipkin"
] Do you think we are missing any important item here? I am sure the implementation still contains bugs. On this matter, I will be very happy to hear back from the community about spots where things go south with specific data sources / conditions. With kind regards, P.S.: @jangaraj: Regarding our last conversation, the data source health check subsystem now consumes the new server-side per-datasource health check endpoint available with Grafana >= 9. If that fails, it will fall back to the client-side implementation provided by |
Hi again,
With kind regards, |
With GH-112 by @peekjef72 (thanks again!), this subsystem can now be used to also conduct generic queries to Grafana datasource databases, and people start using it for that purpose already, see GH-85. |
Dear @chenlujjj and @jangaraj,
Originally coming from How to find out unused datasources?, based on our discussion at Finding unhealthy data sources, we finally made a start to lay out the foundation with #19. Health checks for a few data source types will be supported already 1, but we will have to complete the list diligently, which requires dedicated work.
Corresponding documentation how to work with the health check subsystem on behalf of an example program examples/datasource-health.py can be inspected at examples/datasource-health.rst. The program is intended to evaluate the new subsystem with different databases, in order to gradually improve the implementation. We tried to make it easily usable for others to run in order to support this endeavor.
When the feature is reasonably ready over here, we will return to grafana-toolbox/grafana-wtf#19 in order to continue the discussion how to use it within
grafana-wtf
appropriately.If this resonates with you, you might want to lend a hand? All kinds of feedback, both in terms of testing and further contributions will be greatly appreciated. Thank you very much in advance.
With kind regards,
Andreas.
Usage
The documentation at examples/datasource-health.rst will guide you through a full development sandbox installation, including running Grafana and some database services as Docker containers, and setting up the working tree from the Git repository.
In this section, we outline an alternative approach how to work with the feature using the example program examples/datasource-health.py. It might save a few keystrokes, specifically when aiming to work on an existing infrastructure.
Details
The example program will create a data source item named
probe-{dstype}
, with the designated database target URL. Then, it will run a data source health check on it and report about its outcome.This will work well in situations when running the database services as Docker containers, as outlined in the reference documentation at examples/datasource-health.rst. It might not work well in other situations, where the data source configuration might need further adjustments.
In this case, don't hesitate to adjust the
datasource_factory()
code correspondingly to match your setup.References
Footnotes
CrateDB, Elasticsearch, InfluxDB, PostgreSQL, Prometheus, Testdata ↩
The text was updated successfully, but these errors were encountered: