Yireo_NewRelic2

PHP 8.2 - 8.5
Magento 2.4.6 - 2.4.9
CSP Yes
License BSD-2-Clause
Latest Release none

Current status

Magento 2 Static Tests failure
Magento 2 Integration Tests success
Magento 2 Unit Tests failure
Playwright test success
Magento 2 DI compilation failure

About

New Relic offers monitoring of your webapplications, by installing a daemon on the webserver and hooking into the PHP core. This allows monitoring of specific PHP functions. This Yireo extensions extends this behaviour so that additional Magento information can be logged.

This is not an official New Relic product, and is not endorsed by New Relic. Note that some of the functionality is only available with the New Relic Pro version: Custom metrics are only available through custom dashboards, which can only be created in the New Relic Pro subscriptions. Additionally, our Magento extension provides additional variables, which are only available with transaction tracking which again requires the Pro-version.

Installation

Instructions for using composer

Use composer to install this extension. First make sure that Magento is installed via composer, and that there is a valid composer.json file present.

Next, install our module using the following command:

composer require yireo/magento2-newrelic2

Next, install the new module into Magento itself:

./bin/magento module:enable Yireo_NewRelic2
./bin/magento setup:upgrade

Check whether the module is successfully installed in Admin > Stores > Configuration > Advanced > Advanced.

Done.

Instructions for manual copy

We recommend composer to install this package. However, if you want a manual copy instead, these are the steps:

  • Make sure to install New Relic on your server first
  • Make sure to have New Relics PHP module installed and active
  • Upload the files in the source/ folder to the folder app/code/Yireo/NewRelic2 of your site
  • Run php -f bin/magento module:enable Yireo_NewRelic2
  • Run php -f bin/magento setup:upgrade
  • Flush the Magento cache
  • Configure settings under Stores > Configuration > Advanced > Yireo New Relic
  • Done

Usage

  • Make sure to install the New Relic PHP Agent first. See the New Relic site for details on this.
  • Make sure the New Relic PHP Agent is running.
  • Make sure that you are receiving data in your New Relic monitoring.
  • Install our extension for Magento.
  • Configure the options in the Magento Configuration:
    • Set the Application Name to whatever you like.
    • Configure the License Key as received from New Relic.

Technical overview

This extension implements an Observer to send various events to the New Relic dashboard. This extension implements two Blocks for browser timings via New Relic. One block for the header, one block for the body. This extension intercepts the class Magento\Framework\View\Element\AbstractBlock to send a custom parameter per Magento block to New Relic.

Testing

Unit testing

This extension ships with PHPUnit tests. The generic PHPUnit configuration in Magento 2 will pick up on these tests. To only test Yireo extensions, copy the file phpunit.xml.yireo to your Magento folder dev/tests/unit. Next, from within that folder run PHPUnit. For instance:

phpunit -c phpunit.xml.yireo --bootstrap PATH_TO_MAGENTO/dev/tests/unit/framework/bootstrap.php

PWA compatibility

This frontend extension will be completely replaced by React or Vue functionality, and therefore, this extension will not be made compatible with PWA.

WARNING: This module has no releases yet. If you want to use it, make sure to add the version @dev to the composer command.

Support

For getting support, create an Issue under the following project URL:

https://github.com/yireo/Yireo_NewRelic2

Composer details
Magento module name
Yireo_NewRelic2
Composer name
yireo/magento2-newrelic2
Composer version
No release yet
Default branch
master
Requirements
magento/framework: ^101.0|^102.0|^103.0
php: >=8.2 <8.6
Releases
Changelog
  • Remove PHP dep from composer

[0.3.5] - 5 November 2020

Fixed

  • Fix type errors (@FrankStappers)

[0.3.4] - 29 July 2020

Added

  • Magento 2.4 compatibility

Older versions are not documented here

Last modified: October 17, 2026