Skip to content

Commit faf066e

Browse files
committed
Add newrelic_ignore_transaction to prometheus endpoint
1 parent bdc9d54 commit faf066e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

prometheus/endpoint.php

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
use Prometheus\Storage\InMemory;
1111

1212
// @codeCoverageIgnoreStart -- this is a standalone endpoint which doens't run in the context of the WP tests
13+
if ( extension_loaded( 'newrelic' ) ) { // Ensure PHP agent is available
14+
newrelic_ignore_transaction();
15+
}
16+
1317
require_once __DIR__ . '/vendor/autoload.php';
1418
require_once dirname( __DIR__ ) . '/lib/utils/class-context.php';
1519

0 commit comments

Comments
 (0)