Skip to content

Commit

Permalink
add Scope.to_span_ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Feb 12, 2024
1 parent 1b9ba95 commit e001d62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/opentelemetry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ module Scope = struct
mutable attrs: key_value list;
}

(** Turn the scope into a span context *)
let[@inline] to_span_ctx (self : t) : Span_ctx.t =
Span_ctx.make ~trace_id:self.trace_id ~parent_id:self.span_id ()

(** Add an event to the scope. It will be aggregated into the span.
Note that this takes a function that produces an event, and will only
Expand Down

0 comments on commit e001d62

Please sign in to comment.