Skip to content

Commit

Permalink
fix(tracing): quote traceparent value in sql comment (#4354)
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Fernández <[email protected]>
  • Loading branch information
anuraaga and Miguel Fernández authored Nov 29, 2023
1 parent 5c4707e commit f2e5886
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions query-engine/connectors/sql-query-connector/src/sql_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn trace_parent_to_string(context: &SpanContext) -> String {
let span_id = context.span_id();

// see https://www.w3.org/TR/trace-context/#traceparent-header-field-values
format!("traceparent=00-{trace_id:032x}-{span_id:032x}-01")
format!("traceparent='00-{trace_id:032x}-{span_id:032x}-01'")
}

pub trait SqlTraceComment: Sized {
Expand All @@ -34,7 +34,7 @@ macro_rules! sql_trace {
fn add_trace_id(self, trace_id: Option<&str>) -> Self {
if let Some(traceparent) = trace_id {
if should_sample(&traceparent) {
self.comment(format!("traceparent={}", traceparent))
self.comment(format!("traceparent='{}'", traceparent))
} else {
self
}
Expand Down

0 comments on commit f2e5886

Please sign in to comment.