mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
add Span_link.of_span_ctx
This commit is contained in:
parent
e001d62fd5
commit
efc9d74a07
1 changed files with 6 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue