PHPackages                             symsensor/actuator-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. symsensor/actuator-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

symsensor/actuator-bundle
=========================

Extensible bundle to provide runtime health or information about a deployed application

v1.1.0(2y ago)115.6k↑462.5%[2 issues](https://github.com/SymSensor/ActuatorBundle/issues)3MITPHP

Since Aug 9Pushed 2y agoCompare

[ Source](https://github.com/SymSensor/ActuatorBundle)[ Packagist](https://packagist.org/packages/symsensor/actuator-bundle)[ RSS](/packages/symsensor-actuator-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (4)Used By (3)

ActuatorBundle
==============

[](#actuatorbundle)

[![](https://github.com/SymSensor/ActuatorBundle/raw/main/docs/logo.png?raw=true)](https://github.com/SymSensor/ActuatorBundle/blob/main/docs/logo.png?raw=true)

ActuatorBundle provides basically two features:

- It provides an endpoint which can be used as a health probe url
- With another endpoint you can read runtime informations about the deployed software

It is also easily extensible, so you add your custom logic to both features. Some predefined extensions can be also found within this [GitHub organization](https://github.com/SymSensor).

The bundle is heavily inspired by [akondas/symfony-actuator-bundle](https://github.com/akondas/symfony-actuator-bundle).

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

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

```
$ composer require symsensor/actuator-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

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

```
$ composer require symsensor/actuator-bundle
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

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

```
// config/bundles.php

return [
    // ...
    SymSensor\ActuatorBundle\SymSensorActuatorBundle::class => ['all' => true],
];
```

After the installation you have to configure the routing in your `config/routes.yaml` file:

```
actuator:
  resource: '@SymSensorActuatorBundle/config/routing.yaml'
  prefix: /_actuator
```

The routing defines two endpoints:

- `/health`
- `/info`

You should secure the two endpoints with the builtin [Security](https://symfony.com/doc/current/security.html) so that the two endpoints are not public accessible.

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

[](#configuration)

The Bundle can be configured with a configuration file named `config/packages/sym_sensor_actuator.yaml`. Following snippet shows the default value for all configurations:

```
sym_sensor_actuator:
  health:
    enabled: true
    builtin:
      disk_space:
        enabled: true
        threshold: 52428800
        path: '%kernel.project_dir%'
  info:
    enabled: true
    builtin:
      php:
        enabled: true
      symfony:
        enabled: true
      git:
        enabled: true
```

Following table outlines the configuration:

keydefaultdescriptionsym\_sensor\_actuator.health.enabledtrueif the health endpoint should be enabledsym\_sensor\_actuator.health.disk\_space.enabledtrueif the builtin disk\_space health endpoint should be enabledsym\_sensor\_actuator.health.disk\_space.threshold52428800Size in bytes which has to be free in order that this health endpoint is "UP"sym\_sensor\_actuator.health.disk\_space.path'%kernel.project\_dir%'The directory which should be monitoredsym\_sensor\_actuator.info.enabledtrueif the info endpoint should be enabledsym\_sensor\_actuator.info.builtin.php.enabledtrueif the php info endpoint should be enabledsym\_sensor\_actuator.info.builtin.symfony.enabledtrueif the symfony info endpoint should be enabledsym\_sensor\_actuator.info.builtin.git.enabledtrueif the git info endpoint should be enabledExtending
---------

[](#extending)

### Health indicator

[](#health-indicator)

You can write your own health indicator and implement your own logic to determine the state of your application. To do so, you have to implement the interface `HealthIndicator` and tag your service with the tag `sym_sensor_actuator.health_indicator`.

So for example, add following class under `src/Health/CustomHealthIndicator.php`:

```
