adata-team / healthchecker
用于检查某些服务是否健康的包
v2.1.0
2024-06-19 09:33 UTC
Requires
- php: ^7.3||^8.1
- guzzlehttp/guzzle: ^6.0||^7.0
- phpunit/phpunit: ^9.0||^10.0
Requires (Dev)
- orchestra/testbench: ^6.0||^8.0
This package is auto-updated.
Last update: 2024-09-19 10:20:14 UTC
README
Lumen/Laravel应用的快速入门
1. 使用composer安装
composer require adata-team/healthchecker
2. 在config/health.php
中创建配置文件,内容如下
<?php return [ 'router' => [ 'group_prefix' => 'health', 'check_prefix' => 'check', 'check_name' => 'healthCheck', 'url' => '/health/check', ], ];
上述代码是运行此插件所需的最小配置。
group_prefix - the name of the route group, for health
check_prefix - health route prefix
check_name - route name
url - url where healthcheck will be available
在Examples文件夹中查看完整文档
3. 在Lumen bootstrap/app.php
中注册服务提供者
$app->register(Adata\HealthChecker\HealthCheckerProvider::class);
并注册配置文件
$app->configure('health');
配置文件中的参数
配置要检查的服务
RabbitMQ配置参数
- type = rabbitmq
Redis配置参数
- type = redis
数据库配置参数
- type = database
HealthCheck配置参数
- type = healthCheck
HTTP配置参数
- type = http
ElasticSearch配置参数
- type = elastic
文件服务器配置参数
- type = fileServer
Arango配置参数
- type = arango