Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
NewRelic module for Zend Framework 2
PHP
branch: master

This branch is 83 commits behind neeckeloo:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config
src/NewRelic
tests/NewRelic
.gitignore
.travis.yml
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

NewRelic module for Zend Framework 2

NewRelic module provide an object-oriented PHP wrapper for New Relic monitoring service.

Build Status

Introduction

NewRelic module provide a logger and a wrapper for New Relic PHP API.

The current route is used to set the name of each transaction. Moreover, the module allow exceptions logging if enabled.

Default configuration

<?php
return array(
    'newrelic' => array(
        'application_name' => null,
        'license' => null,
        'browser_timing_enabled' => false,
        'browser_timing_auto_instrument' => true,
        'exceptions_logging_enabled' => false,
    ),
);

Usage

Ignore a transaction

<?php
$client = $this->getServiceLocator()->get('NewRelic\Client');
$client->ignoreTransaction();

Define if current transaction is a background job

<?php
$client = $this->getServiceLocator()->get('NewRelic\Client');
$client->backgroundJob(true);

Add custom metric

<?php
$client = $this->getServiceLocator()->get('NewRelic\Client');
$client->addCustomMetric('salesprice', $price);
Something went wrong with that request. Please try again.