Search by

los / mezzio-swoole-newrelic

Lansoweb

A PHP lib to enable Newrelic with mezzio/expressive + swoole

Package info

github.com/Lansoweb/mezzio-swoole-newrelic

pkg:composer/los/mezzio-swoole-newrelic

Statistics

Installs: 616

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.1.1 2020-02-12 13:47 UTC

This package is auto-updated.

Last update: 2026-09-04 18:17:59 UTC


README

Warning

Archived

This Mezzio/Swoole/New Relic integration is no longer maintained and will receive no further releases. Follow the current documentation from your APM, runtime, and framework vendors when instrumenting new applications.

This lib enables Newrelic transactions and errors when using PHP with Swoole.

Installation

composer require los/mezzio-swoole-newrelic

Configuration

This lib provides a ConfigProvider.php and should be injected inside your config.php. Just be sure that it's after the default Swoole module:

    // Swoole config to overwrite some services (if installed)
    class_exists(\Mezzio\Swoole\ConfigProvider::class)
        ? \Mezzio\Swoole\ConfigProvider::class
        : function () {
            return[];
        },
    \Los\MezzioSwooleNewrelic\ConfigProvider::class,

The lib will get newrelic's appname and license from the ini using ini_get, but you can define an environment var NEWRELIC_APPNAME to be used instead of the newrelic.appname ini setting.

There is also a NewRelicMiddleware that will name the transactions with the zend-expressive-router router names. Just include inside your pipeline.php after the RouterMiddleware:

$app->pipe(RouteMiddleware::class);
$app->pipe(NewRelicMiddleware::class);