PHPackages                             mmft24/elastic-apm-symfony-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. mmft24/elastic-apm-symfony-bundle

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

mmft24/elastic-apm-symfony-bundle
=================================

Integrate Elastic APM into Symfony

2.0.0(5mo ago)00[2 PRs](https://github.com/mmft24/elastic-apm-symfony-bundle/pulls)MITPHPPHP ^8.3CI passing

Since Dec 3Pushed 2mo agoCompare

[ Source](https://github.com/mmft24/elastic-apm-symfony-bundle)[ Packagist](https://packagist.org/packages/mmft24/elastic-apm-symfony-bundle)[ Docs](https://github.com/mmft24/elastic-apm-symfony-bundle)[ GitHub Sponsors](https://github.com/@mmft24)[ RSS](/packages/mmft24-elastic-apm-symfony-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (5)Used By (0)

Elastic APM Symfony Bundle
==========================

[](#elastic-apm-symfony-bundle)

[![Latest Version](https://camo.githubusercontent.com/b14f044a3658af8806c9b75581850156fbe0d4d7b998b0a772d838f3680216ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d6d667432342f656c61737469632d61706d2d73796d666f6e792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/mmft24/elastic-apm-symfony-bundle/releases)[![Total Downloads](https://camo.githubusercontent.com/735eb659689224f1558e0937313991015271938664afda005b4c35fa1c830501/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6d667432342f656c61737469632d61706d2d73796d666f6e792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mmft24/elastic-apm-symfony-bundle)[![Tests](https://github.com/mmft24/elastic-apm-symfony-bundle/workflows/Tests/badge.svg)](https://github.com/mmft24/elastic-apm-symfony-bundle/actions)

This bundle integrates the Elastic APM PHP API into Symfony. For more information about Elastic APM, please visit . This bundle adds a lot more essentials. Here's a quick list:

1. **Better transaction naming strategy**: Your transaction traces can be named accurately by route names, the controller name, the request URI or you can decide on a custom naming strategy via a seamless interface that uses any naming convention you deem fit. While running console commands, it also sets the transaction name as the command name.
2. **Console Commands Enhancements**: While running console commands, its sets the options and arguments passed via the CLI as custom parameters to the transaction trace for easier debugging.
3. **Exception Listening**: It also captures all Symfony exceptions in web requests and console commands and sends them to Elastic APM.
4. **Interactor Service**: It provides access to most of the Elastic APM API via a Service class `ElasticApmInteractorInterface::class`. This can be injected it into any class, controller, service to communicate with APM. If the `adaptive` interactive is used then any APM calls will be ignored when the extension isn't loaded (for example in development environments).

    ```
    $this->apm->addLabel('name', 'john');
    ```
5. **Logging Support**: In development, you are unlikely to have Elastic APM setup. There's a configuration to enable logging which outputs all actions to your Symfony log, hence emulating what it would actually do in production.

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

[](#installation)

### Step 0: Install Elastic APM

[](#step-0-install-elastic-apm)

Follow .

### Step 1: Add dependency

[](#step-1-add-dependency)

#### With Symfony Flex (Recommended)

[](#with-symfony-flex-recommended)

```
composer require mmft24/elastic-apm-symfony-bundle
```

The bundle will be automatically registered in `config/bundles.php`.

#### Without Symfony Flex

[](#without-symfony-flex)

```
composer require mmft24/elastic-apm-symfony-bundle
```

Then manually register the bundle in `config/bundles.php`:

```
