HealthCheck
view release on metacpan or search on metacpan
tags => [ "fast", "cheap" ] # inherited
},
{ anything => "at all",
id => "my_check",
status => "WARNING",
tags => [ "fast", "cheap" ] # inherited
},
{ id => "my_health_check",
label => "My Health Check",
tags => [ "cheap", "easy" ],
status => "WARNING",
results => [
{ id => "class_method",
tags => [ "cheap", "easy" ],
status => "WARNING",
},
{ id => "object_method",
tags => [ "cheap", "easy" ],
status => "WARNING",
},
{ id => "object_method_1",
label => "My Checker",
tags => [ "cheap", "copied_to_the_result" ],
status => "WARNING",
}
],
}
],
There is also runtime support, which can be enabled by adding a truthy
runtime param to the check.
$checker->check( tags => [ 'easy', '!fast' ], runtime => 1 );
id => "my_health_check",
label => "My Health Check",
runtime => "0.000",
runbook => 'https://grantstreetgroup.github.io/HealthCheck.html',
tags => [ "cheap", "easy" ],
status => "WARNING",
results => [
{ id => "class_method",
runtime => "0.000",
tags => [ "cheap", "easy" ],
status => "WARNING",
},
{ id => "object_method",
runtime => "0.000",
tags => [ "cheap", "easy" ],
status => "WARNING",
}
],
DESCRIPTION
Allows you to create callbacks that check the health of your
application and return a status result.
There are several things this is trying to enable:
* A fast HTTP endpoint that can be used to verify that a web app can
serve traffic. To this end, it may be useful to use the runtime
support option, available in HealthChecks::Diagnostic.
* A more complete check that verifies all the things work after a
deployment.
* The ability for a script, such as a cronjob, to verify that it's
dependencies are available before starting work.
* Different sorts of monitoring checks that are defined in your
codebase.
Results returned by these checks should correspond to the GSG Health
Check Standard <https://grantstreetgroup.github.io/HealthCheck.html>.
You may want to use HealthCheck::Diagnostic to simplify writing your
check slightly.
METHODS
new
my $checker = HealthCheck->new( id => 'my_checker' );
ATTRIBUTES
checks
An arrayref that is passed to "register" to initialize checks.
tags
An arrayref used as the default set of tags for any checks that don't
override them.
Any other parameters are included in the "Result" hashref returned.
Some recommended things to include are:
id
The unique id for this check.
label
A human readable name for this check.
runbook
A runbook link to help troubleshooting if the status is not OK.
register
$checker->register({
invocant => $class_or_object,
check => $method_on_invocant_or_coderef,
more => "any other params are passed to the check",
});
Takes a list or arrayref of check definitions to be added to the
( run in 0.602 second using v1.01-cache-2.11-cpan-39bf76dae61 )