PHPackages                             alahaxe/healthcheck-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alahaxe/healthcheck-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alahaxe/healthcheck-bundle
==========================

Extensible healthcheck bundle for SF

v2.0.2(2y ago)110.0kMITPHPPHP ^8.0

Since Jan 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lahaxearnaud/healthcheck-bundle)[ Packagist](https://packagist.org/packages/alahaxe/healthcheck-bundle)[ RSS](/packages/alahaxe-healthcheck-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (18)Versions (10)Used By (0)

HealthCheck Bundle
==================

[](#healthcheck-bundle)

[![DeepSource](https://camo.githubusercontent.com/6c8731f0c9d235b5a89d71cf4728a3d154da1bfb0fd8eb2682b1eff6bcee8ba1/68747470733a2f2f64656570736f757263652e696f2f67682f6c616861786561726e6175642f6865616c7468636865636b2d62756e646c652e7376672f3f6c6162656c3d6163746976652b6973737565732673686f775f7472656e643d7472756526746f6b656e3d3254796e41352d4f5531414449345352442d47526c675646)](https://deepsource.io/gh/lahaxearnaud/healthcheck-bundle/?ref=repository-badge)[![Packagist PHP Version Support](https://camo.githubusercontent.com/4f0a162eea9e84ba08e6cfdb0f4e3d8d8d45617b47232f4627311ae424c3ce33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616c61686178652f6865616c7468636865636b2d62756e646c65)](https://camo.githubusercontent.com/4f0a162eea9e84ba08e6cfdb0f4e3d8d8d45617b47232f4627311ae424c3ce33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616c61686178652f6865616c7468636865636b2d62756e646c65)[![Packagist Version](https://camo.githubusercontent.com/cfe1b03af4e367b3a69de4533419de9720c2e6354e788a384e2d7640653af140/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d62756e646c65)](https://camo.githubusercontent.com/cfe1b03af4e367b3a69de4533419de9720c2e6354e788a384e2d7640653af140/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d62756e646c65)[![GitHub Workflow Status (branch)](https://camo.githubusercontent.com/7ce09e82d781dd3b1e51c72abaea6df8d7b695433028cab939a4aabfcf4ea440/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c616861786561726e6175642f6865616c7468636865636b2d62756e646c652f43492f6d61696e)](https://camo.githubusercontent.com/7ce09e82d781dd3b1e51c72abaea6df8d7b695433028cab939a4aabfcf4ea440/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c616861786561726e6175642f6865616c7468636865636b2d62756e646c652f43492f6d61696e)

This bundle allows to easily expose a healthcheck on a Symfony application. You can add as many checks you want and create your own checks.

Installation
------------

[](#installation)

```
    composer require alahaxe/healthcheck-bundle
```

Quickstart
----------

[](#quickstart)

### 1- Router

[](#1--router)

Register package routes in your application

```
lahaxearnaud_healthcheck:
    resource: "@HealthCheckBundle/Resources/config/router.yaml"
```

Default route for healthcheck is `/_healthcheck`

### 2- Firewall

[](#2--firewall)

Allow any requests to call the healthcheck endpoint.

```
security:
    firewalls:
        healthcheck:
            pattern: ^/_healthcheck
            security: false
```

Use custom route
----------------

[](#use-custom-route)

Do not load resource `@HealthCheckBundle/Resources/config/router.yaml` file in your router but add:

```
lahaxearnaud_healthcheck:
    path: /my-healthcheck
    controller: Alahaxe\HealthCheckBundle\Controller\HealthCheckController
```

Adapte firewall pattern:

```
security:
    firewalls:
        healthcheck:
            pattern: ^/my-healthcheck
            security: false
```

Use available checks
--------------------

[](#use-available-checks)

NamePackageCurrent versionDoctrine check[alahaxe/healthcheck-doctrine](https://packagist.org/packages/alahaxe/healthcheck-doctrine)[![Packagist Version](https://camo.githubusercontent.com/967fa9cb7778ef22b0051cc761a987536689faebb84d94d0033925d208fda416/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d646f637472696e65)](https://camo.githubusercontent.com/967fa9cb7778ef22b0051cc761a987536689faebb84d94d0033925d208fda416/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d646f637472696e65)System check[alahaxe/healthcheck-system](https://packagist.org/packages/alahaxe/healthcheck-system)[![Packagist Version](https://camo.githubusercontent.com/bbb98d98a4cb6e819dbb4fb6030889dc153d72682d1369136a82a8b3e8269330/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d73797374656d)](https://camo.githubusercontent.com/bbb98d98a4cb6e819dbb4fb6030889dc153d72682d1369136a82a8b3e8269330/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d73797374656d)Redis check[alahaxe/healthcheck-redis](https://packagist.org/packages/alahaxe/healthcheck-redis)[![Packagist Version](https://camo.githubusercontent.com/72283ee40bca48f7f2d3eb4acadf3fadfc9d8281e1326420c94fc6c95f607b48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d7265646973)](https://camo.githubusercontent.com/72283ee40bca48f7f2d3eb4acadf3fadfc9d8281e1326420c94fc6c95f607b48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d7265646973)Curl check[alahaxe/healthcheck-curl](https://packagist.org/packages/alahaxe/healthcheck-curl)[![Packagist Version](https://camo.githubusercontent.com/cff414312ccb6ce826c4a1db12994eef5523e5c3ef2ce959152f17d331fb7cd8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d6375726c)](https://camo.githubusercontent.com/cff414312ccb6ce826c4a1db12994eef5523e5c3ef2ce959152f17d331fb7cd8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c61686178652f6865616c7468636865636b2d6375726c)Add a custom check
------------------

[](#add-a-custom-check)

Create a custom class that implements `CheckInterface`:

```
