From efc9d74a074c78fee325215b8505f18f1f43bcc6 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 12 Feb 2024 14:17:23 -0500 Subject: [PATCH] add Span_link.of_span_ctx --- src/core/opentelemetry.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/opentelemetry.ml b/src/core/opentelemetry.ml index dd287d2b..9ca7748d 100644 --- a/src/core/opentelemetry.ml +++ b/src/core/opentelemetry.ml @@ -730,6 +730,8 @@ module Span_link : sig ?dropped_attributes_count:int -> unit -> t + + val of_span_ctx : ?attrs:key_value list -> Span_ctx.t -> t end = struct open Proto.Trace @@ -745,6 +747,10 @@ end = struct ~trace_id:(Trace_id.to_bytes trace_id) ~span_id:(Span_id.to_bytes span_id) ?trace_state ~attributes ?dropped_attributes_count () + + let[@inline] of_span_ctx ?attrs ctx : t = + make ~trace_id:(Span_ctx.trace_id ctx) ~span_id:(Span_ctx.parent_id ctx) + ?attrs () end (** Spans.