Peformance Monitoring - New Relic

New Relic Monitoring

Spryker enables integration with New Relic for performance monitoring. New Relic contains a set of powerful features that help you monitor the performance and health of your application. To be able to use New Relic you must first get an account. Next, you will need to install the New Relic PHP extension in your virtual machine by following the steps described New Relic Setup instructions.

General Information

The spryker-eco/new-relic module provides a NewRelicMonitoringExtensionPlugin to send monitoring information to the New Relic service.


To install New Relic module, run:

composer require spryker-eco/new-relic

New Relic Logs Configuration

Request Logging

Every request is automatically logged by New Relic. The name of the requests will be the name of the used route for Yves and the [module]/[controller]/[action] for Zed. You’ll also find the request URI and the host stored as custom parameters for each request.

Error Logging

Every error will be logged in New Relic together with its detailed stack trace.

Console Command Logging

Every executed console command will be logged by New Relic.

Deployment Logging

To be able to use the deployment recording feature of New Relic, you need to add your api_key and deployment_api_url to the project config. The API key is generated on your New Relic account. Open your account settings in NewRelic and enable the API Access in the Data Sharing page. After enabling you’ll get your API key.

$config[\SprykerEco\Shared\NewRelic\NewRelicEnv::NEWRELIC_API_KEY] = 'YOUR_API_KEY';

$config[\SprykerEco\Shared\NewRelic\NewRelicEnv::NEW_RELIC_DEPLOYMENT_API_URL] = 'NEW_RELIC_DEPLOYMENT_API_URL';

Implementation Overview

Monitoring is a Spryker Module and it provides a hook to add any monitoring provider you want to. In the Monitoring Module, you can find some service provider and controller listener for Yves and Zed which needs to be added to the ApplicationDependencyProvider to enable them.

New Relic API

You can add custom New Relic events in your application with the API wrapper for New Relic that you can find in \SprykerEco\Service\NewRelic\Plugin\NewRelicMonitoringExtensionPlugin. To read more detailed information about the available API methods, please read the following documentation: New Relic API.


Copyright and Disclaimer

See Disclaimer.


Last review date: Aug. 10th, 2018