justbetter / magento2-sentry

Magento 2 module to log to Sentry
MIT License
161 stars 70 forks source link

Performance Monitoring #60

Open webtekindo opened 3 years ago

webtekindo commented 3 years ago

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

indykoning commented 3 years ago

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 🙂

peterjaap commented 3 years ago

@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?

salmino commented 3 years ago

@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?

peterjaap commented 2 years ago

@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 commented 2 years ago

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

peterjaap commented 2 years ago

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 commented 2 years ago

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

peterjaap commented 2 years ago

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

barryvdh commented 1 year ago

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

metalc0der commented 4 months ago

Is performance monitoring working?