src: Use new BinaryPropagator methods in opentelemetry_contrib/0.10.

This commit is contained in:
Jonathan Davies 2023-01-31 13:45:43 +00:00
parent 14ba9a811f
commit c034bdedfe
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ impl ClientConn {
.with_kind(SpanKind::Client) .with_kind(SpanKind::Client)
.start(&tracer); .start(&tracer);
let propagator = BinaryPropagator::new(); let propagator = BinaryPropagator::new();
let telemetry_id: Bytes = propagator.to_bytes(span.span_context()).to_vec().into(); let telemetry_id: Bytes = propagator.serialize_into_bytes(span.span_context()).to_vec().into();
} else { } else {
let telemetry_id: Bytes = Bytes::new(); let telemetry_id: Bytes = Bytes::new();
} }

View File

@ -142,7 +142,7 @@ impl ServerConn {
let mut span = if !req_enc.telemetry_id.is_empty() { let mut span = if !req_enc.telemetry_id.is_empty() {
let propagator = BinaryPropagator::new(); let propagator = BinaryPropagator::new();
let context = propagator.from_bytes(req_enc.telemetry_id.to_vec()); let context = propagator.deserialize_from_bytes(req_enc.telemetry_id.to_vec());
let context = Context::new().with_remote_span_context(context); let context = Context::new().with_remote_span_context(context);
tracer.span_builder(format!(">> RPC {}", path)) tracer.span_builder(format!(">> RPC {}", path))
.with_kind(SpanKind::Server) .with_kind(SpanKind::Server)