wt-health/laravel-health-check

检查应用程序重要部分的版本

v1.0.0 2024-05-21 20:16 UTC

This package is auto-updated.

Last update: 2024-09-21 21:21:59 UTC


README

Test CI

基于 spatie/laravel-health 添加自定义版本检查

安装与配置

 composer require wthealth/laravel-health-check

要在Datadog中记录日志和指标,您必须在您的设置中安排健康检查命令。

serverless.yaml

    artisan:
        handler: artisan
        runtime: php-83-console
        timeout: 720 # in seconds
        layers:
            - ${bref-extra:gd-php-83}
            - ${bref-extra:redis-php-83}
        events:
            - schedule:
                  rate: rate(12 hours)
                  input: '"health:check"'

使用方法

您可以相应地配置以下环境变量

HEALTH_API_ROUTE_ENABLED= # enable /health-check endpoint - default: false
HEALTH_API_KEY= # used to secure /health-check endpoint
HEALTH_API_PACKAGES= # packages ( comma separated ) to have its versions checked

您可以通过访问 /health-check 端点或运行 php artisan health:list --fresh 来执行健康检查

定时任务每天运行一次,并输出由Datadog摄取的日志

许可证

MIT许可证(MIT)。有关更多信息,请参阅 许可证文件