Module Imandrakit_log.Trace_async

module Trace = Trace_core
type span_kind =
  1. | SK_client
  2. | SK_server
  3. | SK_internal
  4. | SK_producer
  5. | SK_consumer

Inspired from OTEL

val equal_span_kind : span_kind -> span_kind -> Ppx_deriving_runtime.bool
val span_kind_of_twine_ref : (Imandrakit_twine.Decode.t -> int -> span_kind) ref
val span_kind_of_twine : Imandrakit_twine.Decode.t -> int -> span_kind
val show_span_kind : span_kind -> Ppx_deriving_runtime.string

Link the given span to the given context

val set_span_kind : Trace.span -> span_kind -> unit

Current parent scope for async spans

val add_exn_to_span : is_error:bool -> Trace.span -> exn -> Stdlib.Printexc.raw_backtrace -> unit

Record exception in the span

val push_async_parent : Trace.explicit_span_ctx -> unit
val pop_async_parent : Trace.explicit_span_ctx -> unit
val with_async_parent : Trace.explicit_span_ctx -> (unit -> 'a) -> 'a
val with_span : ?level:Trace.Level.t -> ?parent:Trace.explicit_span_ctx -> ?data:(unit -> (string * Trace.user_data) list) -> ?__FUNCTION__:string -> __FILE__:string -> __LINE__:int -> string -> ((Trace.explicit_span * Trace.explicit_span_ctx) -> 'a) -> 'a

Wrap f() in a async span.

val enrich_span_service : ?version:string -> Trace.explicit_span -> unit
val enrich_span_deployment : ?id:string -> ?name:string -> deployment:string -> Trace.explicit_span -> unit
val add_auto_enrich_span : (Trace.explicit_span -> unit) -> unit

Add a hook that will be called on every explicit span