PHPackages                             leocavalcante/newrelic-telemetry-sdk - 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. leocavalcante/newrelic-telemetry-sdk

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

leocavalcante/newrelic-telemetry-sdk
====================================

Unofficial PHP library for sending telemetry data to New Relic

v0.1.1(5y ago)71.1kApache-2.0PHPPHP &gt;=7.4

Since Feb 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/leocavalcante/newrelic-telemetry-sdk-php)[ Packagist](https://packagist.org/packages/leocavalcante/newrelic-telemetry-sdk)[ RSS](/packages/leocavalcante-newrelic-telemetry-sdk/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

New Relic Telemetry SDK for PHP [![CI](https://github.com/leocavalcante/newrelic-telemetry-sdk-php/workflows/CI/badge.svg?branch=main)](https://github.com/leocavalcante/newrelic-telemetry-sdk-php/workflows/CI/badge.svg?branch=main)
=======================================================================================================================================================================================================================================

[](#new-relic-telemetry-sdk-for-php-)

**Unofficial** PHP library for sending telemetry data to New Relic.

StatusAPIDescription✅Trace APIUsed to send [distributed tracing](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/get-started/introduction-distributed-tracing#) data to New Relic (New Relic's format).✅Metric APIUsed to send [metric data](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/new-relic-data-types#dimensional-metrics) to New Relic.✅Event APIIs one way to report [custom events](https://docs.newrelic.com/docs/insights/insights-data-sources/custom-data/report-custom-event-data) to New Relic.-Log API**Not planned.**- ⚠️ Heavily under development, but open-sourced seeking for contributions.
- It **is not** an agent wrapper, it calls the New Relic [Ingest APIs](https://docs.newrelic.com/docs/telemetry-data-platform/ingest-manage-data/ingest-apis).

Usage
-----

[](#usage)

### Example

[](#example)

Sending a [Gauge](https://docs.newrelic.com/docs/telemetry-data-platform/ingest-manage-data/understand-data/metric-data-type) metric.

```
use NewRelic\Adapter;
use NewRelic\Metric;

$metric_api = new Metric\API(new Adapter\Curl(getenv('NR_API_KEY')));
$metric_api->setCommonAttrs(['service.name' => 'PHP-SDK']);
$metric_api->send(new Metric\Gauge('memory.heap', 2.3));

$response = $metric_api->commit();

if ($response->isOk()) {
    echo sprintf("Request ID: %s\n", $response->getId());
} else {
    echo sprintf("Metric send error: %s\n", $response->getMessage());
}
```

Companion resources
-------------------

[](#companion-resources)

- [New Relic data dictionary](https://docs.newrelic.com/attribute-dictionary)
- [Ingest APIs](https://docs.newrelic.com/docs/telemetry-data-platform/ingest-manage-data/ingest-apis)
- [OpenTelemetry Spec](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions)

### Tips

[](#tips)

- Make sure you are including [service.instance.id](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/README.md#service) when reporting your traces and/or metrics.

Why
---

[](#why)

Main reasons includes:

- Too many [segfaults](https://www.google.com/search?q=newrelic+segfault) with the regular agent.
- Even for simple use cases the regular agent doesn't play well with Swoole. This small snippet is enough to throw a segfault: ```
    Co\run(static function () {
      go(static function () {
        (new Co\Http\Client('swoole.co.uk'))->get('/');
      });
    });
    ```
- There are [other SDKs for other languages](https://docs.newrelic.com/docs/telemetry-data-platform/get-started/capabilities/telemetry-sdks-send-custom-telemetry-data-new-relic), this is an unofficial PHP version.
- Could be used to build a New Relic exporter for the upcoming [OpenTelemetry PHP library](https://github.com/open-telemetry/opentelemetry-php).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

1909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/940717934113da7abe00589e87cfde6f34496f039bcd3fc6ce4a33f5f415d4ac?d=identicon)[leocavalcante](/maintainers/leocavalcante)

---

Top Contributors

[![leocavalcante](https://avatars.githubusercontent.com/u/183722?v=4)](https://github.com/leocavalcante "leocavalcante (41 commits)")

---

Tags

eventsmetricsmonitoringnewrelicobservabilitysdktelemetrytracing

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/leocavalcante-newrelic-telemetry-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/leocavalcante-newrelic-telemetry-sdk/health.svg)](https://phpackages.com/packages/leocavalcante-newrelic-telemetry-sdk)
```

###  Alternatives

[pragmarx/tracker

A Laravel Visitor Tracker

2.9k300.0k1](/packages/pragmarx-tracker)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[vinelab/tracing-laravel

Distributed tracing for Laravel made easy

80118.7k1](/packages/vinelab-tracing-laravel)[google/cloud-trace

Stackdriver Trace Client for PHP

231.3M7](/packages/google-cloud-trace)[scoutapp/scout-apm-php

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

17877.0k5](/packages/scoutapp-scout-apm-php)[subzerobo/elastic-apm-php-agent

PHP Agent for Elastic APM With Intake API V2 Support + UDP Support

1119.1k](/packages/subzerobo-elastic-apm-php-agent)

PHPackages © 2026

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