magento2-sentry icon indicating copy to clipboard operation
magento2-sentry copied to clipboard

Performance Monitoring

Open webtekindo opened this issue 4 years ago • 10 comments

Is there any plan to be able to use https://docs.sentry.io/product/performance/getting-started/ with this extension? Thank you.

webtekindo avatar Oct 27 '20 08:10 webtekindo

That is not in the planning yet, but is is a great feature request! 😄

I have put it on the planning, in the meantime PRs are always welcome 🙂

indykoning avatar Oct 28 '20 11:10 indykoning

@webtekindo what should we add for this? As far as I can see, you just have to add 'traces_sample_rate' => 1.0 to your env.php file?

peterjaap avatar Feb 03 '21 14:02 peterjaap

@webtekindo what should we add for this? As far as I can see, you just have to add 'traces_sample_rate' => 1.0 to your env.php file?

@peterjaap does the plugin pass the traces_sample_rate parameter onto Sentry SDK?

salmino avatar Feb 22 '21 13:02 salmino

@salmino you're right. It does not.

But with https://github.com/justbetter/magento2-sentry/pull/90, you can easily enable the performance monitoring to test it. I'm running a test now, if it's successful, I'll create a PR to add it to this extension.

I've created an observer that does this;

$observer->getEvent()->getConfig()->setTracesSampleRate(1.0);

Or you could use the sampler;

$observer->getEvent()->getConfig()->setTracesSampler(function (\Sentry\Tracing\SamplingContext $context): float {
    return 1.0;
});

peterjaap avatar May 17 '22 11:05 peterjaap

If you run it in production and especially if you have a high sample rate, please use Relay.

peterjaap avatar May 17 '22 11:05 peterjaap

I guess this doesn't do anything since we should probably find a way to create these "Transactions" they're speaking of. Now, this extension only fires when an actual exception is being thrown.

peterjaap avatar May 17 '22 12:05 peterjaap

Ah, here's some more info on how to create those transactions; https://docs.sentry.io/platforms/php/performance/instrumentation/custom-instrumentation/

peterjaap avatar May 17 '22 13:05 peterjaap

Maybe we could get some inspiration from https://github.com/yireo/Yireo_NewRelic2

peterjaap avatar May 17 '22 13:05 peterjaap

Proof of concept: https://github.com/justbetter/magento2-sentry/pull/106

barryvdh avatar Nov 02 '22 16:11 barryvdh