PHPackages                             cushon/health-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. cushon/health-bundle

ActiveSymfony-bundle

cushon/health-bundle
====================

A Symfony bundle for microservice health checks

0.3.1(3y ago)18.6k1MITPHPPHP ^8.1CI failing

Since May 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Smarterly/symfony-health-bundle)[ Packagist](https://packagist.org/packages/cushon/health-bundle)[ RSS](/packages/cushon-health-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (37)Versions (12)Used By (0)

Cushon Health Bundle
====================

[](#cushon-health-bundle)

[![Minimum PHP version: 8.1.0](https://camo.githubusercontent.com/1e519268c238550cc807e1a8afd8e60c03ce71d6de2500cddc2ec51916811668/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312e302532422d626c75652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Smarterly/symfony-health-bundle)[![Version](https://camo.githubusercontent.com/15afd48550b694e5ed6fba431244c7a5971ed3bf1f47fb89757c9e40b6439064/687474703a2f2f706f7365722e707567782e6f72672f637573686f6e2f6865616c74682d62756e646c652f76657273696f6e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cushon/health-bundle)[![License](https://camo.githubusercontent.com/c26cb68448c14bcdb0ebc4f5acacb6b629fb80331adde4a6e9d0362413fdd7eb/687474703a2f2f706f7365722e707567782e6f72672f637573686f6e2f6865616c74682d62756e646c652f6c6963656e73653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cushon/health-bundle)[![Continuous Integration](https://github.com/Smarterly/symfony-health-bundle/workflows/Continuous%20Integration/badge.svg)](https://github.com/Smarterly/symfony-health-bundle/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/669b40e7b3b0ee8552266699dbcfd2265d0b5faa3fb5b824ffff64311af2288f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f536d61727465726c792f73796d666f6e792d6865616c74682d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Smarterly/symfony-health-bundle/?branch=main)[![codecov](https://camo.githubusercontent.com/c2712491c1a2ecc368cb44b477961ceba7c3af0970fdce37f3430b256bbe1e3b/68747470733a2f2f636f6465636f762e696f2f67682f536d61727465726c792f73796d666f6e792d6865616c74682d62756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/Smarterly/symfony-health-bundle)[![Security Rating](https://camo.githubusercontent.com/395cb7c93b002f0916840f8492e8ebdcca25d66a9147fe8056154a2f44d7f9d7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d536d61727465726c795f73796d666f6e792d6865616c74682d62756e646c65266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=Smarterly_symfony-health-bundle)

---

Overview
--------

[](#overview)

This bundle provides a mini-framework for a [Symfony](https://symfony.com/) application to be queried on it's current "health". The specifics of what "healthy" and "unhealthy" are depend on the application and must be defined. However, the boilerplate of creating Symfony Controllers and Console Commands to make a query (and provide a health report) are taken care of.

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

[](#installation)

The only supported method of installing the bundle is via [`composer`](https://getcomposer.org/):

```
composer require cushon/health-bundle
```

### Recommended Packages and Extensions

[](#recommended-packages-and-extensions)

Several libraries and packages are included in the `suggest` section of the `composer.jspn`. The bundle utilises the `Set` class of [PHP Data Structures](https://www.php.net/manual/en/book.ds.php). However, the [DS polyfill](https://packagist.org/packages/php-ds/php-ds) is used to ensure that the bundle can run on a stack without the extension.

Configuration
-------------

[](#configuration)

### API Error Response Code

[](#api-error-response-code)

When a service is deemed to be unhealthy, the API endpoint will return a 500 status code by default. This is configurable by adding the following to your Symfony config YAML file:

```
    cushon_health:
        error_response_code: !php/const Symfony\Component\HttpFoundation\Response::HTTP_SERVICE_UNAVAILABLE
```

Note that the above snippet illustrates an error response code of 503. You can specify any status code here, including a 200 if you wish.

The Console Command
-------------------

[](#the-console-command)

### Usage

[](#usage)

```
bin/console cushon:health
```

An example of the output:

[![](docs/assets/img/screenshots/console-output-application-healthy.png)](docs/assets/img/screenshots/console-output-application-healthy.png)

The JSON Api Endpoint:
----------------------

[](#the-json-api-endpoint)

The default endpoint is available at `/health`.

Getting Started
---------------

[](#getting-started)

Please see the section on creating a [Dependency Check](./docs/DEPENDENCY-CHECKS.md).

Structure
---------

[](#structure)

### Directories used in production builds

[](#directories-used-in-production-builds)

[`/src`](./src): Contains the bundle code. With minor deviations, this follows the standard design for the [Symfony Bundle System](https://symfony.com/doc/current/bundles.html).

[`/docs`](./docs): Collation of documentation and metrics for the project.

### Directories &amp; Files Not Included In Releases

[](#directories--files-not-included-in-releases)

The following files and directories are not included in the release to reduce archive complexity. Should you want to see the entire project, you should either clone the project locally or choose not to prefer the distribution in your `composer` file.

[`/app`](./app) - Contains a Symfony 6 app for running integration and behavioural tests, and to provide examples

[`/docker`](./docker) - Contains Dockerfiles and nginx configuration to run the API example and used for testing against PHP versions. The [docker-compose.yml](./docker-compose.yml) in the root of the project is similarly removed.

[`/features`](./features) - Contains [Gherkin](https://cucumber.io/docs/gherkin/) simplified scenarions to drive behavioural testing and provide [specification by example](https://www.tutorialspoint.com/behavior_driven_development/bdd_specifications_by_example.htm).

[`/tests`](./tests) - The tests are excluded when using a release.

Additionally, files to run testing and quality tooling (e.g. `infection.json`, `phpunit.xml.dist`) are also omitted.

Testing &amp; Quality
---------------------

[](#testing--quality)

The bundle is tested with both unit testing and behavioural testing with [phpUnit](https://phpunit.readthedocs.io/) and [behat](https://docs.behat.org/) respectively.

[![GitHub issues](https://camo.githubusercontent.com/f4ffa3007a606805fbe25b619d13153c8f1af096a76c465b763a46132ac298e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f536d61727465726c792f73796d666f6e792d6865616c74682d62756e646c652e737667)](https://github.com/Smarterly/symfony-health-bundle/issues)[![Coverage Status](https://camo.githubusercontent.com/30a3ac8e8f3522ebf4378eb2b2ec51d943a44fc6c53d866e7ea8a5902c5e9ee7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f536d61727465726c792f73796d666f6e792d6865616c74682d62756e646c652f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/Smarterly/symfony-health-bundle?branch=main)[![Technical Debt](https://camo.githubusercontent.com/f55c22d159f1bcad5f24308a13400a26644452b48ad4d9cf922dca8e8d636234/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d536d61727465726c795f73796d666f6e792d6865616c74682d62756e646c65266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/summary/new_code?id=Smarterly_symfony-health-bundle)[![Vulnerabilities](https://camo.githubusercontent.com/b8f0566f14bfe04f39809d6b8858714a491160243ce9d03ea8cd3cc270d5416e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d536d61727465726c795f73796d666f6e792d6865616c74682d62756e646c65266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/summary/new_code?id=Smarterly_symfony-health-bundle)[![Duplicated Lines (%)](https://camo.githubusercontent.com/edd1ac6428e18e7ec667862547d08a89b19a165b19334d80ecd499991b46ff6f/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d536d61727465726c795f73796d666f6e792d6865616c74682d62756e646c65266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/summary/new_code?id=Smarterly_symfony-health-bundle)[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~41 days

Total

6

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62ab3e34ffd6ff72a98201ef7fc4f803077e7b25d62f39c81257b27d3467e273?d=identicon)[shrikeh](/maintainers/shrikeh)

![](https://www.gravatar.com/avatar/b5dbed30e1ba4a7e53552ead1983fd797b02f7afaeb014088bb7f95bf79468f3?d=identicon)[lucyferrabee](/maintainers/lucyferrabee)

---

Top Contributors

[![shrikeh](https://avatars.githubusercontent.com/u/445227?v=4)](https://github.com/shrikeh "shrikeh (93 commits)")[![jamesm90](https://avatars.githubusercontent.com/u/40870255?v=4)](https://github.com/jamesm90 "jamesm90 (8 commits)")[![cpeake](https://avatars.githubusercontent.com/u/1265709?v=4)](https://github.com/cpeake "cpeake (1 commits)")[![CristianVladutCushon](https://avatars.githubusercontent.com/u/171814729?v=4)](https://github.com/CristianVladutCushon "CristianVladutCushon (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cushon-health-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/cushon-health-bundle/health.svg)](https://phpackages.com/packages/cushon-health-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
