New Relic Reporting for WordPress
WP New Relic (WPNR) is designed to use with New Relic APM which uses New Relic PHP Agent API to properly augment existing metrics with valuable WordPress details such as templates, users, request type, transaction names etc. This plugin is tested with PHP Agent 10.19.0.9. New Relic is a trademark of
About this tool.
WP New Relic (WPNR) is designed to use with New Relic APM which uses New Relic PHP Agent API to properly augment existing metrics with valuable WordPress details such as templates, users, request type, transaction names etc. This plugin is tested with PHP Agent 10.19.0.9.
New Relic is a trademark of New Relic, Inc.
Admin Settings
After activating the plugin, You will see a new option named New Relic under the Tools menu in your WordPress Dashboard. If you are running WordPress in Network Mode, the settings page will be found in your Network Dashboard.
Capture URL Parameters: If Capture URLs setting is enabled, it will capture URL parameters for displaying in transaction traces.
Basic Config
By default plugin will setup 3 configs. – newrelic.appname – newrelic.capture_params – newrelic.framework (value is wordpress)
appname and capture_params config can be override using wp_nr_config filter . wp_nr_setup_config action hook can also be used to setup any extra config.
New Relic Custom Attributes
Certain useful custom attrribute (just like WordPress post meta) will be set for each event which can provide additional information using key-value pair. You can query events and filter them using these attributes in New Relic Insights. See NRQL reference for more details on how to query events.
- 01User User attribute is getting set using newrelic_set_user_attributes . If user is logged in, user ID will be set to user attribute and if not it will be set to not-logged-in . Ex: In New Relic Insights you can query transactions for non-logged in users as SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND user = ‘not-logged-in’
- 02Post ID For single post, post ID will be set via post_id custom parameter in transaction. Ex: Get all transactions for a post ID 190. SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND post_id = ‘190’ One can also query for post view count for post 190. SELECT count(*) FROM Transaction WHERE appName = ‘{appName}’ AND post_id = ‘190’
- 03Template For each request, template being used getting set as template custom parameter in transaction. Ex: You can query all transactions for a particular template as following. SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND template = ‘{Absolute Template Path}’
- 04Theme Current theme is getting set as theme custom parameter in transaction. Ex: Query all transactions for “Twenty Fifteen” theme. SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND theme = ‘Twenty Fifteen’
- 05