/NewRelic

NewRelic module for Zend Framework 2

Primary LanguagePHP

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);