{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments/133364954","pull_request_review_id":56535971,"id":133364954,"diff_hunk":"@@ -0,0 +1,61 @@\n+<?php\n+\n+/**\n+ * Disable New Relic's browser metrics\n+ *\n+ * Removes NR's JavaScript for tracking browser metrics, including page load times, Apdex score, and more.\n+ *\n+ * Must be called at or before the `template_redirect` action.\n+ */\n+function wpcom_vip_disable_new_relic_js() {\n+\tif ( did_action( 'template_redirect' ) && ! doing_action( 'template_redirect' ) ) {\n+\t\t_doing_it_wrong( __FUNCTION__, 'New Relic&#8217;s browser tracking can only be disabled at or before the `template_redirect` action.', '1.0' );\n+\t\treturn;\n+\t}\n+\n+\tif ( function_exists( 'newrelic_disable_autorum' ) ) {\n+\t\tnewrelic_disable_autorum();\n+\t}\n+}\n+\n+/**\n+ * Add the exact URI to NewRelic tracking but only if we're not in the admin\n+ */\n+function wpcom_vip_add_URI_to_newrelic(){\n+\tif ( ! is_admin() && function_exists( 'newrelic_add_custom_parameter' ) ){\n+\t\tnewrelic_add_custom_parameter( 'REQUEST_URI', isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );\n+\t\tnewrelic_add_custom_parameter( 'HTTP_REFERER', isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '' );\n+\t\tnewrelic_add_custom_parameter( 'HTTP_USER_AGENT', isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '' );\n+\t}\n+}\n+add_action( 'muplugins_loaded', 'wpcom_vip_add_URI_to_newrelic' );\n+\n+/**\n+ * Name cron correctly in New Relic and do not count it as part of the Apdex score.\n+ *\n+ * We don't want to count cron as part of the apdex because it is not a user facing function and if cron tasks are slow it doesn't imply that the site's performance is impacted. Without removing these, long running cron tasks could flag the site as having performance problems, which would cause false positives in the monitoring.\n+ */\n+function wpcom_vip_cron_for_newrelic(){\n+\tif ( wp_doing_cron() && function_exists( 'newrelic_ignore_apdex' ) && function_exists( 'newrelic_name_transaction' ) ){\n+\t\tnewrelic_name_transaction( 'wp-cron' );","path":"vip-helpers/vip-newrelic.php","position":40,"original_position":40,"commit_id":"caae5979cace3c2694fac691754ef66b09b88a0d","original_commit_id":"caae5979cace3c2694fac691754ef66b09b88a0d","user":{"login":"simonwheatley","id":233434,"avatar_url":"https://avatars1.githubusercontent.com/u/233434?v=4","gravatar_id":"","url":"https://api.github.com/users/simonwheatley","html_url":"https://github.com/simonwheatley","followers_url":"https://api.github.com/users/simonwheatley/followers","following_url":"https://api.github.com/users/simonwheatley/following{/other_user}","gists_url":"https://api.github.com/users/simonwheatley/gists{/gist_id}","starred_url":"https://api.github.com/users/simonwheatley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonwheatley/subscriptions","organizations_url":"https://api.github.com/users/simonwheatley/orgs","repos_url":"https://api.github.com/users/simonwheatley/repos","events_url":"https://api.github.com/users/simonwheatley/events{/privacy}","received_events_url":"https://api.github.com/users/simonwheatley/received_events","type":"User","site_admin":false},"body":"Sorry to be unclear, I meant add the event name as a custom parameter as well as what you're already doing here. ","created_at":"2017-08-16T06:08:04Z","updated_at":"2017-08-16T06:08:05Z","html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/708#discussion_r133364954","pull_request_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708","_links":{"self":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments/133364954"},"html":{"href":"https://github.com/Automattic/vip-go-mu-plugins/pull/708#discussion_r133364954"},"pull_request":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708","id":134791773,"html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/708","diff_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/708.diff","patch_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/708.patch","issue_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/708","number":708,"state":"open","locked":false,"title":"Move New Relic separate file + Track WP_CLI and Cron","user":{"login":"sboisvert","id":289193,"avatar_url":"https://avatars1.githubusercontent.com/u/289193?v=4","gravatar_id":"","url":"https://api.github.com/users/sboisvert","html_url":"https://github.com/sboisvert","followers_url":"https://api.github.com/users/sboisvert/followers","following_url":"https://api.github.com/users/sboisvert/following{/other_user}","gists_url":"https://api.github.com/users/sboisvert/gists{/gist_id}","starred_url":"https://api.github.com/users/sboisvert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboisvert/subscriptions","organizations_url":"https://api.github.com/users/sboisvert/orgs","repos_url":"https://api.github.com/users/sboisvert/repos","events_url":"https://api.github.com/users/sboisvert/events{/privacy}","received_events_url":"https://api.github.com/users/sboisvert/received_events","type":"User","site_admin":false},"body":"Move all New Relic logic to one file and add logging of Cron and WP_CLI as separate transactions that don't impact the Apdex score of the site (since those transactions don't impact what users get in terms of performance)","created_at":"2017-08-09T01:21:36Z","updated_at":"2017-08-16T06:08:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3fe97f8b375ab048d4fff57b121206cab93a99e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708/commits","review_comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708/comments","review_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/708/comments","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/caae5979cace3c2694fac691754ef66b09b88a0d","head":{"label":"Automattic:nr-cron-cli","ref":"nr-cron-cli","sha":"caae5979cace3c2694fac691754ef66b09b88a0d","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":32939693,"name":"vip-go-mu-plugins","full_name":"Automattic/vip-go-mu-plugins","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/vip-go-mu-plugins","description":"mu-plugins used on the VIP Go platform.","fork":false,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins","forks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/forks","keys_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/teams","hooks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/hooks","issue_events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/events","assignees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/tags","blobs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/languages","stargazers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/stargazers","contributors_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contributors","subscribers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscribers","subscription_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscription","commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/merges","archive_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/downloads","issues_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/deployments","created_at":"2015-03-26T16:42:46Z","updated_at":"2017-08-15T18:17:20Z","pushed_at":"2017-08-16T04:43:30Z","git_url":"git://github.com/Automattic/vip-go-mu-plugins.git","ssh_url":"git@github.com:Automattic/vip-go-mu-plugins.git","clone_url":"https://github.com/Automattic/vip-go-mu-plugins.git","svn_url":"https://github.com/Automattic/vip-go-mu-plugins","homepage":"https://vip.wordpress.com/documentation/vip-go/","size":38263,"stargazers_count":13,"watchers_count":13,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":99,"forks":13,"open_issues":99,"watchers":13,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"7b3940f8a1c3289bdaa6116bd63aec9f2df5dc3d","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":32939693,"name":"vip-go-mu-plugins","full_name":"Automattic/vip-go-mu-plugins","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/vip-go-mu-plugins","description":"mu-plugins used on the VIP Go platform.","fork":false,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins","forks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/forks","keys_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/teams","hooks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/hooks","issue_events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/events","assignees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/tags","blobs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/languages","stargazers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/stargazers","contributors_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contributors","subscribers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscribers","subscription_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscription","commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/merges","archive_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/downloads","issues_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/deployments","created_at":"2015-03-26T16:42:46Z","updated_at":"2017-08-15T18:17:20Z","pushed_at":"2017-08-16T04:43:30Z","git_url":"git://github.com/Automattic/vip-go-mu-plugins.git","ssh_url":"git@github.com:Automattic/vip-go-mu-plugins.git","clone_url":"https://github.com/Automattic/vip-go-mu-plugins.git","svn_url":"https://github.com/Automattic/vip-go-mu-plugins","homepage":"https://vip.wordpress.com/documentation/vip-go/","size":38263,"stargazers_count":13,"watchers_count":13,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":99,"forks":13,"open_issues":99,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708"},"html":{"href":"https://github.com/Automattic/vip-go-mu-plugins/pull/708"},"issue":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/708"},"comments":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/708/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/708/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/caae5979cace3c2694fac691754ef66b09b88a0d"}}}}
{"actor":{"display_login":"simonwheatley"}}