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

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

check24-cp/newrelic-bundle
==========================

Enhanced interaction with NewRelic from within a Symfony environment, ensuring optimal monitoring and logging for your applications

1.0.15(1y ago)319.1k↓19.8%1MITPHPPHP &gt;=8.2

Since Oct 17Pushed 1y ago4 watchersCompare

[ Source](https://github.com/CHECK24-CP/newrelic-bundle)[ Packagist](https://packagist.org/packages/check24-cp/newrelic-bundle)[ RSS](/packages/check24-cp-newrelic-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (17)Versions (18)Used By (0)

CHECK24-CP New Relic Bundle
===========================

[](#check24-cp-new-relic-bundle)

Introduction
------------

[](#introduction)

This bundle provides an enhanced interaction with NewRelic from within a Symfony environment, ensuring optimal monitoring and logging for your applications.

Features
--------

[](#features)

- **Transactions:** Automatically push transactions to New Relic.
- **Transaction Naming Strategies:** Configurable strategies for both HTTP requests and CLI (eg: messenger).
- **Logs:** Push logs to NewRelic, linking them together using `traceId`. The bundle also provides batching for optimal performance, configurable via the `logging.buffer_size`.
- **Transaction Exclusion:** Exclude specific transactions based on Symfony route name, path, or even commands.
- **Exception Exclusion:** Exclude specific exceptions to prevent them from appearing in NewRelic Error inbox, e.g., `HttpExceptions`.

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

[](#installation)

To install the CHECK24 New Relic bundle, use composer:

```
composer require check24-cp/newrelic-bundle
```

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

[](#configuration)

After installing the bundle, you need to configure it to suit your application's needs. Here's a detailed explanation of each configuration option based on the provided extension:

### Basic Configuration

[](#basic-configuration)

- **appname:** The application name. If not set, it defaults to `ini_get('newrelic.appname')`.
- **license:** Your NewRelic license. If not set, defaults to `ini_get('newrelic.license')`.
- **xmit:** A boolean indicating if data should be transmitted to NewRelic immediately, defaults to `false`.
- **interactor:** The service ID of the NewRelic interactor used to communicate with the agent. Defaults to `check24.new_relic.interactor`.
- **logging.buffer\_size:** Determines the number of log entries to buffer before sending them to NewRelic in bulk. The range is from 1 to 1000, with a default of 100.

### Transaction Naming

[](#transaction-naming)

- **transaction\_naming.messenger:** Service ID for the strategy used to name messenger transactions. Defaults to `check24.new_relic.transaction_name.messenger.message_name`.
- **transaction\_naming.request:** Service ID for the strategy used to name HTTP request transactions. Defaults to `check24.new_relic.transaction_name.request.route_name`.

### Exclusions

[](#exclusions)

- **excluded\_transactions.commands:** An array of CLI commands to exclude from NewRelic.
- **excluded\_transactions.routes:** An array of Symfony route names to exclude from NewRelic.
- **excluded\_transactions.paths:** An array of HTTP paths to exclude from NewRelic.
- **excluded\_exceptions:** An array of exception classes to exclude from NewRelic's error inbox.

### Trace ID

[](#trace-id)

- **trace\_id\_factory:** Service ID for the factory responsible for creating a unique trace ID for each request or message. Defaults to `check24.new_relic.trace_id.uuid_factory`.

Example Configuration using Symfony Yaml
----------------------------------------

[](#example-configuration-using-symfony-yaml)

Here's a basic example of how you might configure the bundle using Symfony's yaml:

```
check24_new_relic:
    appname: "My Symfony App"
    license: "YOUR_NEWRELIC_LICENSE_KEY"
    xmit: false
    interactor: 'custom.new_relic.interactor'
    logging:
        buffer_size: 200
    transaction_naming:
        messenger: 'custom.transaction_name.messenger'
        request: 'custom.transaction_name.request'
    excluded_transactions:
        commands:
            - 'app:exclude-this-command'
        routes:
            - 'exclude_route_name'
        paths:
            - '/exclude-this-path'
    excluded_exceptions:
        - 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
    trace_id_factory: 'custom.trace_id.factory'

when@dev:
    check24_new_relic:
      # This is useful to be able to get logs about different NewRelic events in Symfony's profiler
      interactor: 'check24.new_relic.logging_interactor'
```

Adjust the values as per your requirements. Ensure you replace placeholders like `YOUR_NEWRELIC_LICENSE_KEY` with actual values.

Integration with Monolog
------------------------

[](#integration-with-monolog)

One of the standout features of this bundle is the ability to seamlessly integrate logging with NewRelic, linking them via a `trace.id`. This ensures you have all the necessary context when diagnosing issues, as you can see related logs in NewRelic that correspond to a particular request or process. It eliminates the disconnect often seen when logs and monitoring are handled separately. In times of issues or outages, having this cohesive view can be invaluable, allowing for rapid diagnosis and resolution.

To harness this logging integration, you need to configure your `monolog`settings specifically to support the `NewRelicHandler` provided by this bundle.

Update your `config/packages/monolog.yaml` with the following configuration:

```
monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes:
                - 404
                - 405
            channels: ['!event']
        nested:
            type: service
            id: 'check24.new_relic.monolog_handler'
```

Integration with Messenger
--------------------------

[](#integration-with-messenger)

To be able to track messages received with Messenger, you need to update `config/packages/messenger` with the following configuration:

```
framework:
    messenger:
        buses:
            default:
                middleware:
                    - check24.new_relic.messenger_middleware
```

Now the bundle should be able to report each consumed message as a separate transaction, using the message name (see Configuration/Transaction Naming section) as the transaction name.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~71 days

Total

16

Last Release

596d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49c52e8e8b802d8be56688964ce7c85feaff66f4a3695244255206990defb582?d=identicon)[dpeuscher\_check24](/maintainers/dpeuscher_check24)

---

Top Contributors

[![rguennichi](https://avatars.githubusercontent.com/u/88873441?v=4)](https://github.com/rguennichi "rguennichi (25 commits)")[![ostrolucky](https://avatars.githubusercontent.com/u/496233?v=4)](https://github.com/ostrolucky "ostrolucky (8 commits)")

---

Tags

loggingmonitoringnewrelic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/check24-cp-newrelic-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/check24-cp-newrelic-bundle/health.svg)](https://phpackages.com/packages/check24-cp-newrelic-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
