承接 nordsoftware/lumen-newrelic 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nordsoftware/lumen-newrelic

最新稳定版本:4.1.0

Composer 安装命令:

composer require nordsoftware/lumen-newrelic

包简介

New Relic instrumentation for the Lumen framework

README 文档

README

GitHub Actions status Scrutinizer Code Quality Coverage Status

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

Usage

Installation

Run the following command to install the package through Composer:

composer require nordsoftware/lumen-newrelic

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

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

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

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

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

Clone the project and install its dependencies by running:

composer install

Run the following command to run the test suite:

vendor/bin/phpunit

License

See LICENSE

nordsoftware/lumen-newrelic 适用场景与选型建议

nordsoftware/lumen-newrelic 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 592.41k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 nordsoftware/lumen-newrelic 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nordsoftware/lumen-newrelic 我们能提供哪些服务?
定制开发 / 二次开发

基于 nordsoftware/lumen-newrelic 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 592.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 24
  • 依赖项目数: 2
  • 推荐数: 1

GitHub 信息

  • Stars: 27
  • Watchers: 11
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04