PHPackages                             ekino/newrelic-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. ekino/newrelic-bundle

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

ekino/newrelic-bundle
=====================

Integrate New Relic into Symfony2

2.4.0(4y ago)28111.2M↓24.9%105[12 issues](https://github.com/ekino/EkinoNewRelicBundle/issues)[7 PRs](https://github.com/ekino/EkinoNewRelicBundle/pulls)8MITPHPPHP ^7.1 | ^8.0

Since May 2Pushed 2y ago24 watchersCompare

[ Source](https://github.com/ekino/EkinoNewRelicBundle)[ Packagist](https://packagist.org/packages/ekino/newrelic-bundle)[ Docs](https://github.com/ekino/EkinoNewRelicBundle)[ RSS](/packages/ekino-newrelic-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (31)Used By (8)

Ekino NewRelic Bundle
=====================

[](#ekino-newrelic-bundle)

[![Build Status](https://camo.githubusercontent.com/2f7e1ecc0849b4c6e576665728377436ca33a073e668b5555f5d0f46b6750e76/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f656b696e6f2f456b696e6f4e657752656c696342756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/ekino/EkinoNewRelicBundle)[![Latest Version](https://camo.githubusercontent.com/c28a8281c9fb516681b7ef8040ab33eb01fbb7ca300adfcce1749529940d960d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f656b696e6f2f456b696e6f4e657752656c696342756e646c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ekino/EkinoNewRelicBundle/releases)[![Code Coverage](https://camo.githubusercontent.com/26a113d7d5478f6581d2ea6deabb9242c919f283f7ea93a7c53717d1b921130a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f656b696e6f2f456b696e6f4e657752656c696342756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ekino/EkinoNewRelicBundle)[![Quality Score](https://camo.githubusercontent.com/31b0375484f6718cca1a30ada98e869236998a9cabd7f7fbba2cc221dd1b808c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f656b696e6f2f456b696e6f4e657752656c696342756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ekino/EkinoNewRelicBundle)[![Total Downloads](https://camo.githubusercontent.com/b4707d41b888680860edec84a4d8e8b362f95e22a8b4df17604bb211071e3e19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656b696e6f2f6e657772656c69632d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ekino/newrelic-bundle)

This bundle integrates the NewRelic PHP API into Symfony. For more information about NewRelic, please visit . The built-in New Relic agent doesn't add as much Symfony integration as it claims. 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 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 New Relic (something new relic doesn't do too well itself as symfony aggressively catches all exceptions/errors). It also ensures all HTTP Exceptions (4xx codes) are logged as notices in New Relic and not exceptions to reduce the noise in New Relic.
4. **Interactor Service**: It provides you the New Relic PHP Agent API via a Service class `NewRelicInteractorInterface::class` so in my code, I can inject it into any class, controller, service and do stuff like -

    ```
    // Bundle
    $this->newRelic->addCustomParameter('name', 'john');

    // Extension
    if (extension_loaded('newrelic')) {
        \newrelic_add_custom_parameter('name', 'john');
    }
    ```
5. **Logging Support**: In development, you are unlikely to have New Relic setup. There's a configuration to enable logging which outputs all New Relic actions to your Symfony log, hence emulating what it would actually do in production.
6. **Ignored Routes, Paths, Commands**: You can configure a list of route name, url paths and console commands to be ignored from New Relic traces.

    [![image](https://cloud.githubusercontent.com/assets/670655/5153003/5c956c1e-7235-11e4-9eb2-d203fa42420b.png)](https://cloud.githubusercontent.com/assets/670655/5153003/5c956c1e-7235-11e4-9eb2-d203fa42420b.png)
7. **Misc**: There are other useful configuration like your New Relic API Key, explicitly defining your app name instead of php.ini, notifying New Relic about new deployments via capifony, etc.

[![Ekino NewRelicBundle](https://camo.githubusercontent.com/a609736ae9198e8d4485ca2865a8bf62b27e803f6f0733957cdfbf9c4b98a2f0/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f627566623666386f30656e6435786f2f656b696e6f5f6e657772656c69635f62756e646c652e706e67 "Ekino NewRelicBundle")](https://camo.githubusercontent.com/a609736ae9198e8d4485ca2865a8bf62b27e803f6f0733957cdfbf9c4b98a2f0/68747470733a2f2f646c2e64726f70626f782e636f6d2f732f627566623666386f30656e6435786f2f656b696e6f5f6e657772656c69635f62756e646c652e706e67)

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

[](#installation)

### Step 0 : Install NewRelic

[](#step-0--install-newrelic)

review  ...

### Step 1: add dependency

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

```
$ composer require ekino/newrelic-bundle
```

### Step 2 : Register the bundle

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

Then register the bundle with your kernel:

```
