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

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

neeckeloo/newrelic
==================

NewRelic module for Laminas

v3.0.0(6y ago)32209.8k↓68.8%13[4 issues](https://github.com/neeckeloo/NewRelic/issues)[2 PRs](https://github.com/neeckeloo/NewRelic/pulls)MITPHPPHP ^7.2CI failing

Since Oct 22Pushed 3y ago3 watchersCompare

[ Source](https://github.com/neeckeloo/NewRelic)[ Packagist](https://packagist.org/packages/neeckeloo/newrelic)[ Docs](https://github.com/neeckeloo/NewRelic)[ RSS](/packages/neeckeloo-newrelic/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (11)Versions (18)Used By (0)

NewRelic module for Laminas
===========================

[](#newrelic-module-for-laminas)

NewRelic module provide an object-oriented PHP wrapper for [New Relic](http://newrelic.com/) monitoring service.

[![Build Status](https://camo.githubusercontent.com/e62ca6b06f6aaf46af66b7e83860f3cc0fba31b81d5deec706f6d7eb641f0e50/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6565636b656c6f6f2f4e657752656c69632e7376673f7374796c653d666c6174)](http://travis-ci.org/neeckeloo/NewRelic)[![Latest Stable Version](https://camo.githubusercontent.com/98bcaa86e1b7d7f5594c84a77b7b06132abe8511cfe9a8e60cee1098defcf87b/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6565636b656c6f6f2f4e657752656c69632e7376673f7374796c653d666c6174)](https://packagist.org/packages/neeckeloo/NewRelic)[![Total Downloads](https://camo.githubusercontent.com/4abbe34f71acaa91d9eb8cbbb7b63b6a93f48d728b3df96a1af59cc2d5405ff5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6565636b656c6f6f2f4e657752656c69632e7376673f7374796c653d666c6174)](https://packagist.org/packages/neeckeloo/newrelic)

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

[](#introduction)

NewRelic module provide a logger and a wrapper for [New Relic PHP API](https://newrelic.com/docs/php/the-php-api).

The current route is used to set the name of each transaction. Moreover, the module allow exceptions logging if enabled.

Requirements
------------

[](#requirements)

- PHP ^7.2
- Laminas

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

[](#installation)

NewRelic module only officially supports installation through Composer. For Composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

You can install the module from command line:

```
$ composer require neeckeloo/newrelic
```

Alternatively, you can also add manually the dependency in your `composer.json` file:

```
{
    "require": {
        "neeckeloo/newrelic": "^2.5"
    }
}
```

Enable the module by adding `NewRelic` key to your `application.config.php` file. Customize the module by copy-pasting the `newrelic.global.php.dist` file to your `config/autoload` folder.

Default configuration
---------------------

[](#default-configuration)

```
return [
    'newrelic' => [
        // Sets the newrelic app name.  Note that this will discard metrics
        // collected before the name is set.  If empty then your php.ini
        // configuration will take precedence. You can set the value by
        // environment variable, or by overriding in a local config.
        'application_name' => getenv('NEW_RELIC_APP_NAME') ?: null,

        // May be null and will only be set if application name is also given.
        // You can set the value by environment variable, or by overriding in
        // a local config.
        'license' => getenv('NEW_RELIC_LICENSE_KEY ') ?: null,

        // If false then neither change the auto_instrument or manually
        // instrument the real user monitoring.
        'browser_timing_enabled' => false,

        // When true tell the newrelic extension to insert Real User Monitoring
        // scripts automatically.
        'browser_timing_auto_instrument' => true,

        // When true, a logger with the newrelic writer will be called for
        // dispatch error events.
        'exceptions_logging_enabled' => false,

        // Defines ignored transactions
        'ignored_transactions' => [],

        // Defines background job transactions
        'background_jobs' => [],
    ],
];
```

Usage
-----

[](#usage)

### Define transaction name

[](#define-transaction-name)

The module use `NewRelic\Listener\RequestListener` to specify the transaction name automatically using matched route name by default.

#### Transaction name providers

[](#transaction-name-providers)

The transaction name is retrieved from a provider (`NewRelic\TransactionNameProvider\RouteNameProvider` by default) defined in the configuration.

```
use NewRelic\TransactionNameProvider\RouteNameProvider;

return [
    'newrelic' => [
        'transaction_name_provider' => RouteNameProvider::class,
    ],
];
```

The package contains some providers:

- RouteNameProvider
- HttpRequestUrlProvider
- NullProvider

#### Specify transaction name manually

[](#specify-transaction-name-manually)

You can also defined the transaction name yourself by defining `NullProvider` as transaction name provider and using `nameTransaction` method of the client.

### Ignore transactions

[](#ignore-transactions)

NewRelic API allows to ignore some transactions. This configuration defines some routes and controllers of transactions that will be ignored.

#### Ignore routes

[](#ignore-routes)

```
return [
    'newrelic' => [
        'ignored_transactions' => [
            'routes' => [
                'admin*',
                'user/login',
            ],
        ],
    ],
];
```

Those rules ignore all admin routes and the "user/login" route.

#### Ignore controllers

[](#ignore-controllers)

```
return [
    'newrelic' => [
        'ignored_transactions' => [
            'controllers' => [
                'FooController',
                'BarController',
                'BazController',
            ],
        ],
    ],
];
```

You can also ignore some actions of specified controllers :

```
return [
    'newrelic' => [
        'ignored_transactions' => [
            'controllers' => [
                ['FooController', ['foo', 'bar']],
                ['BarController', ['baz']],
            ],
        ],
    ],
];
```

#### Ignore a transaction manually

[](#ignore-a-transaction-manually)

You can ignore a transaction manually by calling `ignoreTransaction()` method of NewRelic client.

```
$client = $container->get('NewRelic\Client');
$client->ignoreTransaction();
```

### Define background jobs

[](#define-background-jobs)

The configuration of background jobs is identical to ignored transactions but use the key `background_jobs` as below.

```
return [
    'newrelic' => [
        'background_jobs' => [],
    ],
];
```

#### Define a background job manually

[](#define-a-background-job-manually)

You can define a transaction as background job manually by calling `backgroundJob()` method of NewRelic client.

```
$client = $container->get('NewRelic\Client');
$client->backgroundJob(true);
```

### Ignore apdex metrics

[](#ignore-apdex-metrics)

You can ignore apdex metrics like transaction metrics using the key `ignored_apdex`.

```
return [
    'newrelic' => [
        'ignored_apdex' => [],
    ],
];
```

#### Ignore apdex metrics manually

[](#ignore-apdex-metrics-manually)

You can ignore apdex metrics manually by calling `ignoreApdex()` method of NewRelic client.

```
$client = $container->get('NewRelic\Client');
$client->ignoreApdex();
```

### Add custom metric

[](#add-custom-metric)

```
$client = $container->get('NewRelic\Client');
$client->addCustomMetric('salesprice', $price);
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~162 days

Recently: every ~322 days

Total

16

Last Release

2198d ago

Major Versions

v1.2.0 → v2.0.02016-07-04

v2.5.0 → v3.0.02020-06-27

PHP version history (5 changes)v1.0.0PHP &gt;=5.3.3

v1.2.0PHP &gt;=5.5

v2.0.0PHP ^5.6 || ^7.0

v2.3.0PHP ^7.1

v2.5.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1768645?v=4)[Nicolas Eeckeloo](/maintainers/neeckeloo)[@neeckeloo](https://github.com/neeckeloo)

---

Top Contributors

[![neeckeloo](https://avatars.githubusercontent.com/u/1768645?v=4)](https://github.com/neeckeloo "neeckeloo (209 commits)")[![bnkr](https://avatars.githubusercontent.com/u/497023?v=4)](https://github.com/bnkr "bnkr (8 commits)")[![thomasvargiu](https://avatars.githubusercontent.com/u/732012?v=4)](https://github.com/thomasvargiu "thomasvargiu (5 commits)")[![abacaphiliac](https://avatars.githubusercontent.com/u/1656273?v=4)](https://github.com/abacaphiliac "abacaphiliac (4 commits)")[![FabianKoestring](https://avatars.githubusercontent.com/u/1252701?v=4)](https://github.com/FabianKoestring "FabianKoestring (3 commits)")[![al3xdm](https://avatars.githubusercontent.com/u/602341?v=4)](https://github.com/al3xdm "al3xdm (3 commits)")[![volkan](https://avatars.githubusercontent.com/u/28885?v=4)](https://github.com/volkan "volkan (1 commits)")[![moderndeveloperllc](https://avatars.githubusercontent.com/u/1920405?v=4)](https://github.com/moderndeveloperllc "moderndeveloperllc (1 commits)")[![SocalNick](https://avatars.githubusercontent.com/u/294123?v=4)](https://github.com/SocalNick "SocalNick (1 commits)")

---

Tags

apmlaminasnewreliclaminasnewrelic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neeckeloo-newrelic/health.svg)

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

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.2k53.6k13](/packages/magento-community-edition)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15848.2M222](/packages/laminas-laminas-validator)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)

PHPackages © 2026

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