Skip to content
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

pre and post health check methods #147

Merged
merged 1 commit into from
Dec 13, 2024
Merged

pre and post health check methods #147

merged 1 commit into from
Dec 13, 2024

Conversation

yesoreyeram
Copy link
Contributor

Change 1

This PR updates the return values for the CheckHealth method.

When the CheckHealth failed, it returns *backend.CheckHealthResult, error. In the above scenario, the error is redundant and causing confusion with the error status in the CheckHealthResult. Due to this incorrect usage of error, drivers like big query shows always connection successful.

So removing the return DownstreamError(err) to nil from the HealthChecker.Check method.

Change 2

This PR adds support for custom health checks ( pre and post connect checks ). This pre and post checks are optional and will be ignored if not configured.

Note: This is required for drivers such as big query where the Connect method is not sufficient for health check.

@yesoreyeram yesoreyeram requested a review from a team as a code owner December 12, 2024 00:28
@yesoreyeram yesoreyeram requested review from fabrizio-grafana and a team December 12, 2024 00:28
@yesoreyeram yesoreyeram merged commit bc662ea into main Dec 13, 2024
2 checks passed
@yesoreyeram yesoreyeram deleted the custom-health-check branch December 13, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants