From fdee7fe2dd1f91a8d1f78d6ce20d2bc86d555444 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 25 Oct 2024 10:44:32 -0400 Subject: [PATCH] fix otel.trace: set scope for explicit spans --- src/trace/opentelemetry_trace.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/trace/opentelemetry_trace.ml b/src/trace/opentelemetry_trace.ml index ebf9328..4d2d70f 100644 --- a/src/trace/opentelemetry_trace.ml +++ b/src/trace/opentelemetry_trace.ml @@ -242,7 +242,11 @@ module Internal = struct let active_spans = Active_spans.get () in Active_span_tbl.add active_spans.tbl otrace_id sb; - Otrace.{ span = otrace_id; meta = Meta_map.empty } + Otrace. + { + span = otrace_id; + meta = Meta_map.(empty |> add k_explicit_scope sb.scope); + } let exit_manual_span Otrace.{ span = otrace_id; _ } = let active_spans = Active_spans.get () in