-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(perf-issues): Allow MN+1 experiment to scan for prisma client occurrences #91566
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(perf-issues): Allow MN+1 experiment to scan for prisma client occurrences #91566
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #91566 +/- ##
==========================================
- Coverage 87.60% 83.99% -3.61%
==========================================
Files 10323 10331 +8
Lines 585926 586314 +388
Branches 22532 22532
==========================================
- Hits 513296 492479 -20817
- Misses 72209 93414 +21205
Partials 421 421 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Someone who's good at graphs/trees might know of a more efficient way to check the common parent, but I do not.
- I wonder if it'd be simpler to construct the parent lookup in the
visit
method, instead of having to copy the logic into both states and pass the data around - I think you've made enough changes to warrant updating the code comments (and maybe adding some more?)
That's minor though. 🚢
Made some perf improvements for the scanning algorithm (
Which is like a 9% improvement! |
So how it works:
3
for now), assemble lists for each offender with their parent lineage[parent, grandparent, great-grandparent]
when depth is set to 3. This is necessary for Prisma since DB spans produce the following for prisma traces (with their built in OTEL spans)[prisma.engine, prisma.client.operation, <user-callsite>]
max_allowable_depth
setting.event[spans]
list, so it'll exclude a root spanAdded some metrics as well to see when the detector bails out, and tested for those metrics as well to make sure we're using the correct code paths. The JSON file for the stubbed trace is the same one here though you may need to be a superuser to see that as its on my personal test organization.
Also added an option to meter this rollout to 25% instead of full GA since the added depth scanning will likely affect the detectors performance, I'll increase it in 25% increments and keep an eye out in case it does