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

New feature: ability to query individual health checks #940

Closed

Conversation

osigida
Copy link

@osigida osigida commented Apr 12, 2016

We have few health checks in our application. and one of them is basic dead-lock threads.
When this happens we have no choice than to restart the app.
We would like to automate it but we don't like to query all health checks and then parse the response, because it is useless to call all of them and bring some logic to the monitoring tool. Instead we would like to query individual check and act immediately if its failing.

thanks to @ingwarsw for sorting out unit-tests

We have few health checks in our application. and one of them is basic dead-lock threads.
When this happens we have no choice than to restart the app.
We would like to automate it but we don't like to query all health checks and then parse the response, because it is useless to call all of them and bring some logic to the monitoring tool. Instead we would like to query individual check and act immediately if its failing.

thanks to @ingwarsw  for sorting out unit-tests
final Map<String, HealthCheck.Result> results;
String name = getHealthCheckName(req);
if (name != null) {
results = Collections.singletonMap(name, registry.runHealthCheck(name));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that method throws NoSuchElementException when check is not found.
You should create method that would check if that check exists and only then call method.

If check is not existing you should return empty map so responses (all/one) would be consistent.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, please have a look again

@osigida osigida force-pushed the individual-healthchecks-3-2 branch from 388d8af to 1b2bb10 Compare April 12, 2016 14:16
@jplock jplock added this to the 3.2.0 milestone Apr 12, 2016
@jplock jplock modified the milestones: 3.2.0, 3.2.1 Feb 24, 2017
@jplock jplock modified the milestones: 3.2.1, 3.2.2 Mar 10, 2017
@arteam arteam modified the milestones: 3.2.2, 3.2.3 Mar 20, 2017
@arteam arteam removed this from the 3.2.3 milestone Jul 4, 2017
@arteam arteam closed this Dec 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants