3slab / vdm-healthcheck-bundle
提供简单的健康检查端点,同时检查依赖关系
1.2.0
2024-03-26 15:16 UTC
Requires
- php: >=7.2
- symfony/framework-bundle: ^5.4|^6.4
- symfony/property-access: ^5.4|^6.4
- symfony/serializer: ^5.4|^6.4
- symfony/yaml: ^5.4|^6.4
Requires (Dev)
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- ext-sqlite3: *
- ext-xml: *
- doctrine/doctrine-bundle: ^2
- phpunit/phpunit: ^8|^9
- squizlabs/php_codesniffer: 3.*
- symfony/browser-kit: ^5.4
- symfony/css-selector: ^5.4
- symfony/http-client: ^5.4
Suggests
- doctrine/dbal: check a connection to an sql database
- doctrine/mongodb-odm-bundle: check a connection to a mongo database with doctrine odm
- symfony/http-client: check a dependent http service is up
This package is auto-updated.
Last update: 2024-09-26 16:32:40 UTC
README
此包提供实现简单健康检查功能的所有工具。
安装
composer require 3slab/vdm-healthcheck-bundle
并在 routing.yml
中加载路由
vdm_healthcheck: resource: "@VdmHealthcheckBundle/Resources/config/routing.yml" prefix: /
配置
将配置放在 config/packages/vdm_healthcheck.yaml
文件中。这是默认配置
vdm_healthcheck: secret: ~ liveness_path: /liveness liveness_checkers: {} readiness_path: /readiness readiness_checkers: {}
liveness_checkers
和 readiness_checkers
是哈希表。键是检查的名称,值是配置检查的哈希表。
vdm_healthcheck: liveness_checkers: name_of_your_checker: type: <checker type> arguments: []
每个检查器都有一个名称、一个类型以及其类型依赖的构造函数参数。参数支持用 %
包围的参数或以 @
开头的服务ID。
示例
vdm_healthcheck:
liveness_checkers:
db:
type: dbal
arguments:
- '@doctrine.dbal.default_connection'
检查器类型
您还可以 创建自己的检查器