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

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

upscale/swoole-newrelic
=======================

New Relic APM monitoring of Swoole web-server

1.6.0(3y ago)1619.6k↓33.3%5[1 issues](https://github.com/upscalesoftware/swoole-newrelic/issues)Apache-2.0PHPPHP &gt;=7.1

Since May 23Pushed 3y ago3 watchersCompare

[ Source](https://github.com/upscalesoftware/swoole-newrelic)[ Packagist](https://packagist.org/packages/upscale/swoole-newrelic)[ Docs](https://github.com/upscalesoftware/swoole-newrelic)[ RSS](/packages/upscale-swoole-newrelic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

New Relic Monitoring of Swoole
==============================

[](#new-relic-monitoring-of-swoole)

This library enables monitoring of PHP applications powered by [Swoole](https://www.swoole.co.uk/) web-server via [New Relic](https://newrelic.com/) products.

**Features:**

- New Relic APM integration
- New Relic Browser integration

Demo
----

[](#demo)

[![New Relic APM dashboard](docs/img/newrelic_apm_swoole.png)](docs/img/newrelic_apm_swoole.png)

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

[](#installation)

The library is to be installed via [Composer](https://getcomposer.org/) as a dependency:

```
composer require upscale/swoole-newrelic
```

Usage
-----

[](#usage)

### Production

[](#production)

Monitoring of requests from start to finish can be activated by adding a few lines of code to the server entry point. The monitoring instrumentation is by design completely transparent to an application running on the server.

Install the monitoring instrumentation for all requests:

```
use Upscale\Swoole\Newrelic;

$page = on('request', function ($request, $response) use ($page) {
    // PHP processing within request boundary...
    usleep(1000 * rand(100, 300));

    // Send response
    $response->end($page);

    // PHP processing outside of request boundary...
    usleep(1000 * rand(50, 150));
});

// Real user monitoring (RUM)
$rum = new Newrelic\Browser(new Newrelic\Browser\TransactionFactory());
$rum->instrument($server);

// Application performnce monitoring (APM)
$apm = new Newrelic\Apm(new Newrelic\Apm\TransactionFactory());
$apm->instrument($server);

unset($rum, $apm);

$server->start();
```

APM can be standalone or used in conjunction with the real user monitoring. RUM must be instrumented first.

Browser instrumentation is applied to non-AJAX requests having `text/html` response MIME type (the default).

### Development

[](#development)

Having to install the New Relic PHP extension locally may be inconvenient and outright undesirable for developers. The workaround is to replace the New Relic reporting functionality with the "stub" implementation doing nothing:

```
{
    "require": {
        "upscale/swoole-newrelic": "^1.0",
        "killmails/polyfill-newrelic": "^1.0"
    },
    "replace": {
        "ext-newrelic": "*"
    }
}
```

The PHP extension is used when installed and substituted with the [polyfill](https://github.com/killmails/polyfill-newrelic) otherwise.

Limitations
-----------

[](#limitations)

Concurrent requests subject to [coroutine](https://www.swoole.co.uk/coroutine) multi-tasking are reported as part of the first in-flight transaction.

Contributing
------------

[](#contributing)

Pull Requests with fixes and improvements are welcome!

License
-------

[](#license)

Copyright © Upscale Software. All rights reserved.

Licensed under the [Apache License, Version 2.0](https://github.com/upscalesoftware/swoole-newrelic/blob/master/LICENSE.txt).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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 ~167 days

Recently: every ~333 days

Total

9

Last Release

1217d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5

1.5.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ff1791f1bd72221702e39e356c25b108de26dea1f5b56416f7957e8fa43ea92?d=identicon)[upscalesoftware](/maintainers/upscalesoftware)

---

Top Contributors

[![sshymko](https://avatars.githubusercontent.com/u/1231423?v=4)](https://github.com/sshymko "sshymko (26 commits)")[![websmurf](https://avatars.githubusercontent.com/u/4027236?v=4)](https://github.com/websmurf "websmurf (1 commits)")

---

Tags

browsermonitoringapmswooleintegrationnewrelicnew relicRUM

### Embed Badge

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

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

###  Alternatives

[sobanvuex/php-newrelic

PHP Library for New Relic Agent

16520.7k5](/packages/sobanvuex-php-newrelic)[intouch/laravel-newrelic

Laravel 5 NewRelic Integration

1731.2M](/packages/intouch-laravel-newrelic)[jackwh/laravel-new-relic

Monitor your Laravel application performance with New Relic

112827.2k](/packages/jackwh-laravel-new-relic)[intouch/newrelic

Namespaced Wrapper for NewRelic PHP Agent

373.8M15](/packages/intouch-newrelic)[scoutapp/scout-apm-laravel

Scout Application Performance Monitoring Agent - https://scoutapm.com

23831.3k](/packages/scoutapp-scout-apm-laravel)[contributte/newrelic

NewRelic PHP agent integration for Nette Framework

19822.4k](/packages/contributte-newrelic)

PHPackages © 2026

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