I'm using Self-Hosted Sentry to monitor my wordpress websites. I receive errors and exceptions log in my sentry host panel and monitor issues, but I don't receive any performance reports.<br />
I added this snippet codes at the end of index.php but it didn't work.
Can anyone help me to configure wordpress to use performance monitoring in sentry?
I added this snippet codes at the end of index.php but it didn't work.
Code:
\Sentry\init([
'dsn' => 'SENTRY_DSN',
'traces_sampler' => static function (\Sentry\Tracing\SamplingContext $context): float {
if (false !== strpos($context->getTransactionContext()->getName(), 'health')) {
// Discard transactions that have 'health' in their name
return 0.0;
}
// Sample rate for all other transactions
return 1.0;
},
]);