2017 © Pedro Peláez
 

library l4-newrelic-insight

Laravel Library for Interacting with NewRelic's Insight

image

buonzz/l4-newrelic-insight

Laravel Library for Interacting with NewRelic's Insight

  • Friday, November 21, 2014
  • by buonzz
  • Repository
  • 0 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel Library for NewRelic Insight

This is a Laravel Library for Interacting with NewRelic's Insight. This tries to make you define simple events in Laravel-way and make it appear in the NewRelic Insights dashboards., (*1)

Features

  • PSR-0 autoloading compliant structure
  • Unit-Testing with PHPUnit
  • PHPDocumentor

Requirements

  • cURL
  • PHP >= 5.3.0
  • Valid NewRelic Account ID - see http://newrelic.com/
  • NewRelic Insight API Query Key - see http://docs.newrelic.com/docs/insights/remote-queries
  • NewRelic Insight API Insert Key - see http://docs.newrelic.com/docs/insights/inserting-events

Installation

Require the package in your composer.json file, (*2)

composer require buonzz/l4-newrelic-insight

Add the service provider and facade in your config/app.php Service Provider, (*3)

Buonzz\NewRelic\Insight\Laravel4\ServiceProviders\InsightServiceProvider

Facade, (*4)

'Insight'            => 'Buonzz\NewRelic\Insight\Laravel4\Facades\Insight',

Pubish the configuration file, (*5)

php artisan config:publish buonzz/l4-newrelic-insight

Edit the config file in app/config/packages/buonzz/l4-newrelic-insight/config.php, (*6)

  • account_id - is required, this should be your NewRelic Account ID
  • query_key - required when you need to retrieve data from NewRelic
  • insert_key - required when you need to insert custom events

Usage

Execute Queries, (*7)

$nrql = "SELECT uniquecount(session) FROM PageView";
$nrql .= "WHERE appName='PHP Application' SINCE 1 hour ago COMPARE WITH 1 hour ago";
$result = Insight::query($nrql);

Send Custom Events, (*8)

$events = array();
$events[] = array('eventType'=> 'Event Name', 'atrribute1'=> 'attribute value 1', 'attribute2'=> 'atrribute value 2');
Insight::insertCustomEvents($events);

You can also dynamically set the config settings in runtime:, (*9)

Insight::setAccountID('<put your account id here>'); // used to associate your account to calls
Insight::setQueryKey('<put your query key here>'); // required to query data
Insight::setInsertKey('<put your insert key here>'); // this is when you need to send custom events

List PageViews within the last hour, (*10)

use Buonzz\NewRelic\Insight\Aggregates\PageView;

Route::get('pageviews', function()
{
    $pv = new PageView();
    $pageviews = $pv->all();
    return $pageviews;
});

The Versions

21/11 2014

dev-master

9999999-dev

Laravel Library for Interacting with NewRelic's Insight

  Sources   Download

MIT

The Requires

 

The Development Requires

by Darwin Biler

laravel framework newrelic newrelic insight php newrelic insight php

14/09 2014

v1.0.2

1.0.2.0

Laravel Library for Interacting with NewRelic's Insight

  Sources   Download

MIT

The Requires

 

The Development Requires

by Darwin Biler

laravel framework newrelic newrelic insight php newrelic insight php

13/09 2014

v1.0.1

1.0.1.0

Laravel Library for Interacting with NewRelic's Insight

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

by Darwin Biler

laravel framework newrelic newrelic insight php newrelic insight php

23/06 2014

v1.0.0

1.0.0.0

Laravel Library for Interacting with NewRelic's Insight

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

by Darwin Biler