Skip to content

Commit e2f1ffd

Browse files
committed
Simplify code by using get_trace_context
Signed-off-by: Steven Woods <[email protected]>
1 parent e39ab6f commit e2f1ffd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

ocaml/libs/tracing/tracing.ml

+1-4
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,7 @@ module Span = struct
437437

438438
let to_propagation_context span =
439439
let traceparent = span |> get_context |> SpanContext.to_traceparent in
440-
span
441-
|> get_context
442-
|> SpanContext.context_of_span_context
443-
|> TraceContext.with_traceparent (Some traceparent)
440+
span |> get_trace_context |> TraceContext.with_traceparent (Some traceparent)
444441

445442
let with_trace_context span trace_context =
446443
let span_context =

ocaml/libs/tracing/tracing_export.ml

+1-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ module Content = struct
8383
)
8484
in
8585
let tags =
86-
let span_context = Span.get_context s in
87-
let trace_context =
88-
SpanContext.context_of_span_context span_context
89-
in
86+
let trace_context = Span.get_trace_context s in
9087
let baggage =
9188
TraceContext.baggage_of trace_context |> Option.value ~default:[]
9289
in

0 commit comments

Comments
 (0)