PHPackages                             alexrili/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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. alexrili/lumen-newrelic

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

alexrili/lumen-newrelic
=======================

New Relic instrumentation for the Lumen framework

v3.0(6y ago)111.6kMITPHPPHP ^7.2

Since Dec 9Pushed 6y agoCompare

[ Source](https://github.com/alexrili/lumen-newrelic)[ Packagist](https://packagist.org/packages/alexrili/lumen-newrelic)[ RSS](/packages/alexrili-lumen-newrelic/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (10)Used By (0)

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

[](#lumen-newrelic)

[![Build Status](https://camo.githubusercontent.com/cedefc432e3d3cffabf601f06ed2fafd90ba6e6377f0ebfbc128b9933f79b785/68747470733a2f2f7472617669732d63692e6f72672f64696769616f6e6c696e652f6c756d656e2d6e657772656c69632e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/digiaonline/lumen-newrelic)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/acc628f869059ea3662c912a7300d21b27c524b0e2e2cf405df7480308680587/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769616f6e6c696e652f6c756d656e2d6e657772656c69632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/digiaonline/lumen-newrelic/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/7127538c9283001081f02d1178610f5f5dad1c1257a4e9cdbfe67b77e2534506/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64696769616f6e6c696e652f6c756d656e2d6e657772656c69632f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/digiaonline/lumen-newrelic?branch=master)

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.1
- [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
```

### 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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~131 days

Recently: every ~79 days

Total

9

Last Release

2392d ago

Major Versions

1.1.1 → 2.0.02018-12-12

1.1.2 → 2.0.12019-03-05

1.x-dev → v3.02019-10-24

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

2.0.0PHP ^7.1

v3.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ddf3f4bf799ee959bf1cca781d67a3dd0442b5992ac5af495d6921af961926b?d=identicon)[alexrili](/maintainers/alexrili)

---

Top Contributors

[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (6 commits)")[![alexrili](https://avatars.githubusercontent.com/u/1238430?v=4)](https://github.com/alexrili "alexrili (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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