-
Notifications
You must be signed in to change notification settings - Fork 249
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
fix: strip traceparent comment from info_span #5078
fix: strip traceparent comment from info_span #5078
Conversation
CodSpeed Performance ReportMerging #5078 will not alter performanceComparing Summary
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
let query = self | ||
.0 | ||
.split_once("/* traceparent=") |
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.
An edge case but: what if /* traceparent=
is used in a query (e.g. in a string literal)? If it's a raw query, it's not necessarily going to be a parameter and could be hardcoded. Could we check that we are matching a comment at the very end of the query (maybe a regex is fine)?
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.
I've added a check for an end of comment followed by an end of input after the traceparent and an additional test
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.
oh dang the test wasnt asserting on logs_contain
😅
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.
Looks good to me, nice work!
Closes: https://github.com/prisma/team-orm/issues/1382
Fixes: prisma/prisma#24375