vendic/magento2-oh-dear-checks
Composer 安装命令:
composer require vendic/magento2-oh-dear-checks
包简介
Oh Dear! Magento 2 module
README 文档
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\Diskspace::class => [ 'max_percentage_used' => '86' ], \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 ], ]
Disabling Checks
To disable any check, add an entry to your env.php with the check class name and set enabled to false:
'ohdear' => [ 'Vendic\\OhDear\\Checks\\CpuLoad' => [ 'enabled' => false ], 'Vendic\\OhDear\\Checks\\Diskspace' => [ 'enabled' => false ], 'Vendic\\OhDear\\Checks\\TwoFactorAuthentication' => [ 'enabled' => false ] ],
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!
vendic/magento2-oh-dear-checks 适用场景与选型建议
vendic/magento2-oh-dear-checks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.59k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2024 年 12 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vendic/magento2-oh-dear-checks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vendic/magento2-oh-dear-checks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 3
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-06