Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance tracking #106

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

barryvdh
Copy link
Contributor

@barryvdh barryvdh commented Nov 2, 2022

This adds initial performance tracking by sending (server side) transactions. Could be used to add long-running queries or other events perhaps. Needs to set a sample rate + enable it in the backend. See #60

(Not very much experience with this, but it does seem to record transactions).

@barryvdh barryvdh mentioned this pull request Nov 2, 2022
@barryvdh
Copy link
Contributor Author

barryvdh commented Nov 3, 2022

Tweaked it a bit, it now also adds the SQL queries from the Profliler
image

@barryvdh barryvdh changed the title Feat performance Performance tracking Nov 8, 2022
@peterjaap
Copy link
Contributor

@barryvdh did you do any testing on a production system of this?

@barryvdh
Copy link
Contributor Author

Not that much, database logging didnt really work this way but I was trying a different way before I was distracted by New Relic. It did seem to log the requests itself though, just not much additional data.

@peterjaap
Copy link
Contributor

@barryvdh I have to say I'm more interested in the CWV tracking (https://docs.sentry.io/product/performance/web-vitals/) than in database logging / PHP request logging. We use Blackfire for that mainly.

@ahmadalfy
Copy link

This is really exciting, can we get that merged?

Copy link
Member

@indykoning indykoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking pretty good! I hope to ba able to merge it soon 🚀

/** @var \Magento\Framework\App\ResourceConnection */
private $resourceConnection;

public function __construct(\Magento\Framework\App\ResourceConnection $resourceConnection)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $resourceConnection is not used in this file, can it be removed without issues?


public function execute(\Magento\Framework\Event\Observer $observer)
{
$this->sentryPerformance->startTransaction($this->request);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it be a good idea to add the check wether we're doing performance tracking in these places as well? To ensure no code related to performance tracking is executed when it's disabled

@MagicLegend
Copy link

Hey @barryvdh / @indykoning , what is still missing from this PR? I would be down to do the last mile to get this PR across the finish line. I would love to have performance tracking integrated :)

@indykoning
Copy link
Member

For me the main thing missing is that check wether performance tracking is enabled and preventing any performance tracking code from being executed if it is enabled.

So just the review left above, #106 (comment) is not the only place this check should be though.

@norgeindian
Copy link

@peterjaap , did you find a way to monitor Core Web Vitals with the module?

@Seroliser
Copy link

Is there any status here? Is it possible to get this merged into master? We're in need of profiling on Magento projects. Would be highly appreciated!

@peterjaap
Copy link
Contributor

@Seroliser have you tested this PR?

@barryvdh barryvdh marked this pull request as draft November 1, 2023 08:19
@barryvdh
Copy link
Contributor Author

barryvdh commented Nov 1, 2023

To be honest, I'm not sure if this was ready or not. I think it was somewhat working, but only on dev setups. So not sure how valuable that is. I would have to test some more.

I agree that Web Vitals could be more useful, but I was hoping to catch some bad behaviour with production data (eg. queries in loops etc).

@norgeindian
Copy link

After we included the current setup, we were actually able to see results for Core Web Vitals without further configuration.
So it seems to be included already.

@JKetelaar
Copy link
Contributor

Also been using this for a few months now and it works great!

@metalc0der
Copy link

I see this PR is still in draft. Did this feature ever get merged into master? I want to start using the package but I need performance monitoring.

@amenk
Copy link
Contributor

amenk commented Jun 4, 2024

@norgeindian as for CoreWebVitals, this might also be interesting for you :-) #137

@norgeindian
Copy link

@amenk , thanks for the info. Looks good. But why do we already see results in the CoreWebVitals section in Sentry, if that feature was turned off all the time?
Or does it even improve these statistics?

@amenk
Copy link
Contributor

amenk commented Jun 5, 2024

@norgeindian my PR is about the new INP metric (and the JS library update)

@norgeindian
Copy link

@amenk , ah sorry, now I get it. Awesome, really cool. Thanks for that.

@rommelfreddy rommelfreddy mentioned this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants