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

fix: strip traceparent comment from info_span #5078

Merged

Conversation

jacek-prisma
Copy link
Contributor

@jacek-prisma jacek-prisma commented Dec 6, 2024

@jacek-prisma jacek-prisma requested a review from aqrln December 6, 2024 18:14
@jacek-prisma jacek-prisma requested a review from a team as a code owner December 6, 2024 18:14
Copy link

codspeed-hq bot commented Dec 6, 2024

CodSpeed Performance Report

Merging #5078 will not alter performance

Comparing jacek-prisma:fix/strip-traceparent-from-trace (dc2e1bf) with main (57a00c8)

Summary

✅ 11 untouched benchmarks

@jacek-prisma jacek-prisma added this to the 6.1.0 milestone Dec 9, 2024
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let query = self
.0
.split_once("/* traceparent=")
Copy link
Member

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)?

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've added a check for an end of comment followed by an end of input after the traceparent and an additional test

Copy link
Contributor Author

@jacek-prisma jacek-prisma Dec 9, 2024

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 😅

Copy link
Member

@aqrln aqrln left a 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!

@jacek-prisma jacek-prisma merged commit 34f162e into prisma:main Dec 10, 2024
368 checks passed
@jacek-prisma jacek-prisma deleted the fix/strip-traceparent-from-trace branch December 10, 2024 12:04
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.

Make sure db.statement attribute doesn't include the traceparent comment
2 participants