New Relic is a software analytics service that helps you analyze and improve application interactions. Accounts for Adobe Commerce on cloud infrastructure include the software for the New Relic APM service. For more information, see New Relic services in the developer documentation.
Go to the New Relic website and sign up for an account.
You can also sign up for a free trial account.
Follow the instructions on the site. When prompted, choose the product that you want to install first.
While you are in your account, locate the following credentials that are required to complete the Commerce configuration:
Option | Description |
---|---|
Account ID | From your New Relic account dashboard, the Account ID is the number in the URL after: /accounts |
Application ID | From your New Relic account dashboard, click New Relic APM. In the menu, choose Applications. Then, choose your application. The Application ID is the number in the URL after: /applications/ |
New Relic API Key | From your New Relic account dashboard, click Account Settings. In the menu on the left under Integrations, choose Data Sharing. You can create, regenerate, or delete your API key from this page. |
Insights API Key | From your New Relic account dashboard, click Insights. In the menu on the left under Administration, choose API Keys. Your Insights API Keys appear on this page. If necessary, click the plus sign (+) next to Insert Keys to generate a key. |
To use New Relic APM Pro to gather and transmit data, the PHP agent must be installed on your server.
When prompted to choose a web agent, click PHP.
To set up the PHP agent on your server, follow the instructions.
If you need help, see New Relic for PHP.
Make sure that cron is running on your server.
To learn more, see Configure and run cron in the developer documentation.
On the Admin sidebar, go to Stores > Settings > Configuration.
In the left navigation panel where General is expanded, choose New Relic Reporting and do the following:
Set Enable New Relic Integration to Yes
.
In the Insights API URL, replace the percent (%
) symbol with your New Relic Account ID.
Enter your New Relic Account ID.
Enter your New Relic Application ID.
Enter your New Relic API Key.
Enter you Insights API Key.
For New Relic Application Name, enter a name to identify the configuration for internal reference.
(Optional) For Send Adminhtml and Frontend as Separate Apps, select Yes
to send collected data for the storefront and Admin as separate apps to New Relic.
This option requires a name entered for the New Relic Application Name.
Enabling this feature reduces the number of false positive New Relic alerts and allows for configured monitoring and alerts strictly for frontend performance. New Relic receives separate app data files with names of Application Name appended to Adminhtml
and frontend. For example: MyStore_Adminhtml
When complete, click Save Config.
Expand the Cron section.
Set Enable Cron to Yes
.
When complete, click Save Config.
New Relic Insights data is based on statements that are written in New Relic Query Language (NRQL), and any custom parameters that you might include. Data can be returned from adhoc queries, or by queries saved to your dashboard. To learn more, see the NRQL Reference in the New Relic documentation.
Returns the number of active Admin users.
SELECT uniqueCount(AdminId)
FROM Transaction
WHERE appName='<your_app_name>' SINCE 15 minutes ago
Returns the names of active Admin users.
SELECT uniques(AdminName)
FROM Transaction
WHERE appName='<your_app_name>' SINCE 15 minutes ago
Returns the number of recent Admin actions.
SELECT count(AdminId)
FROM Transaction
WHERE appName ='<your_app_name>' FACET AdminName SINCE 1 day ago
Returns detail information about recent admin actions, including the Admin username, duration, and application name.
SELECT AdminName, duration, name
FROM Transaction
WHERE appName='<your_app_name>' AND AdminName IS NOT NULL
AND AdminName != 'N/A' LIMIT 50
Returns the number of application events by category during the specified time period.
SELECT average(CatalogCategoryCount)
FROM Cron
WHERE CatalogCategoryCount IS NOT NULL
AND appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of application events in the catalog by category during the specified time period.
SELECT average(CatalogCategoryCount)
FROM Cron
WHERE CatalogCategoryCount IS NOT NULL
AND CatalogCategoryCount > 0
AND appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the number of application events by product during the specified time period.
SELECT average(CatalogProductActiveCount)
FROM Cron
WHERE CatalogProductActiveCount IS NOT NULL
AND appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of active application events by product during the specified time period.
SELECT average(CatalogProductActiveCount)
FROM Cron
WHERE CatalogProductActiveCount IS NOT NULL
AND CatalogProductActiveCount > 0
AND appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the average number of application events for configurable products during the specified time period.
SELECT average(CatalogProductConfigurableCount)
FROM Cron
WHERE CatalogProductConfigurableCount IS NOT NULL
AND appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of application events by configurable product during the specified time period.
SELECT average(CatalogProductConfigurableCount)
FROM Cron
WHERE CatalogProductConfigurableCount IS NOT NULL
AND CatalogProductConfigurableCount > 0
AND appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the total number of application events for all products.
SELECT average(CatalogProductCount)
FROM Cron
WHERE CatalogProductCount IS NOT NULL
AND appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of application events for all products during the specified time period.
SELECT average(CatalogProductCount)
FROM Cron
WHERE CatalogProductCount IS NOT NULL
AND CatalogProductCount > 0
AND appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the average number of application events by customer.
SELECT average(CustomerCount)
FROM Cron
WHERE CustomerCount IS NOT NULL
AND CustomerCount > 0<
AND appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of customers during the specified time period.
SELECT average(CustomerCount)
FROM Cron
WHERE CustomerCount IS NOT NULL
AND CustomerCount > 0
AND appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the average number of times application modules are enabled, disabled, or installed during the specified time period.
SELECT average(ModulesDisabled), average(ModulesEnabled), average
(ModulesInstalled)
FROM Cron<
WHERE appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of times modules were enabled, disabled, or installed during the specified time period.
SELECT average(ModulesDisabled), average(ModulesEnabled), average
(ModulesInstalled)
FROM Cron
WHERE appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns the average number of application events by website and store during the specified time period.
SELECT average(StoreViewCount), average(WebsiteCount)
FROM Cron
WHERE appName = '<your_app_name>' TIMESERIES 2 minutes
Returns the average number of current application events during the specified time period.
SELECT average(StoreViewCount), average(WebsiteCount)
FROM Cron
WHERE appName = '<your_app_name>' SINCE 2 minutes ago LIMIT 1
Returns all application event data.
SELECT *
FROM Cron
WHERE appName = '<your_app_name>'
Returns the number of active customers during the specified time period.
SELECT uniqueCount(CustomerId)
FROM Transaction
WHERE appName = '<your_app_name>' SINCE 15 minutes ago
Returns the names of active customers during the specified time period.
SELECT uniques(CustomerName)
FROM Transaction
WHERE appName='<your_app_name>' SINCE 15 minutes ago
Returns the top customers during the specified time period.
SELECT count(CustomerId)
FROM Transaction
WHERE appName = '<your_app_name>' FACET CustomerName SINCE 1 day ago
Returns a defined number of records of recent activity, that include the customer name and duration of visit.
SELECT CustomerName, duration, name
FROM Transaction
WHERE appName='<your_app_name>'
AND CustomerName IS NOT NULL
AND CustomerName != 'N/A' LIMIT 50
Returns the number of orders placed during the specified time period.
SELECT count(Order)
FROM Transaction SINCE 1 day ago
Returns the total number of line items ordered during the specified time period.
SELECT sum(orderValue)
FROM Transaction SINCE 1 day ago
Returns the total number of line items ordered during the specified time period.
SELECT sum(lineItemCount)
FROM Transaction SINCE 1 day ago