Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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