dennzo / health-check
A library containing tools for outputting json information for monitoring systems.
1.0.0-beta
2023-03-03 16:45 UTC
Requires
- php: >=7.4
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^8.5
- symfony/phpunit-bridge: ^5.0
- symfony/test-pack: ^1.0
This package is auto-updated.
Last update: 2024-10-30 02:16:19 UTC
README
This package contains a standardized format for easy monitoring checks.
The tools will generate an output in the below format.
{ "status":"OK", "applicationName":"foo-service", "version":"1.1", "environment":"prod" }
You should set the status
manually.
The following information will be automatically detected.
- GIT Version
- Development Environment (ex. dev, test, prod)
- Name of the application
The git tag and application name is ONLY detected automatically if...
- ...the server has git installed
- ...the application itself is a git repository
Installation
composer require dennzo/monitoring-tools
Usage
Use the Class MonitoringTools to implement this feature in your application.
Depending on your application you will need to create the MonitoringController and define a health_check route.
// Json MonitoringTools::provideHealthCheckAsJson(); // Object MonitoringTools::provideHealthCheckAsObject();
You can find some more examples and explanation here.