-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(qe-wasm): make traces consistent with node-api engine (#5090)
* fix(query-engine-wasm): expand scope of `prisma:engine:query` span Expand the scope of the `prisma:engine:query` span to contain both the request handler and the response serialization, identical to the Node-API engine, preventing `prisma:engine:response_json_serialization` from being orphaned outside the trace. This is a follow up to #5089. * [integration] * Add missing bits for transactions * [integration] * strip traceparents in attributes with driver adapters * [integration]
- Loading branch information
Showing
9 changed files
with
61 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::fmt; | ||
|
||
pub struct QueryForTracing<'a>(pub &'a str); | ||
|
||
impl fmt::Display for QueryForTracing<'_> { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
write!(f, "{}", strip_query_traceparent(self.0)) | ||
} | ||
} | ||
|
||
pub fn strip_query_traceparent(query: &str) -> &str { | ||
query.rsplit_once("/* traceparent=").map_or(query, |(str, remainder)| { | ||
if remainder | ||
.split_once("*/") | ||
.is_some_and(|(_, suffix)| suffix.trim_end().is_empty()) | ||
{ | ||
str.trim_end() | ||
} else { | ||
query | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters