Module Tezos_dal_node_lib.Opentelemetry_helpers

module Commitment_hash : sig ... end
val commitment_to_trace_id : Tezos_crypto_dal.Cryptobox.Commitment.t -> Opentelemetry.Trace_id.t
val slot_to_trace_id : Stdlib.Bytes.t -> Opentelemetry.Trace_id.t
val attr_of_index : 'a -> string * [> `Int of 'a ]
val attrs_of_slot : Tezos_dal_node_services.Types.Slot_id.t -> (string * [> `Int of int ]) list
val attr_of_commitment : Tezos_crypto_dal.Cryptobox.Commitment.t -> (string * [> `String of string ]) list
val trace_slot : ?attrs:(string * Opentelemetry.value) list -> name:string -> ?slot_id:Tezos_dal_node_services.Types.Slot_id.t -> slot_commitment:Tezos_crypto_dal.Cryptobox.Commitment.t -> (unit -> 'a) -> 'a
val trace_slot_no_commitment : ?attrs:(string * Opentelemetry.value) list -> name:string -> slot:string -> (unit -> 'a) -> 'a
val error_span : error_pp:(Stdlib.Format.formatter -> 'a -> unit) -> 'a -> attrs:Opentelemetry.Span.key_value list -> start_time:Opentelemetry.Timestamp_ns.t -> end_time:Opentelemetry.Timestamp_ns.t -> name:string -> Opentelemetry.Span.t
val trace_slot_after_es : ?attrs:Opentelemetry.Span.key_value list -> name:string -> ?slot_index:int -> ?slot_id:Tezos_dal_node_services.Types.Slot_id.t -> error_pp:(Stdlib.Format.formatter -> 'a -> unit) -> ?attrs_of_result:('b -> Opentelemetry.Span.key_value list) -> commitment_of_result:('b -> Tezos_crypto_dal.Cryptobox.Commitment.t) -> (unit -> ('b, 'a) Stdlib.result Lwt.t) -> ('b, 'a) Stdlib.result Lwt.t

trace_slot_after_es ~attrs ~name ?slot_index ?slot_id ~error_pp ?attrs_of_result ~commitment_of_result f allows to trace the application of f before the trace_id is known. The trace_id (commitment) is extracted from f result, as well as extra attributes by using the provided commitment_of_result and attrs_of_result functions.

WARNING: The span emitted within the function will NOT have this span as parent, but the current ambient scope.