fix(observability): preserve inbound trace context
This commit is contained in:
@@ -6,7 +6,7 @@ use axum::{
|
||||
};
|
||||
use crank_core::{CorrelationContext, RequestId, TraceContext};
|
||||
use crank_metrics::ExemplarTraceId;
|
||||
use crank_observability::{set_remote_trace_parent, with_request_correlation};
|
||||
use crank_observability::with_request_correlation;
|
||||
use tracing::{Instrument, info, info_span};
|
||||
|
||||
pub const REQUEST_ID_HEADER: HeaderName = HeaderName::from_static("x-request-id");
|
||||
@@ -124,11 +124,7 @@ fn one_auxiliary_header_within_budget(
|
||||
}
|
||||
|
||||
fn set_canonical_parent(span: &tracing::Span, context: &TraceContext) {
|
||||
let mut headers = axum::http::HeaderMap::new();
|
||||
if let Ok(value) = HeaderValue::from_str(context.traceparent()) {
|
||||
headers.insert("traceparent", value);
|
||||
set_remote_trace_parent(span, &headers);
|
||||
}
|
||||
crank_trace::set_parent_from_trace_context(span, context);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user