2017 © Pedro Peláez
 

symfony-bundle health-check-bundle

A bundle that provides a simple /healthcheck route

image

ekreative/health-check-bundle

A bundle that provides a simple /healthcheck route

  • Friday, July 13, 2018
  • by mcfedr
  • Repository
  • 2 Watchers
  • 0 Stars
  • 5,886 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 28 % Grown

The README.md

Health Check Bundle

A bundle that provides a simple /healthcheck route, (*1)

Latest Stable Version License Build Status, (*2)

Install

Composer

composer require ekreative/health-check-bundle

AppKernel

Include the bundle in your AppKernel, (*3)

public function registerBundles()
{
    $bundles = [
        ...
        new Ekreative\HealthCheckBundle\EkreativeHealthCheckBundle(),

Routing

ekreative_health_check:
    resource: '@EkreativeHealthCheckBundle/Resources/config/routes.xml'

Security

You should make sure /healthcheck does not require authentication, (*4)

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

Configuration

By default healthcheck will check that your default doctrine connection is working., (*5)

Doctrine

To check more than one doctrine connection you should add the configuration, listing the names of the connections, (*6)

ekreative_health_check:
    doctrine:
        - 'default'
        - 'alternative'

You can also list doctrine connections that should be checked, but don't cause a failure, (*7)

ekreative_health_check:
    optional_doctrine:
        - 'another.optional'

Its possible to disable the doctrine check, (*8)

ekreative_health_check:
    doctrine_enabled: false

Timeout

Its recommended to change the default PDO connection timeout so that your health check will fail faster, (*9)

Add this under connection setting, (*10)

doctrine:
    dbal:
        connections:
            default:
                driver: pdo_mysql
                host: '%database_host%'
                options:
                    !php/const PDO::ATTR_TIMEOUT: 5

Redis

The bundle can also check that redis connections are working. You should add a list of service names to check, (*11)

This will require the PHP Redis extension enabled., (*12)

ekreative_health_check:
    redis:
        - 'redis'

You can also list redis connections that should be checked, but don't cause a failure, (*13)

ekreative_health_check:
    optional_redis:
        - 'redis.optional'

Timeout

Its recommended to change the default Redis connection timeout so that your health check will fail faster. Its the third argument to connect call for \Redis., (*14)

services:
    redis:
        class: Redis
        calls:
            - [ connect, ['%redis_host%', '%redis_port%', 5]]

Redis

When you want redis to be optional, you might want to use the provided RedisFactory (or your own) that catches any exceptions on connect. Without this a Redis failure will cause the container to fail, resulting in a 500 error., (*15)

services:
    redis:
        class: Redis
        factory: Ekreative\HealthCheckBundle\DependencyInjection\RedisFactory::get
        arguments:
            $host: 'example.com'

The Versions

13/07 2018

dev-master

9999999-dev

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

02/07 2018

1.3.0

1.3.0.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

26/06 2018

1.1.0

1.1.0.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

30/05 2017

1.0.3

1.0.3.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

30/05 2017

1.0.2

1.0.2.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

30/05 2017

1.0.1

1.0.1.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck

30/05 2017

1.0.0

1.0.0.0

A bundle that provides a simple /healthcheck route

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fred Cox

redis doctrine healthcheck