PHPackages                             sobit/insights - 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. sobit/insights

ActiveLibrary

sobit/insights
==============

Convenient interface for using New Relic Insights

015[1 issues](https://github.com/sobit/insights/issues)PHP

Since Oct 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sobit/insights)[ Packagist](https://packagist.org/packages/sobit/insights)[ RSS](/packages/sobit-insights/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Insights
========

[](#insights)

[![SensioLabsInsight](https://camo.githubusercontent.com/4a3aa2fb98b1967e1da031a9f68266518c89199587a292da9f0ca3c65921c70c/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31326230363032392d373937322d346130652d393562342d6330383332396663373765372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/12b06029-7972-4a0e-95b4-c08329fc77e7)

Convenient interface for using New Relic Insights.

Install
-------

[](#install)

Via Composer:

```
{
    "require": {
        "sobit/insights": "dev-master"
    }
}
```

Usage
-----

[](#usage)

### 1. Creating your event

[](#1-creating-your-event)

Create your event which extends `\Sobit\Insights\AbstractEvent` class and set preferred event type.

```
class MyEvent extends \Sobit\Insights\AbstractEvent
{
    public function getEventType()
    {
        return 'SomeEvent';
    }
}
```

Populate this class with attributes you want to be submitted to Insights:

```
class MyEvent extends Sobit\Insights\AbstractEvent
{
    private $myAttribute;

    public function __construct($myAttribute)
    {
        $this->myAttribute = $myAttribute;
    }

    public function getEventType()
    {
        return 'SomeEvent';
    }
}
```

### 2. Submitting events

[](#2-submitting-events)

```
use Sobit\Insights\Client\Client;
use Sobit\Insights\EventManager;

// configuration values as per New Relic Insights
$accountId = 'YOUR ACCOUNT ID';
$insertKey = 'YOUR INSERT KEY';
$queryKey  = 'YOUR QUERY KEY';

// initialize core classes
$client       = new Client(new GuzzleHttp\Client(), $accountId, $insertKey, $queryKey);
$eventManager = new EventManager($client, JMS\Serializer\SerializerBuilder::create()->build());

// create your event
$event = new MyEvent('some attribute');

// submit event to Insights
$eventManager->persist($event);
$eventManager->flush();
```

To do
-----

[](#to-do)

1. NRQL query builder
2. Improve documentation
3. Cover functionality with unit tests

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/sobit/insights/blob/master/LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad8d1323d3fc99e9436db3dddcd779850bc9c767088d07a5ab992962295d09f7?d=identicon)[sobit](/maintainers/sobit)

---

Top Contributors

[![sobit](https://avatars.githubusercontent.com/u/1245542?v=4)](https://github.com/sobit "sobit (12 commits)")

### Embed Badge

![Health badge](/badges/sobit-insights/health.svg)

```
[![Health](https://phpackages.com/badges/sobit-insights/health.svg)](https://phpackages.com/packages/sobit-insights)
```

PHPackages © 2026

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