Skip to content

How to use Metrics (if possible)? #193

Discussion options

You must be logged in to vote

Ah I see the issue... I read over it. Apparently v7 of the SDK need an extra integration for metrics to function. We should probably add this by default or have an easier way to enable this. But for now you can paste this snippet in your theme functions.php for example.

add_action( 'wp_enqueue_scripts', function () {
	wp_add_inline_script( 'wp-sentry-browser', 'function wp_sentry_hook(options) { options.integrations.push(Sentry.metrics.metricsAggregatorIntegration()); }', 'before' );
} );

After this metrics should start working!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@alessandro-newzoo
Comment options

@stayallive
Comment options

Answer selected by alessandro-newzoo
@alessandro-newzoo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants