Symfony Health Check Bundle Monitoring Project Status

Overview

Symfony Health Check Bundle

Version Build Status Code Coverage
master CI Coverage Status
develop CI Coverage Status

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute:

Applications that use Symfony Flex

$ composer require macpaw/symfony-health-check-bundle

Applications that don't use Symfony Flex

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require macpaw/symfony-health-check-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            SymfonyHealthCheckBundle\SymfonyHealthCheckBundle::class => ['all' => true],
        );

        // ...
    }

    // ...
}

Create Symfony Health Check Bundle Config:

config/packages/symfony_health_check.yaml

Configurating health check - all available you can see here.

symfony_health_check:
    health_checks:
        - id: symfony_health_check.doctrine_check

Create Symfony Health Check Bundle Routing Config:

config/routes/symfony_health_check.yaml

health_check:
    resource: '@SymfonyHealthCheckBundle/Resources/config/routes.xml'

Step 3: Configuration

Security Optional:

config/packages/security.yaml

If you are using symfony/security and your health check is to be used anonymously, add a new firewall to the configuration

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

Step 4: Additional settings

Add Custom Check:

It is possible to add your custom health check:

<?php

declare(strict_types=1);

namespace YourProject\Check;

class CustomCheck implements CheckInterface
{
    private const CHECK_RESULT_KEY = 'customConnection';
    
    public function check(): array
    {
        return [self::CHECK_RESULT_KEY => true];
    }
}

Then we add our custom health check to collection

symfony_health_check:
    health_checks:
        - id: symfony_health_check.doctrine_check
        - id: custom_health_check

How Change Route:

You can change the default behavior with a light configuration, remember to return to Step 3 after that:

health:
    path: /your/custom/url
    methods: GET
    controller: SymfonyHealthCheckBundle\Controller\HealthController::healthCheckAction
You might also like...
Bundle to integrate Tactician with Symfony projects

TacticianBundle Symfony2 Bundle for the Tactician library https://github.com/thephpleague/tactician/ Installation Step 1: Download the Bundle Open a c

A Symfony bundle that provides #StandWithUkraine banner and has some built-in features to block access to your resource for Russian-speaking users.
A Symfony bundle that provides #StandWithUkraine banner and has some built-in features to block access to your resource for Russian-speaking users.

StandWithUkraineBundle На русском? Смотри README.ru.md This bundle provides a built-in StandWithUkraine banner for your Symfony application and has so

Performance monitoring Lighthouse with GraphQL Hive.

Lighthouse GraphQL Hive GraphQL Hive can measure and collect data against all your GraphQL operations and generate analytics on them. This package aim

OpenAPI(v3) Validators for Symfony http-foundation, using `league/openapi-psr7-validator` and `symfony/psr-http-message-bridge`.

openapi-http-foundation-validator OpenAPI(v3) Validators for Symfony http-foundation, using league/openapi-psr7-validator and symfony/psr-http-message

Fork of Symfony Rate Limiter Component for Symfony 4

Rate Limiter Component Fork (Compatible with Symfony =4.4) The Rate Limiter component provides a Token Bucket implementation to rate limit input and

Enter-to-the-Matrix-with-Symfony-Console - Reproduction of the
Enter-to-the-Matrix-with-Symfony-Console - Reproduction of the "Matrix characterfall" effect with the Symfony Console component.

Enter to the Matrix (with Symfony Console) Reproduction of the "Matrix characterfall" effect with the Symfony Console component. Run Clone the project

Meta package tying together all the key packages of the Symfony CMF project.

This repository is no longer maintained Due to lack of interest, we had to decide to discontinue this repository. The CMF project focusses on the Rout

This project lists all the mandatory steps I recommend to build a Website using Symfony, Twig, Doctrine.
This project lists all the mandatory steps I recommend to build a Website using Symfony, Twig, Doctrine.

{% raw %} -- keep this for Jekyll to fully bypass this documents, because of the Twig tags. Symfony Website Checklist 📑 Summary~~~~ Elevator pitch P

Copy of hautelook/alice-bundle v2.9.0

AliceBundle A Symfony bundle to manage fixtures with nelmio/alice and fzaninotto/Faker. The database support is done in FidryAliceDataFixtures. Check

Comments
  • Multiple routes with different check

    Multiple routes with different check

    Hi!

    Is it possible to have multiple routes configured to have different checks in different routes? Use case is kubernetes liveness and readiness probes:

    • liveness probe is the one we would like to have running pretty often (each 10 sec) and having doctrine check in it is too much.
    • but readiness probe can be done using longer interval (once per minute) and include doctrine check to make sure everything is setup correctly

    Thanks!

    opened by olegstepura 10
  • Doctrine deprecated ping()

    Doctrine deprecated ping()

    In this https://github.com/doctrine/dbal/pull/4119 doctrine deprecated the ping method and is removed in version 3. I think it would be a good idea to reflect this in https://github.com/MacPaw/symfony-health-check-bundle/blob/develop/src/Check/DoctrineCheck.php. Currently the doctrine check return doctrine => false if you're using doctrine 3.

    opened by optior 3
  • Deprecation message autowiring alias ContainerInterface

    Deprecation message autowiring alias ContainerInterface

    Using Symfony 5.3 the profiler shows the following deprecation message:

    Since symfony/dependency-injection 5.1: The "Symfony\Component\DependencyInjection\ContainerInterface" autowiring alias is deprecated. Define it explicitly in your app if you want to keep using it. It is being referenced by the "symfony_health_check.doctrine_check" service.
    Show context    Hide trace
    {▼
      /app/vendor/symfony/dependency-injection/Compiler/ResolveReferencesToAliasesPass.php:68 {▼
        Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass->getDefinitionId(string $id, ContainerBuilder $container): string …
        ›     $deprecation = $alias->getDeprecation($id);
        ›     trigger_deprecation($deprecation['package'], $deprecation['version'], rtrim($deprecation['message'], '. ').'. It is being referenced by the "%s" '.($container->hasDefinition($this->currentId) ? 'service.' : 'alias.'), $this->currentId);
        › }
      }
      /app/vendor/symfony/dependency-injection/Compiler/ResolveReferencesToAliasesPass.php:51 {▼
        › 
        › $defId = $this->getDefinitionId($id = (string) $value, $this->container);
        › 
      }
    }
    
    opened by ToshY 3
Releases(v1.0.2)
  • v1.0.2(Feb 8, 2022)

    What's Changed

    • feat: update readme documentation @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/54

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Jan 18, 2022)

    What's Changed

    • fix: update upgrade documentation @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/53

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v1.0.0...v1.0.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 18, 2022)

    What's Changed

    • Feat: remove custom error if service not found and create response standart response dto by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/47
    • feat: add new route ping by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/48
    • Release v1.0.0 by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/52

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v0.8.1...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.1(Jan 16, 2022)

    What's Changed

    • Feat: remove automatical release by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/50

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v0.8.0...v0.8.1

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Dec 24, 2021)

    What's Changed

    • feat: add run phpunit for symfony 6 by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/33
    • feat: validate composer by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/35
    • feat: fix use deprecated dbal connection function ping by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/37
    • Create LICENSE by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/39
    • Update issue templates by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/41
    • Create CODE_OF_CONDUCT.md by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/40

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v0.6.0...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Dec 15, 2021)

    What's Changed

    • feat: add run phpunit for symfony 6 by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/33
    • Feat/add validate composer by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/35
    • feat: fix use deprecated dbal connection function ping by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/37
    • New Release by @Yozhef in https://github.com/MacPaw/symfony-health-check-bundle/pull/38

    Full Changelog: https://github.com/MacPaw/symfony-health-check-bundle/compare/v0.6.0...v0.7.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Nov 30, 2021)

  • v0.5.0(Nov 30, 2021)

  • v0.4.0(Nov 30, 2021)

  • v0.2.0(Jul 24, 2021)

  • v0.1.1(May 13, 2021)

Check a project's code coverage, optionally enforcing a minimum value

coverage-check Display the code coverage for a project using a clover.xml file, optionally enforcing a minimum code coverage percentage. This package

Permafrost Software 15 Aug 9, 2022
This bundle provides tools to build a complete GraphQL server in your Symfony App.

OverblogGraphQLBundle This Symfony bundle provides integration of GraphQL using webonyx/graphql-php and GraphQL Relay. It also supports: batching with

Webedia - Overblog 720 Dec 25, 2022
Pure PHP implementation of GraphQL Server – Symfony Bundle

Symfony GraphQl Bundle This is a bundle based on the pure PHP GraphQL Server implementation This bundle provides you with: Full compatibility with the

null 283 Dec 15, 2022
DataTables bundle for Symfony

Symfony DataTables Bundle This bundle provides convenient integration of the popular DataTables jQuery library for realtime Ajax tables in your Symfon

Omines Internetbureau 199 Jan 3, 2023
GraphQL Bundle for Symfony 2.

Symfony 2 GraphQl Bundle Use Facebook GraphQL with Symfony 2. This library port laravel-graphql. It is based on the PHP implementation here. Installat

Sergey Varibrus 35 Nov 17, 2022
An Unleash bundle for Symfony applications to provide an easy way to use feature flags

Unleash Bundle An Unleash bundle for Symfony applications. This provide an easy way to implement feature flags using Gitlab Feature Flags Feature. Ins

Stogon 7 Oct 20, 2022
A bundle providing routes and glue code between Symfony and a WOPI connector.

WOPI Bundle A Symfony bundle to facilitate the implementation of the WOPI endpoints and protocol. Description The Web Application Open Platform Interf

Champs-Libres 5 Aug 20, 2022
Mediator - CQRS Symfony bundle. Auto Command/Query routing to corresponding handlers.

Installation $ composer require whsv26/mediator Bundle configuration // config/packages/mediator.php return static function (MediatorConfig $config)

Alexander Sv. 6 Aug 31, 2022
Symfony bundle for EventSauce (WIP)

Symfony EventSauce (WIP) This bundle provides the basic and extended container configuration of symfony for the EventSauce library. Before using it, I

Andrew Pakula 8 Dec 19, 2022
Symfony bundle integrating server-sent native notifications

Symfony UX Notify Symfony UX Notify is a Symfony bundle integrating server-sent native notifications in Symfony applications using Mercure. It is part

Symfony 6 Dec 15, 2022