PHPackages                             arty/probe-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. arty/probe-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

arty/probe-bundle
=================

A Symfony bundle to create Probes

v1.5.0(2mo ago)41.9k↓59.9%MITPHPPHP ^8.3CI passing

Since Jan 4Pushed 2mo agoCompare

[ Source](https://github.com/ArthurJCQ/probe-bundle)[ Packagist](https://packagist.org/packages/arty/probe-bundle)[ RSS](/packages/arty-probe-bundle/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (21)Versions (10)Used By (0)

ArtyProbeBundle
===============

[](#artyprobebundle)

A Symfony bundle to create and run diagnostic probes.

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

[](#installation)

Add the bundle to your project via Composer:

```
composer require arty/probe-bundle
```

If you are not using Symfony Flex, you will need to register the bundle manually in `config/bundles.php`:

```
return [
    // ...
    Arty\ProbeBundle\ArtyProbeBundle::class => ['all' => true],
];
```

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

[](#configuration)

### YAML Configuration

[](#yaml-configuration)

Create a configuration file at `config/packages/arty_probe.yaml`:

```
arty_probe:
    probe_status_history_class: App\Entity\ProbeStatusHistory
    alerting:
        enabled: true
        channel: email # or chat
        to: "admin@example.com" # required for email channel
```

### Alerting Channels

[](#alerting-channels)

The bundle uses [Symfony Notifier](https://symfony.com/doc/current/notifier.html) to send alerts when a probe fails for the first time. Two channels are available: `email` and `chat`.

#### Email Channel

[](#email-channel)

Install and configure [Symfony Mailer](https://symfony.com/doc/current/mailer.html):

```
composer require symfony/mailer
```

```
# config/packages/arty_probe.yaml
arty_probe:
    alerting:
        enabled: true
        channel: email
        to: "admin@example.com"
```

Make sure your mailer is configured (e.g. `MAILER_DSN` in `.env`). The sender address is configured in your mailer config:

```
# config/packages/mailer.yaml
framework:
    mailer:
        dsn: '%env(MAILER_DSN)%'
        envelope:
            sender: 'no-reply@example.com'
```

#### Chat Channel (Slack, Microsoft Teams, ...)

[](#chat-channel-slack-microsoft-teams-)

Install the transport for your chat service:

```
# Pick one:
composer require symfony/slack-notifier
composer require symfony/microsoft-teams-notifier
```

Configure the transport DSN and the bundle:

```
# config/packages/notifier.yaml
framework:
    notifier:
        chatter_transports:
            slack: '%env(SLACK_DSN)%'

# config/packages/arty_probe.yaml
arty_probe:
    alerting:
        enabled: true
        channel: chat
```

Set the DSN in your `.env`:

```
SLACK_DSN=slack://TOKEN@default?channel=CHANNEL
```

> By default, if Symfony Messenger is installed, notifications are sent asynchronously. To send them synchronously, add `message_bus: false` to your `framework.notifier` config. See [Symfony Notifier docs](https://symfony.com/doc/current/notifier.html) for details.

### Create the Entity

[](#create-the-entity)

Make it extend the base `Arty\ProbeBundle\Entity\ProbeStatusHistory` :

```
