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

Laravel Pennant performance spans & breadcrumbs #655

Open
cleptric opened this issue Feb 17, 2023 · 5 comments
Open

Laravel Pennant performance spans & breadcrumbs #655

cleptric opened this issue Feb 17, 2023 · 5 comments

Comments

@cleptric
Copy link
Member

Laravel Pennant is a new feature flagging library for Laravel.

There are currently two events dispatched, FeatureRetrieved and FeatureResolved.

We could try contributing new FeatureRetrieve and FeatureResolve events upstream, or use decorators, so we are able to wrap the code or DB query executed into a span, containing the feature identifier and result.

@martinbean
Copy link

@cleptric I’m happy to create the code and PR for this if you would like?

@cleptric
Copy link
Member Author

@martinbean Hey, thanks a lot!
In order to create meaningful spans & breadcrumbs, we would need new events added to pennant, that fire before a feature is retrieved, see laravel/pennant#41.

@martinbean
Copy link

@cleptric Why would Sentry need an event before a feature is retrieved? Would you not want to add a breadcrumb after a feature and its value has been resolved?

@cleptric
Copy link
Member Author

We already trace all DB queries related to retrieving a feature, so the only addition here would be to wrap these queries into a new span and create a breadcrumb before the DB queries are run. This is mostly about better UX in the product.

@stayallive
Copy link
Collaborator

In addition to @cleptric their comments, having an event before & after means we know when the framework started and finished resolving the feature flag, meaning we know how long it took and which (if any) database queries or other expensive operations took place while resolving the flag. This gives much insights in the timing. So for just breadcrumbs the "after" is enough but for the performance spans the "before" is a must.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants