vendic / magento2-oh-dear-checks
Oh Dear! Magento 2 module
Installs: 1
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 0
Type:magento2-module
Requires
- php: ~8.1.0|~8.2.0|~8.3.0|~8.4.0
- magento/framework: 103.0.*
- magento/magento-composer-installer: *
Suggests
- vendic/magento2-oh-dear-elasticsuite: ElasticSuite checks for Oh Dear
README
This module adds Application health monitoring using Oh Dear to Magento 2. It allows you to easily write your own custom checks. Additionally, it ships with a number of checks out of the box.
Installation
composer require vendic/magento2-oh-dear-checks
Configuration
Some checks have an optional configuration. You can configure these checks in the env.php
. Example:
'ohdear' => [ \Vendic\OhDear\Checks\CpuLoad::class => [ 'max_load_last_minute' => 10, 'max_load_last_five_minutes' => 8, 'max_load_last_fifteen_minutes' => 6 ], \Vendic\OhDear\Checks\DatabaseConnectionCount::class => [ 'failed_treshold' => 100, 'warning_treshold' => 80 ], \Vendic\OhDear\Checks\PhpFpmCount::class => [ 'failed_treshold' => 100, 'warning_treshold' => 80 ], ]
Checks
TODO
Write your own checks
- Create a new class that implements
Vendic\OhDear\Interfaces\CheckInterface
, place it in 'Checks'. This class will contain the main logic of your check. - Add your new class to the 'checks' argument of
Vendic\OhDear\Api\CheckListInterface
<type name="Vendic\OhDear\Api\CheckListInterface"> <arguments> <argument name="checks" xsi:type="array"> ... <item name="your_new_check" xsi:type="object">Vendic\OhDear\Checks\YourNewCheck</item> ... </argument> </arguments> </type>
- Preferabbly add a test for your check. See
Vendic\OhDear\Test\Integration\Checks\
for examples. - Test your output on: https://magento2.test/oh-dear-health-application-check-results. Your GET request should include the header
oh-dear-health-check-secret
. The header value should match the Magento config value ofohdear/health_check/secret
. If you don't have this header, you will get a 'No health secret provided' response. - Open a PR with your new check!