Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/macpaw/symfony-health-check-bundle
Symfony Health Check Bundle Monitoring Project Status
https://github.com/macpaw/symfony-health-check-bundle
bundle check health health-check healthcheck monitoring php symfony symfony-bundle symfony-health-check
Last synced: 3 days ago
JSON representation
Symfony Health Check Bundle Monitoring Project Status
- Host: GitHub
- URL: https://github.com/macpaw/symfony-health-check-bundle
- Owner: MacPaw
- License: mit
- Created: 2021-04-29T18:30:37.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-12T14:25:15.000Z (4 months ago)
- Last Synced: 2024-12-17T00:14:48.499Z (7 days ago)
- Topics: bundle, check, health, health-check, healthcheck, monitoring, php, symfony, symfony-bundle, symfony-health-check
- Language: PHP
- Homepage: https://github.com/MacPaw/symfony-health-check-bundle
- Size: 193 KB
- Stars: 50
- Watchers: 9
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Symfony Health Check Bundle
=================================| Version | Build Status | Code Coverage |
|:---------:|:-------------:|:-----:|
| `master`| [![CI][master Build Status Image]][master Build Status] | [![Coverage Status][master Code Coverage Image]][master Code Coverage] |
| `develop`| [![CI][develop Build Status Image]][develop Build Status] | [![Coverage Status][develop Code Coverage Image]][develop Code Coverage] |Installation
============Step 1: Download the Bundle
----------------------------------
Open a command console, enter your project directory and execute:```console
composer require macpaw/symfony-health-check-bundle
```### Applications that don't use Symfony Flex
enable the bundle by adding it to the list of registered bundles in config/bundles.php
```php
// config/bundles.php
['all' => true],// ...
];
```Create Symfony Health Check Bundle Config:
----------------------------------Configurating health check - all available you can see [here](https://github.com/MacPaw/symfony-health-check-bundle/tree/master/src/Check).
```yaml
# config/packages/symfony_health_check.yaml`
symfony_health_check:
health_checks:
- id: symfony_health_check.doctrine_check
ping_checks:
- id: symfony_health_check.status_up_check
```
Change response code:
- default response code is 200.
- determine your custom response code in case of some check fails (Response code must be a valid HTTP status code)
```yaml
symfony_health_check:
health_checks:
- id: symfony_health_check.doctrine_check
ping_checks:
- id: symfony_health_check.status_up_check
ping_error_response_code: 500
health_error_response_code: 404
```Create Symfony Health Check Bundle Routing Config:
----------------------------------
`config/routes/symfony_health_check.yaml````yaml
health_check:
resource: '@SymfonyHealthCheckBundle/Resources/config/routes.xml'
```Step 3: Configuration
=============Security Optional:
----------------------------------If you are using [symfony/security](https://symfony.com/doc/current/security.html) and your health check is to be used anonymously, add a new firewall to the configuration
```yaml
# config/packages/security.yaml
firewalls:
healthcheck:
pattern: ^/health
security: false
ping:
pattern: ^/ping
security: false
```Step 4: Additional settings
=============Add Custom Check:
----------------------------------
It is possible to add your custom health check:```php