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

Feat performance #145

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

rommelfreddy
Copy link
Contributor

related to #106
fixes #60


i've continued the implementation of the performance tracking and also added the profiling.
Thank you to @barryvdh for doing the base stuff

@rommelfreddy rommelfreddy force-pushed the feat-performance branch 2 times, most recently from b0050ce to eb756d0 Compare August 7, 2024 16:36
@rommelfreddy
Copy link
Contributor Author

hey @indykoning

could you give me a first response on this, please?

I will resolve the conflicts if you are willing to proceed with the merge.

@royduin
Copy link
Member

royduin commented Aug 28, 2024

He's currently with vacation, back next week

private ConfigInterface $config,
private array $excludePatterns = []
) {
$this->excludePatterns = array_merge([
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment here why these are excluded, so if we or others look back at this we can quickly see why

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think the excluded events are self-explained.
these events happens very often on each request.
And because the count of spans in a transaction is limited, we have to exclude a few events, which also creates spans in a high amount.

]);

// Start the transaction
$transaction = startTransaction($context);
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure. Starting a transaction here won't count towards your Sentry usage and limits right?
Since we'll be executing it every request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no. it only counts if the report is sent to the gateway (at the latest moment)

But i did not tested it explicitly, because we do not have any limits.

Comment on lines +116 to +120
} elseif ($state->getAreaCode() === 'graphql') {
$this->transaction->setOp('graphql');
} else {
$this->transaction->setOp($state->getAreaCode());
}
Copy link
Member

Choose a reason for hiding this comment

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

Was there anything special that needed to happen here? If not we can remove the elseif

Suggested change
} elseif ($state->getAreaCode() === 'graphql') {
$this->transaction->setOp('graphql');
} else {
$this->transaction->setOp($state->getAreaCode());
}
} else {
$this->transaction->setOp($state->getAreaCode());
}

SentrySdk::getCurrentHub()->setSpan($transaction);
}

public function finishTransaction(ResponseInterface|int $statusCode): void
Copy link
Member

Choose a reason for hiding this comment

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

Should we maybe wrap this in a try/catch as well like captureException so issues when collecting performance metrics can't interfere with rendering the page to a customer

@igorgaucho10
Copy link

Is there any update on this PR? When can we expect this to be merged?

@rommelfreddy
Copy link
Contributor Author

Is there any update on this PR? When can we expect this to be merged?

@igorgaucho10 currently i do not have the time to change the PR.

If you are using Versio 3.7.2, you can safefly use this patch: https://github.com/justbetter/magento2-sentry/compare/3.7.2...webidea24:magento2-sentry:master.diff

I also use this in my projects.
It contains a few more improvements, for which there is also a PR. (please see commit log)


If you want, feel free to create a PR to my repository to resolve the comments of @indykoning

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.

Performance Monitoring
5 participants