package trace
A stub for tracing/observability, agnostic in how data is collected
Install
Dune Dependency
Authors
Maintainers
Sources
trace-0.4.tbz
sha256=b51ec546ec1c90f6ed60b330ea7c9212d5c9c26e4d93e38e60224d984fab09b1
sha512=dc617857b0f213765b82b45281ebef2fab4b8c213597f19cf4476356e2c7295c3aeb0d71c8d1954617196d7c491336efba1c67f02138d011ac590053c06ed638
doc/src/trace.core/collector.ml.html
Source file collector.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
(** A global collector. The collector, if present, is responsible for collecting messages and spans, and storing them, recording them, forward them, or offering them to other services and processes. *) open Types let dummy_span : span = Int64.min_int let dummy_explicit_span : explicit_span = { span = dummy_span; meta = Meta_map.empty } (** Signature for a collector. This is only relevant to implementors of tracing backends; to instrument your code you only need to look at the {!Trace} module. *) module type S = sig val with_span : __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> data:(string * user_data) list -> string -> (span -> 'a) -> 'a (** Run the function in a new span. This replaces the previous [enter_span] and [exit_span] which were too flexible to be efficient to implement in async contexts. @since 0.3 *) val enter_manual_span : parent:explicit_span option -> flavor:[ `Sync | `Async ] option -> __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> data:(string * user_data) list -> string -> explicit_span (** Enter an explicit span. Surrounding scope, if any, is provided by [parent], and this function can store as much metadata as it wants in the hmap in the {!explicit_span}'s [meta] field. This means that the collector doesn't need to implement contextual storage mapping {!span} to scopes, metadata, etc. on its side; everything can be transmitted in the {!explicit_span}. @since 0.3 *) val exit_manual_span : explicit_span -> unit (** Exit an explicit span. @since 0.3 *) val add_data_to_span : span -> (string * user_data) list -> unit (** @since Adds data to the current span. NEXT_RELEASE *) val add_data_to_manual_span : explicit_span -> (string * user_data) list -> unit (** Adds data to the given span. @since NEXT_RELEASE *) val message : ?span:span -> data:(string * user_data) list -> string -> unit (** Emit a message with associated metadata. *) val name_thread : string -> unit (** Give a name to the current thread. *) val name_process : string -> unit (** Give a name to the current process. *) val counter_int : data:(string * user_data) list -> string -> int -> unit (** Integer counter. *) val counter_float : data:(string * user_data) list -> string -> float -> unit (** Float counter. *) val shutdown : unit -> unit (** Shutdown collector, possibly waiting for it to finish sending data. *) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>