stayallive / wp-sentry

A (unofficial) WordPress plugin reporting PHP and JavaScript errors to Sentry.
https://wordpress.org/plugins/wp-sentry-integration/
MIT License
305 stars 48 forks source link

Unable to get PHP tracing to work #132

Closed robd003 closed 2 years ago

robd003 commented 2 years ago

I've tried doing the callback method described in the README, but can't seem to get tracing to work.

function wp_sentry_clientbuilder_callback( \Sentry\ClientBuilder $builder ): void {
    // Enable tracing
        $builder->getOptions()->setTracesSampleRate(1.0);
}

define( 'WP_SENTRY_CLIENTBUILDER_CALLBACK', 'wp_sentry_clientbuilder_callback' );
stayallive commented 2 years ago

Hey @robd003, take a look at this discussion: https://github.com/stayallive/wp-sentry/discussions/113.

It's not simply enabling that option, tracing is not implemented so you need to do a lot more work to get it to do anything.

If you are feeling adventurous you can hook it up yourself with comments from that discussion and the docs: https://docs.sentry.io/platforms/php/performance/instrumentation/custom-instrumentation/.