Skip to content

Commit

Permalink
Actually get the traceparent from debuginfo instead of trace_id
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Woods <[email protected]>
  • Loading branch information
snwoods committed Feb 8, 2024
1 parent dd6fa4b commit 155509f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ocaml/forkexecd/lib/forkhelpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ let safe_close_and_exec ?env stdin stdout stderr
List.fold_left maybe_add_id_to_fd_map dest_named_fds predefined_fds
in

let env = match env with Some e -> e | None -> default_path_env_pair in
let env = Option.value ~default:default_path_env_pair env in
let syslog_stdout =
match syslog_stdout with
| NoSyslogging ->
Expand Down
11 changes: 5 additions & 6 deletions ocaml/xapi-idl/lib/debuginfo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ let with_dbg ?(with_thread = false) ~module_name ~name ~dbg f =
| false ->
f_with_trace ()

let span_context_of_di di =
Option.map (fun span -> Tracing.Span.get_context span) di.tracing

let traceparent_of_dbg dbg =
of_string dbg
|> span_context_of_di
|> Option.map Tracing.SpanContext.trace_id_of_span_context
match String.split_on_char separator dbg with
| [_; traceparent] ->
Some traceparent
| _ ->
None

0 comments on commit 155509f

Please sign in to comment.