PHPackages                             nordsoftware/lumen-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. [Framework](/categories/framework)
4. /
5. nordsoftware/lumen-newrelic

AbandonedArchivedLibrary[Framework](/categories/framework)

nordsoftware/lumen-newrelic
===========================

New Relic instrumentation for the Lumen framework

4.1.0(4y ago)28600.1k↓12.1%212MITPHPPHP ^7.2 | ^8.0

Since Dec 9Pushed 3y ago9 watchersCompare

[ Source](https://github.com/digiaonline/lumen-newrelic)[ Packagist](https://packagist.org/packages/nordsoftware/lumen-newrelic)[ RSS](/packages/nordsoftware-lumen-newrelic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (16)Used By (2)

lumen-newrelic
==============

[](#lumen-newrelic)

[![GitHub Actions status](https://github.com/digiaonline/lumen-newrelic/workflows/Test/badge.svg)](https://github.com/digiaonline/lumen-newrelic/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f482d8f92d69e6f17c43bbff6c1cf51c3d1c28e0c9774ca7d298e9b537017e0f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769616f6e6c696e652f6c756d656e2d6e657772656c69632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/digiaonline/lumen-newrelic/?branch=main)[![Coverage Status](https://camo.githubusercontent.com/9b6043ab7a48ec5c5807d1dd827eccc16418a5ce2a82c94167ca80209a742762/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64696769616f6e6c696e652f6c756d656e2d6e657772656c69632f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/digiaonline/lumen-newrelic?branch=main)

This library provides New Relic instrumentation for the Lumen framework. When installed this library will ensure that your transactions are properly named and that your exceptions are properly logged in New Relic.

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

[](#requirements)

- PHP &gt;= 7.3
- [Composer](http://getcomposer.org)
- [Lumen](https://lumen.laravel.com/) 5.5 or newer

Usage
-----

[](#usage)

### Installation

[](#installation)

Run the following command to install the package through Composer:

```
composer require nordsoftware/lumen-newrelic
```

### Configuration

[](#configuration)

You don't have to set any config values if you are happy to rely on the content of your `newrelic.ini` file. However, it's possible to override the license and application name using environment variables or the `.env` file. This can be useful if you deploy the same app in multiple environments, and therefore need distinguished names for each.

Be aware that doing so can have a [small performance impact](https://github.com/In-Touch/newrelic/blob/5dc4eb7a25731f92cdbfb7a094a788cf137df40e/src/Newrelic.php#L82-L87) on the app.

The environment variables available are:

- `NEW_RELIC_OVERRIDE_INI` (defaults to `false`)
- `NEW_RELIC_APP_NAME`
- `NEW_RELIC_LICENSE_KEY`

If you don't set `NEW_RELIC_OVERRIDE_INI` to `true`, the app will not override the `newrelic.ini` file, regardless of the value of the other two variables.

Check out the description in `/config/newRelic.php` for an explanation of the effect.

### Bootstrapping

[](#bootstrapping)

In `bootstrap/app.php`, replace the `$app->singleton()` call which registers the exception handler with the following snippet:

```
$app->instance(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    new Nord\Lumen\ChainedExceptionHandler\ChainedExceptionHandler(
        new \App\Exceptions\Handler(),
        [new Nord\Lumen\NewRelic\NewRelicExceptionHandler()]
    )
);
```

This will ensure that exceptions are correctly reported to New Relic.

Now, add the middleware too:

```
$app->middleware([
	...
	Nord\Lumen\NewRelic\NewRelicMiddleware::class,
]);
```

This will ensure that transactions are named properly.

Finally, register the service provider:

```
$app->register(Nord\Lumen\NewRelic\NewRelicServiceProvider::class);
```

Ignoring certain exceptions
---------------------------

[](#ignoring-certain-exceptions)

By default the exception handler ignores exceptions of type `Symfony\Component\HttpKernel\Exception\NotFoundHttpException`. You can customize the list of ignored exceptions by passing an array to the exception handler's constructor:

```
$exceptionHandler = new Nord\Lumen\NewRelic\NewRelicExceptionHandler([
	FooException::class,
	BarException::class,
]);
```

If you don't want any exception to be ignored, pass an empty array to the constructor.

Customizing transaction names
-----------------------------

[](#customizing-transaction-names)

By default the transaction name will use the `controller@action` assigned to the route. If that fails, it will use the route's name. If no name is defined, it will fallback to just `index.php`.

If this doesn't meet your requirements, extend the `Nord\Lumen\NewRelic\NewRelicMiddleware` class and override the `getTransactionName()` method, then register that middleware class instead.

Marking transactions as background jobs
---------------------------------------

[](#marking-transactions-as-background-jobs)

If you have a dedicated route for webhooks, notifications, or other long-running background tasks you can apply the `Nord\Lumen\NewRelic\NewRelicBackgroundJobMiddleware` to the route in question. This will mark the transaction as a background job in New Relic so that long processing times don't skew your response time graphs.

Running tests
-------------

[](#running-tests)

Clone the project and install its dependencies by running:

```
composer install
```

Run the following command to run the test suite:

```
vendor/bin/phpunit
```

License
-------

[](#license)

See [LICENSE](LICENSE)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~138 days

Total

15

Last Release

1510d ago

Major Versions

1.1.1 → 2.0.02018-12-12

1.1.2 → 2.0.12019-03-05

1.1.3 → 2.0.22019-12-03

2.x-dev → 3.0.02020-10-05

3.1.1 → 4.0.02021-11-12

PHP version history (4 changes)1.0.0PHP &gt;=5.6.4

2.0.0PHP ^7.1

3.0.0PHP ^7.2

4.0.0PHP ^7.2 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7e28ec3bf2ff3ffcdd8c947f54d53d4dae86939bea2a7316cfde0b10410e9ee?d=identicon)[Jalle19](/maintainers/Jalle19)

---

Top Contributors

[![hugovk](https://avatars.githubusercontent.com/u/1324225?v=4)](https://github.com/hugovk "hugovk (19 commits)")[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (9 commits)")[![miff2000](https://avatars.githubusercontent.com/u/3526189?v=4)](https://github.com/miff2000 "miff2000 (9 commits)")[![ls-renaud-tilte](https://avatars.githubusercontent.com/u/47116999?v=4)](https://github.com/ls-renaud-tilte "ls-renaud-tilte (3 commits)")[![ls-paul-julien-vauthier](https://avatars.githubusercontent.com/u/54601900?v=4)](https://github.com/ls-paul-julien-vauthier "ls-paul-julien-vauthier (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![neclimdul](https://avatars.githubusercontent.com/u/82823?v=4)](https://github.com/neclimdul "neclimdul (1 commits)")

---

Tags

lumenmiddlewarenewrelicphp

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k84.2M225](/packages/laravel-horizon)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[stancl/tenancy

Automatic multi-tenancy for your Laravel application.

4.3k6.6M40](/packages/stancl-tenancy)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)

PHPackages © 2026

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