前言介紹
- 這款 WordPress 外掛「New Relic Reporting for WordPress」是 2016-12-01 上架。
- 目前有 800 個安裝啟用數。
- 上一次更新是 2024-11-12,距離現在已有 173 天。
- 外掛最低要求 WordPress 6.3 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 8.0 以上。
- 有 4 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
10up | tott | jeffpaul | ritteshpatel | oscarssanchez |
外掛標籤
New Relic | APM Reporting | New Relic Reporting | New Relic APM Reporting |
內容簡介
WP New Relic (WPNR) 是專為搭配 New Relic APM 設計的 WordPress 外掛程式,該程式可使用 New Relic PHP Agent API,將 WordPress 的重要資訊,如模板、使用者、請求類型、交易名稱等,妥善納入現有度量中。此外掛程式已測試與 PHP Agent 6.7.0.174 版本相容。
New Relic 是 New Relic, Inc. 的商標。
管理設定
啟用此外掛程式後,在 WordPress 控制台的「工具」選單中,您將看到一個名為 New Relic 的新選項。如果您正在使用網路模式,設定頁面將可在網路控制台中找到。
擷取 URL 參數:如果啟用擷取網址設定,它將擷取 URL 參數以顯示於交易追蹤中。
基本設定
預設外掛程式將設定 3 種配置設定。
– newrelic.appname
– newrelic.capture_params
– newrelic.framework(值為 wordpress)
appname 及 capture_params 設定可透過 wp_nr_config 篩選器進行覆寫。wp_nr_setup_config 動作鉤子也可用於設置其他額外的配置設定。
New Relic 自訂屬性
某些有用的自訂屬性(就像 WordPress 文章的後設資料)將為每個事件設置,可透過鍵值對提供其他資訊。您可以在 New Relic Insights 中查詢事件並使用這些屬性進行篩選。有關如何查詢事件的更多詳細資訊,請參閱 NRQL 參考文件。
使用者
使用者屬性是透過 newrelic_set_user_attributes 設置的。如果使用者已登入,則會將使用者 ID 設置為使用者屬性,如果未登入,則會將其設置為 not-logged-in。
例如,在 New Relic Insights 中,您可以查詢非已登入使用者的交易,如下所示:
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND user = ‘not-logged-in’
文章 ID
對於單一文章,文章 ID 將透過交易中的 post_id 自訂參數進行設置。
例如:獲取 ID 為 190 的文章的所有交易。
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND post_id = ‘190’
您也可以查詢文章 190 的瀏覽次數。
SELECT count(*) FROM Transaction WHERE appName = ‘{appName}’ AND post_id = ‘190’
模板
對於每個請求,正在使用的模板設置為交易中的自訂模板參數。
例如:您可以透過以下方式查詢特定模板的所有交易。
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND template = ‘{Absolute Template Path}’
佈景主題
當前的佈景主題會被設置為傳輸中的自訂佈景主題參數。
例如:查詢所有「Twenty Fifteen」佈景主題的交易。
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND theme = ‘Twenty Fifteen’
請求類型
有三種類型的請求,即 web、ajax 和 cli。當前的請求類型將設置為傳輸中的自訂請求類型參數。
可透過 wp_nr_request_type 篩選器進行覆寫請求類型。
例如:獲取所有「ajax」請求類型的交易。
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND req
原文外掛簡介
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.
User
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’
Post 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’
Template
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}’
Theme
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’
Request type
There can be 3 type of requests namely web, ajax and cli. Current request type getting set as request_type custom parameter in transaction.
Request type can be override using wp_nr_request_type filter.
Ex: Get all transaction for “ajax” request type
SELECT * FROM Transaction WHERE appName = ‘{appName}’ AND request_type = ‘ajax’
Transaction Name
Transaction name is getting set as per the main WP_Query parameters using newrelic_name_transaction.
Possible values are Default Home Page, Front Page, Blog Page, Network Dashboard, Dashboard, Single – {post_type}, Page – {pagename}, Date Archive, Search Page, Feed, Archive – {post_type}, Category – {cat_name}, Tag – {tag_name}, Tax – {taxonomy} – {term}
Custom Error Logging
Using wp_nr_log_errors function, any plugin/theme can log errors/notices to New Relic for current transaction.
Note: This function can be used more than once but only last use will be considered to log the error to New Relic. It’s limitation of PHP Agent API.
wp_nr_log_errors( ‘Error message’, Exception $exception );
Runtime of async tasks
This plugin also tracks runtime of gearman async tasks. Gearman async task run for a particular hook and it’s runtime can be track using “wp_async_task-{hook}” custom attribute in New Relic Insights.
Issues
PHP version
PHP version 7.3.3 is known to cause issues with this plugin, updating to 7.3.11 or greater appears to resolve these issues. For more details, see issue#39.
Have an issue to report?
If you identify any errors or have an idea for improving the plugin, please open an issue. We’re excited to see what the community thinks of this project, and we would love your input!
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「New Relic Reporting for WordPress」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 | 1.2 | 1.3 | 1.3.1 | 1.3.2 | 1.3.3 | trunk |
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。