diff --git a/trace/Trace/index.html b/trace/Trace/index.html index 7d0d5dd..147db0c 100644 --- a/trace/Trace/index.html +++ b/trace/Trace/index.html @@ -1,5 +1,5 @@ -
Traceinclude module type of struct include Trace_core endUser defined data, generally passed as key/value pairs to whatever collector is installed (if any).
type explicit_span = Trace_core.explicit_span = {span : span;Identifier for this span. Several explicit spans might share the same identifier since we can differentiate between them via meta.
mutable meta : Trace_core.Meta_map.t;Metadata for this span (and its context). This can be used by collectors to carry collector-specific information from the beginning of the span, to the end of the span.
*)}Explicit span, with collector-specific metadata
module Collector = Trace_core.Collectormodule Meta_map = Trace_core.Meta_mapmodule Level = Trace_core.LevelIs there a collector?
This is fast, so that the traced program can check it before creating any span or message.
val get_default_level : unit -> Level.tCurrent default level for spans.
val set_default_level : Level.t -> unitSet level used for spans that do not specify it. The default default value is Level.Trace.
val with_span :
+Trace (trace.Trace) Module Trace
include module type of struct include Trace_core end
A bytestring representing a (possibly distributed) trace made of async spans. With opentelemetry this is 16 bytes.
User defined data, generally passed as key/value pairs to whatever collector is installed (if any).
A context, passed around for async traces.
type explicit_span = Trace_core.explicit_span = {span : span;(*Identifier for this span. Several explicit spans might share the same identifier since we can differentiate between them via meta.
*)trace_id : trace_id;(*The trace this belongs to
*)mutable meta : Trace_core.Meta_map.t;(*Metadata for this span (and its context). This can be used by collectors to carry collector-specific information from the beginning of the span, to the end of the span.
*)
}Explicit span, with collector-specific metadata. This is richer than explicit_span_ctx but not intended to be passed around (or sent across the wire), unlike explicit_span_ctx.
module Collector = Trace_core.Collectormodule Meta_map = Trace_core.Meta_mapmodule Level = Trace_core.LevelTracing
Is there a collector?
This is fast, so that the traced program can check it before creating any span or message.
val get_default_level : unit -> Level.tCurrent default level for spans.
val set_default_level : Level.t -> unitSet level used for spans that do not specify it. The default default value is Level.Trace.
val ctx_of_span : explicit_span -> explicit_span_ctxTurn a span into a span context.
val with_span :
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
@@ -7,14 +7,23 @@
?data:(unit -> (string * user_data) list) ->
string ->
(span -> 'a) ->
- 'awith_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.
This is the recommended way to instrument most code.
NOTE an important restriction is that this is only supposed to work for synchronous, direct style code. Monadic concurrency, Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, see enter_manual_span.
with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.
This is the recommended way to instrument most code.
NOTE an important restriction is that this is only supposed to work for synchronous, direct style code. Monadic concurrency, Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, see enter_manual_span.
val enter_span :
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- spanEnter a span manually.
val exit_span : span -> unitExit a span manually. This must run on the same thread as the corresponding enter_span, and spans must nest correctly.
Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.
val enter_manual_sub_span :
+ spanEnter a span manually.
val exit_span : span -> unitExit a span manually. This must run on the same thread as the corresponding enter_span, and spans must nest correctly.
Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.
val enter_manual_span :
+ parent:explicit_span_ctx option ->
+ ?flavor:[ `Sync | `Async ] ->
+ ?level:Level.t ->
+ ?__FUNCTION__:string ->
+ __FILE__:string ->
+ __LINE__:int ->
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ explicit_spanLike with_span but the caller is responsible for obtaining the parent span from their own caller, and carry the resulting explicit_span to the matching exit_manual_span.
NOTE this replaces enter_manual_sub_span and enter_manual_toplevel_span by just making parent an explicit option. It is breaking anyway because we now pass an explicit_span_ctx instead of a full explicit_span (the reason being that we might receive this explicit_span_ctx from another process or machine).
val enter_manual_sub_span :
parent:explicit_span ->
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
@@ -23,7 +32,7 @@
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- explicit_spanLike with_span but the caller is responsible for obtaining the parent span from their own caller, and carry the resulting explicit_span to the matching exit_manual_span.
val enter_manual_toplevel_span :
+ explicit_spanval enter_manual_toplevel_span :
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
?__FUNCTION__:string ->
@@ -31,7 +40,7 @@
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- explicit_spanLike with_span but the caller is responsible for carrying this explicit_span around until it's exited with exit_manual_span. The span can be used as a parent in enter_manual_sub_span.
val exit_manual_span : explicit_span -> unitExit an explicit span. This can be on another thread, in a fiber or lightweight thread, etc. and will be supported by backends nonetheless. The span can be obtained via enter_manual_sub_span or enter_manual_toplevel_span.
val add_data_to_manual_span :
+ explicit_spanval exit_manual_span : explicit_span -> unitExit an explicit span. This can be on another thread, in a fiber or lightweight thread, etc. and will be supported by backends nonetheless. The span can be obtained via enter_manual_sub_span or enter_manual_toplevel_span.
val add_data_to_manual_span :
explicit_span ->
(string * user_data) list ->
unitadd_data_explicit esp data adds data to the span esp. The behavior is not specified is the span has been exited already.
val message :
diff --git a/trace/Trace_core/Collector/index.html b/trace/Trace_core/Collector/index.html
index 67608dc..d93b06a 100644
--- a/trace/Trace_core/Collector/index.html
+++ b/trace/Trace_core/Collector/index.html
@@ -1,2 +1,2 @@
-Collector (trace.Trace_core.Collector) Module Trace_core.Collector
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.
module type S = sig ... endSignature for a collector.
+Collector (trace.Trace_core.Collector) Module Trace_core.Collector
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.
module type S = sig ... endSignature for a collector.
diff --git a/trace/Trace_core/Collector/module-type-S/index.html b/trace/Trace_core/Collector/module-type-S/index.html
index 1832e1d..d0dc1f2 100644
--- a/trace/Trace_core/Collector/module-type-S/index.html
+++ b/trace/Trace_core/Collector/module-type-S/index.html
@@ -13,7 +13,7 @@
list ->
string ->
(int64 -> 'a) ->
- 'aRun 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.
val enter_span :
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
@@ -27,7 +27,7 @@
list ->
string ->
int64Enter a new implicit span. For many uses cases, with_span will be easier to use.
Exit span. This should be called on the same thread as the corresponding enter_span, and nest properly with other calls to enter/exit_span and with_span.
val enter_manual_span :
- parent:Trace_core__.Types.explicit_span option ->
+ parent:Trace_core__.Types.explicit_span_ctx option ->
flavor:[ `Sync | `Async ] option ->
__FUNCTION__:string option ->
__FILE__:string ->
@@ -41,7 +41,7 @@
| `None ])
list ->
string ->
- Trace_core__.Types.explicit_spanEnter 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.
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.
NOTE the parent argument is now an explicit_span_ctx and not an explicit_span since 0.10.
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.
val add_data_to_span :
int64 ->
(string
* [ `Int of int
diff --git a/trace/Trace_core/index.html b/trace/Trace_core/index.html
index 7ce42cd..21b6300 100644
--- a/trace/Trace_core/index.html
+++ b/trace/Trace_core/index.html
@@ -1,5 +1,5 @@
-Trace_core (trace.Trace_core) Module Trace_core
Trace.
User defined data, generally passed as key/value pairs to whatever collector is installed (if any).
type explicit_span = {span : span;(*Identifier for this span. Several explicit spans might share the same identifier since we can differentiate between them via meta.
*)mutable meta : Meta_map.t;(*Metadata for this span (and its context). This can be used by collectors to carry collector-specific information from the beginning of the span, to the end of the span.
*)
}Explicit span, with collector-specific metadata
module Collector : sig ... endA global collector.
module Meta_map : sig ... endmodule Level : sig ... endTracing levels.
Tracing
Is there a collector?
This is fast, so that the traced program can check it before creating any span or message.
val get_default_level : unit -> Level.tCurrent default level for spans.
val set_default_level : Level.t -> unitSet level used for spans that do not specify it. The default default value is Level.Trace.
val with_span :
+Trace_core (trace.Trace_core) Module Trace_core
Trace.
A bytestring representing a (possibly distributed) trace made of async spans. With opentelemetry this is 16 bytes.
User defined data, generally passed as key/value pairs to whatever collector is installed (if any).
type explicit_span = {span : span;(*Identifier for this span. Several explicit spans might share the same identifier since we can differentiate between them via meta.
*)trace_id : trace_id;(*The trace this belongs to
*)mutable meta : Meta_map.t;(*Metadata for this span (and its context). This can be used by collectors to carry collector-specific information from the beginning of the span, to the end of the span.
*)
}Explicit span, with collector-specific metadata. This is richer than explicit_span_ctx but not intended to be passed around (or sent across the wire), unlike explicit_span_ctx.
module Collector : sig ... endA global collector.
module Meta_map : sig ... endmodule Level : sig ... endTracing levels.
Tracing
Is there a collector?
This is fast, so that the traced program can check it before creating any span or message.
val get_default_level : unit -> Level.tCurrent default level for spans.
val set_default_level : Level.t -> unitSet level used for spans that do not specify it. The default default value is Level.Trace.
val ctx_of_span : explicit_span -> explicit_span_ctxTurn a span into a span context.
val with_span :
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
@@ -7,14 +7,23 @@
?data:(unit -> (string * user_data) list) ->
string ->
(span -> 'a) ->
- 'awith_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.
This is the recommended way to instrument most code.
NOTE an important restriction is that this is only supposed to work for synchronous, direct style code. Monadic concurrency, Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, see enter_manual_span.
with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.
This is the recommended way to instrument most code.
NOTE an important restriction is that this is only supposed to work for synchronous, direct style code. Monadic concurrency, Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, see enter_manual_span.
val enter_span :
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- spanEnter a span manually.
val exit_span : span -> unitExit a span manually. This must run on the same thread as the corresponding enter_span, and spans must nest correctly.
Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.
val enter_manual_sub_span :
+ spanEnter a span manually.
val exit_span : span -> unitExit a span manually. This must run on the same thread as the corresponding enter_span, and spans must nest correctly.
Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.
val enter_manual_span :
+ parent:explicit_span_ctx option ->
+ ?flavor:[ `Sync | `Async ] ->
+ ?level:Level.t ->
+ ?__FUNCTION__:string ->
+ __FILE__:string ->
+ __LINE__:int ->
+ ?data:(unit -> (string * user_data) list) ->
+ string ->
+ explicit_spanLike with_span but the caller is responsible for obtaining the parent span from their own caller, and carry the resulting explicit_span to the matching exit_manual_span.
NOTE this replaces enter_manual_sub_span and enter_manual_toplevel_span by just making parent an explicit option. It is breaking anyway because we now pass an explicit_span_ctx instead of a full explicit_span (the reason being that we might receive this explicit_span_ctx from another process or machine).
val enter_manual_sub_span :
parent:explicit_span ->
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
@@ -23,7 +32,7 @@
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- explicit_spanLike with_span but the caller is responsible for obtaining the parent span from their own caller, and carry the resulting explicit_span to the matching exit_manual_span.
val enter_manual_toplevel_span :
+ explicit_spanval enter_manual_toplevel_span :
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
?__FUNCTION__:string ->
@@ -31,7 +40,7 @@
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
- explicit_spanLike with_span but the caller is responsible for carrying this explicit_span around until it's exited with exit_manual_span. The span can be used as a parent in enter_manual_sub_span.
val exit_manual_span : explicit_span -> unitExit an explicit span. This can be on another thread, in a fiber or lightweight thread, etc. and will be supported by backends nonetheless. The span can be obtained via enter_manual_sub_span or enter_manual_toplevel_span.
val add_data_to_manual_span :
+ explicit_spanval exit_manual_span : explicit_span -> unitExit an explicit span. This can be on another thread, in a fiber or lightweight thread, etc. and will be supported by backends nonetheless. The span can be obtained via enter_manual_sub_span or enter_manual_toplevel_span.
val add_data_to_manual_span :
explicit_span ->
(string * user_data) list ->
unitadd_data_explicit esp data adds data to the span esp. The behavior is not specified is the span has been exited already.
val message :
diff --git a/trace/Trace_event/Event/index.html b/trace/Trace_event/Event/index.html
new file mode 100644
index 0000000..47a5dab
--- /dev/null
+++ b/trace/Trace_event/Event/index.html
@@ -0,0 +1,2 @@
+
+Event (trace.Trace_event.Event) Module Trace_event.Event
Events.
Each callback in a subscriber corresponds to an event, which can be for example queued somewhere or batched for further processing.
module Sub = Trace_subscribertype t = | E_tick| E_init of {}| E_shutdown of {}| E_message of {tid : int;msg : string;time_ns : int64;data : (string * Sub.user_data) list;
}| E_define_span of {tid : int;name : string;time_ns : int64;id : Trace_core.span;fun_name : string option;data : (string * Sub.user_data) list;
}| E_exit_span of {id : Trace_core.span;time_ns : int64;
}| E_add_data of {id : Trace_core.span;data : (string * Sub.user_data) list;
}| E_enter_manual_span of {tid : int;name : string;time_ns : int64;id : Trace_core.trace_id;flavor : Sub.flavor option;fun_name : string option;data : (string * Sub.user_data) list;
}| E_exit_manual_span of {tid : int;name : string;time_ns : int64;flavor : Sub.flavor option;data : (string * Sub.user_data) list;id : Trace_core.trace_id;
}| E_counter of {}| E_name_process of {}| E_name_thread of {}| E_extension_event of {tid : int;time_ns : int64;ext : Trace_core.extension_event;
}
An event with TEF/fuchsia semantics
diff --git a/trace/Trace_event/Subscriber/Callbacks/index.html b/trace/Trace_event/Subscriber/Callbacks/index.html
new file mode 100644
index 0000000..8161d9c
--- /dev/null
+++ b/trace/Trace_event/Subscriber/Callbacks/index.html
@@ -0,0 +1,57 @@
+
+Callbacks (trace.Trace_event.Subscriber.Callbacks) Module Subscriber.Callbacks
type st = event_consumerType of the state passed to every callback.
val on_init : st -> time_ns:int64 -> unitCalled when the subscriber is initialized in a collector
val on_shutdown : st -> time_ns:int64 -> unitCalled when the collector is shutdown
val on_name_thread : st -> time_ns:int64 -> tid:int -> name:string -> unitCurrent thread is being named
val on_name_process : st -> time_ns:int64 -> tid:int -> name:string -> unitCurrent process is being named
val on_enter_span :
+ st ->
+ __FUNCTION__:string option ->
+ __FILE__:string ->
+ __LINE__:int ->
+ time_ns:int64 ->
+ tid:int ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ name:string ->
+ Trace_core.span ->
+ unitEnter a regular (sync) span
val on_exit_span : st -> time_ns:int64 -> tid:int -> Trace_core.span -> unitExit a span. This and on_enter_span must follow strict stack discipline
val on_add_data :
+ st ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ Trace_core.span ->
+ unitAdd data to a regular span (which must be active)
val on_message :
+ st ->
+ time_ns:int64 ->
+ tid:int ->
+ span:Trace_core.span option ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ string ->
+ unitEmit a log message
val on_counter :
+ st ->
+ time_ns:int64 ->
+ tid:int ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ name:string ->
+ float ->
+ unitEmit the current value of a counter
val on_enter_manual_span :
+ st ->
+ __FUNCTION__:string option ->
+ __FILE__:string ->
+ __LINE__:int ->
+ time_ns:int64 ->
+ tid:int ->
+ parent:Trace_core.span option ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ name:string ->
+ flavor:Trace_subscriber__.Types.flavor option ->
+ trace_id:Trace_core.trace_id ->
+ Trace_core.span ->
+ unitEnter a manual (possibly async) span
val on_exit_manual_span :
+ st ->
+ time_ns:int64 ->
+ tid:int ->
+ name:string ->
+ data:(string * Trace_subscriber__.Types.user_data) list ->
+ flavor:Trace_subscriber__.Types.flavor option ->
+ trace_id:Trace_core.trace_id ->
+ Trace_core.span ->
+ unitExit a manual span
val on_extension_event :
+ st ->
+ time_ns:int64 ->
+ tid:int ->
+ Trace_core.extension_event ->
+ unitExtension event
diff --git a/trace/Trace_event/Subscriber/index.html b/trace/Trace_event/Subscriber/index.html
new file mode 100644
index 0000000..136d5a2
--- /dev/null
+++ b/trace/Trace_event/Subscriber/index.html
@@ -0,0 +1,3 @@
+
+Subscriber (trace.Trace_event.Subscriber) Module Trace_event.Subscriber
Subscriber that emits events
Callback for events.
module Callbacks :
+ Trace_event.Event.Sub.Callbacks.S with type st = event_consumerval subscriber : event_consumer -> Trace_event.Event.Sub.tA subscriber that turns calls into events that are passed to the event_consumer
diff --git a/trace/Trace_event/index.html b/trace/Trace_event/index.html
new file mode 100644
index 0000000..80e2ecf
--- /dev/null
+++ b/trace/Trace_event/index.html
@@ -0,0 +1,2 @@
+
+Trace_event (trace.Trace_event) Module Trace_event
module Event : sig ... endEvents.
module Subscriber : sig ... endSubscriber that emits events
diff --git a/trace/Trace_event__Event/index.html b/trace/Trace_event__Event/index.html
new file mode 100644
index 0000000..b6714db
--- /dev/null
+++ b/trace/Trace_event__Event/index.html
@@ -0,0 +1,2 @@
+
+Trace_event__Event (trace.Trace_event__Event) Module Trace_event__Event
This module is hidden.
diff --git a/trace/Trace_subscriber__Time_/index.html b/trace/Trace_event__Subscriber/index.html
similarity index 68%
rename from trace/Trace_subscriber__Time_/index.html
rename to trace/Trace_event__Subscriber/index.html
index 7ca588f..a15af02 100644
--- a/trace/Trace_subscriber__Time_/index.html
+++ b/trace/Trace_event__Subscriber/index.html
@@ -1,2 +1,2 @@
-Trace_subscriber__Time_ (trace.Trace_subscriber__Time_) Module Trace_subscriber__Time_
This module is hidden.
+Trace_event__Subscriber (trace.Trace_event__Subscriber) Module Trace_event__Subscriber
This module is hidden.
diff --git a/trace/Trace_private_util/B_queue/index.html b/trace/Trace_private_util/B_queue/index.html
deleted file mode 100644
index 4029a41..0000000
--- a/trace/Trace_private_util/B_queue/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-B_queue (trace.Trace_private_util.B_queue) Module Trace_private_util.B_queue
Basic Blocking Queue
val create : unit -> _ tval push : 'a t -> 'a -> unitpush q x pushes x into q, and returns ().
val pop_all : 'a t -> 'a listpop_all bq returns all items presently in bq, in the same order, and clears bq. It blocks if no element is in bq.
val close : _ t -> unitClose the queue, meaning there won't be any more push allowed.
diff --git a/trace/Trace_private_util/Mpsc_bag/index.html b/trace/Trace_private_util/Mpsc_bag/index.html
deleted file mode 100644
index 2574922..0000000
--- a/trace/Trace_private_util/Mpsc_bag/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Mpsc_bag (trace.Trace_private_util.Mpsc_bag) Module Trace_private_util.Mpsc_bag
A multi-producer, single-consumer bag
val create : unit -> 'a tval add : 'a t -> 'a -> unitadd q x adds x in the bag.
val pop_all : 'a t -> 'a list optionReturn all current items in the insertion order.
diff --git a/trace/Trace_private_util/Rpool/index.html b/trace/Trace_private_util/Rpool/index.html
new file mode 100644
index 0000000..d80e198
--- /dev/null
+++ b/trace/Trace_private_util/Rpool/index.html
@@ -0,0 +1,7 @@
+
+Rpool (trace.Trace_private_util.Rpool) Module Trace_private_util.Rpool
A resource pool (for buffers)
val create :
+ max_size:int ->
+ create:(unit -> 'a) ->
+ clear:('a -> unit) ->
+ unit ->
+ 'a tval alloc : 'a t -> 'aval recycle : 'a t -> 'a -> unitval with_ : 'a t -> ('a -> 'b) -> 'b
diff --git a/trace/Trace_private_util/index.html b/trace/Trace_private_util/index.html
index 0b5f08c..cdd5a02 100644
--- a/trace/Trace_private_util/index.html
+++ b/trace/Trace_private_util/index.html
@@ -1,2 +1,2 @@
-Trace_private_util (trace.Trace_private_util) Module Trace_private_util
module B_queue : sig ... endBasic Blocking Queue
module Domain_util : sig ... endmodule Mpsc_bag : sig ... endA multi-producer, single-consumer bag
+Trace_private_util (trace.Trace_private_util) Module Trace_private_util
module Domain_util : sig ... endmodule Rpool : sig ... endA resource pool (for buffers)
diff --git a/trace/Trace_private_util__B_queue/index.html b/trace/Trace_private_util__B_queue/index.html
deleted file mode 100644
index 35c56c3..0000000
--- a/trace/Trace_private_util__B_queue/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Trace_private_util__B_queue (trace.Trace_private_util__B_queue) Module Trace_private_util__B_queue
This module is hidden.
diff --git a/trace/Trace_private_util__Mpsc_bag/index.html b/trace/Trace_private_util__Mpsc_bag/index.html
deleted file mode 100644
index 92b91fa..0000000
--- a/trace/Trace_private_util__Mpsc_bag/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Trace_private_util__Mpsc_bag (trace.Trace_private_util__Mpsc_bag) Module Trace_private_util__Mpsc_bag
This module is hidden.
diff --git a/trace/Trace_subscriber__Thread_/index.html b/trace/Trace_private_util__Rpool/index.html
similarity index 68%
rename from trace/Trace_subscriber__Thread_/index.html
rename to trace/Trace_private_util__Rpool/index.html
index d39c918..c1cd864 100644
--- a/trace/Trace_subscriber__Thread_/index.html
+++ b/trace/Trace_private_util__Rpool/index.html
@@ -1,2 +1,2 @@
-Trace_subscriber__Thread_ (trace.Trace_subscriber__Thread_) Module Trace_subscriber__Thread_
This module is hidden.
+Trace_private_util__Rpool (trace.Trace_private_util__Rpool) Module Trace_private_util__Rpool
This module is hidden.
diff --git a/trace/Trace_subscriber/Callbacks/Dummy/index.html b/trace/Trace_subscriber/Callbacks/Dummy/index.html
index 3714f06..461dd6c 100644
--- a/trace/Trace_subscriber/Callbacks/Dummy/index.html
+++ b/trace/Trace_subscriber/Callbacks/Dummy/index.html
@@ -1,5 +1,9 @@
-Dummy (trace.Trace_subscriber.Callbacks.Dummy) Module Callbacks.Dummy
Dummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle all events, but only some of them.
val on_enter_span :
+Dummy (trace.Trace_subscriber.Callbacks.Dummy) Module Callbacks.Dummy
Dummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle all events, but only some of them.
To write a subscriber that only supports some callbacks, this can be handy:
module My_callbacks = struct
+ type st = my_own_state
+ include Callbacks.Dummy
+ let on_counter (st:st) ~time_ns ~tid ~data ~name v : unit = ...
+ end
val on_enter_span :
'a ->
__FUNCTION__:'b ->
__FILE__:'c ->
diff --git a/trace/Trace_subscriber/Callbacks/index.html b/trace/Trace_subscriber/Callbacks/index.html
index 85a4f8b..4f2155f 100644
--- a/trace/Trace_subscriber/Callbacks/index.html
+++ b/trace/Trace_subscriber/Callbacks/index.html
@@ -1,10 +1,10 @@
-Callbacks (trace.Trace_subscriber.Callbacks) Module Trace_subscriber.Callbacks
Callbacks used for subscribers.
Each subscriber defines a set of callbacks, for each possible tracing event. These callbacks take a custom state that is paired with the callbacks in Subscriber.t.
To use a default implementation for some callbacks, use:
module My_callbacks = struct
- type st = …
+Callbacks (trace.Trace_subscriber.Callbacks) Module Trace_subscriber.Callbacks
Callbacks used for subscribers.
Each subscriber defines a set of callbacks, for each possible tracing event. These callbacks take a custom state that is paired with the callbacks in Subscriber.t.
To use a default implementation for some callbacks, use:
module My_callbacks = struct
+ type st = …
- include Trace_subscriber.Callbacks.Dummy
+ include Trace_subscriber.Callbacks.Dummy
- let on_init (state:st) ~time_ns : unit = …
+ let on_init (state:st) ~time_ns : unit = …
- (* … other custom callbacks … *)
-end
module type S = sig ... endFirst class module signature for callbacks
Callbacks for a subscriber. There is one callback per event in Trace. The type 'st is the state that is passed to every single callback.
module Dummy : sig ... endDummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle all events, but only some of them.
val dummy : unit -> 'st tDummy callbacks, ignores all events.
+ (* … other custom callbacks … *)
+ end
NOTE: the trace_id passed alongside manual spans is guaranteed to be at least 64 bits.
module type S = sig ... endFirst class module signature for callbacks
Callbacks for a subscriber. There is one callback per event in Trace. The type 'st is the state that is passed to every single callback.
module Dummy : sig ... endDummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle all events, but only some of them.
val dummy : unit -> 'st tDummy callbacks, ignores all events.
diff --git a/trace/Trace_subscriber/Callbacks/module-type-S/index.html b/trace/Trace_subscriber/Callbacks/module-type-S/index.html
index eda25eb..e799c94 100644
--- a/trace/Trace_subscriber/Callbacks/module-type-S/index.html
+++ b/trace/Trace_subscriber/Callbacks/module-type-S/index.html
@@ -1,28 +1,28 @@
-S (trace.Trace_subscriber.Callbacks.S) Module type Callbacks.S
First class module signature for callbacks
val on_init : st -> time_ns:float -> unitCalled when the subscriber is initialized in a collector
val on_shutdown : st -> time_ns:float -> unitCalled when the collector is shutdown
val on_name_thread : st -> time_ns:float -> tid:int -> name:string -> unitCurrent thread is being named
val on_name_process : st -> time_ns:float -> tid:int -> name:string -> unitCurrent process is being named
val on_enter_span :
+S (trace.Trace_subscriber.Callbacks.S) Module type Callbacks.S
First class module signature for callbacks
val on_init : st -> time_ns:int64 -> unitCalled when the subscriber is initialized in a collector
val on_shutdown : st -> time_ns:int64 -> unitCalled when the collector is shutdown
val on_name_thread : st -> time_ns:int64 -> tid:int -> name:string -> unitCurrent thread is being named
val on_name_process : st -> time_ns:int64 -> tid:int -> name:string -> unitCurrent process is being named
val on_enter_span :
st ->
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
data:(string * Trace_subscriber__.Types.user_data) list ->
name:string ->
Trace_core.span ->
- unitEnter a regular (sync) span
val on_exit_span : st -> time_ns:float -> tid:int -> Trace_core.span -> unitExit a span. This and on_enter_span must follow strict stack discipline
val on_exit_span : st -> time_ns:int64 -> tid:int -> Trace_core.span -> unitExit a span. This and on_enter_span must follow strict stack discipline
val on_add_data :
st ->
data:(string * Trace_subscriber__.Types.user_data) list ->
Trace_core.span ->
unitAdd data to a regular span (which must be active)
val on_message :
st ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
span:Trace_core.span option ->
data:(string * Trace_subscriber__.Types.user_data) list ->
string ->
unitEmit a log message
val on_counter :
st ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
data:(string * Trace_subscriber__.Types.user_data) list ->
name:string ->
@@ -32,26 +32,26 @@
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
parent:Trace_core.span option ->
data:(string * Trace_subscriber__.Types.user_data) list ->
name:string ->
flavor:Trace_subscriber__.Types.flavor option ->
- trace_id:int ->
+ trace_id:Trace_core.trace_id ->
Trace_core.span ->
unitEnter a manual (possibly async) span
val on_exit_manual_span :
st ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
name:string ->
data:(string * Trace_subscriber__.Types.user_data) list ->
flavor:Trace_subscriber__.Types.flavor option ->
- trace_id:int ->
+ trace_id:Trace_core.trace_id ->
Trace_core.span ->
unitExit a manual span
val on_extension_event :
st ->
- time_ns:float ->
+ time_ns:int64 ->
tid:int ->
Trace_core.extension_event ->
unitExtension event
diff --git a/trace/Trace_subscriber/Span_tbl/index.html b/trace/Trace_subscriber/Span_tbl/index.html
new file mode 100644
index 0000000..287f718
--- /dev/null
+++ b/trace/Trace_subscriber/Span_tbl/index.html
@@ -0,0 +1,2 @@
+
+Span_tbl (trace.Trace_subscriber.Span_tbl) Module Trace_subscriber.Span_tbl
A table that can be used to remember information about spans.
This is convenient when we want to rememner information from a span begin, when dealing with the corresponding span end.
NOTE: this is thread safe when threads are enabled.
val create : unit -> 'v tval add : 'v t -> Trace_core.span -> 'v -> unitval find_exn : 'v t -> Trace_core.span -> 'vval remove : _ t -> Trace_core.span -> unitRemove the span if present
val to_list : 'v t -> (Trace_core.span * 'v) list
diff --git a/trace/Trace_subscriber/Subscriber/index.html b/trace/Trace_subscriber/Subscriber/index.html
index df09ab3..54d252b 100644
--- a/trace/Trace_subscriber/Subscriber/index.html
+++ b/trace/Trace_subscriber/Subscriber/index.html
@@ -1,2 +1,2 @@
-Subscriber (trace.Trace_subscriber.Subscriber) Module Trace_subscriber.Subscriber
Trace subscribers
A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).
The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.
val dummy : tDummy subscriber that ignores every call.
+Subscriber (trace.Trace_subscriber.Subscriber) Module Trace_subscriber.Subscriber
Trace subscribers
A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).
The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.
val dummy : tDummy subscriber that ignores every call.
Tee multiple subscribers, ie return a subscriber that forwards to all the subscribers in subs.
diff --git a/trace/Trace_subscriber/index.html b/trace/Trace_subscriber/index.html
index e9ef98d..8cbc714 100644
--- a/trace/Trace_subscriber/index.html
+++ b/trace/Trace_subscriber/index.html
@@ -1,2 +1,2 @@
-Trace_subscriber (trace.Trace_subscriber) Module Trace_subscriber
Generic subscribers.
This defines the notion of a subscriber, a set of callbacks for every trace event. It also defines a collector that needs to be installed for the subscriber(s) to be called.
module Callbacks : sig ... endCallbacks used for subscribers.
module Subscriber : sig ... endTrace subscribers
Main API
type t = Subscriber.tval collector : t -> Trace_core.collectorA collector that calls the subscriber's callbacks.
It uses mtime (if available) to obtain timestamps.
+Trace_subscriber (trace.Trace_subscriber) Module Trace_subscriber
Generic subscribers.
This defines the notion of a subscriber, a set of callbacks for every trace event. It also defines a collector that needs to be installed for the subscriber(s) to be called.
Thanks to Subscriber.tee_l it's possible to combine multiple subscribers into a single collector.
module Callbacks : sig ... endCallbacks used for subscribers.
module Subscriber : sig ... endTrace subscribers
module Span_tbl : sig ... endA table that can be used to remember information about spans.
Main API
type t = Subscriber.tA trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).
The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.
val collector : t -> Trace_core.collectorA collector that calls the subscriber's callbacks.
It uses mtime (if available) to obtain timestamps.
diff --git a/trace/Trace_subscriber__Span_tbl/index.html b/trace/Trace_subscriber__Span_tbl/index.html
new file mode 100644
index 0000000..b6edf00
--- /dev/null
+++ b/trace/Trace_subscriber__Span_tbl/index.html
@@ -0,0 +1,2 @@
+
+Trace_subscriber__Span_tbl (trace.Trace_subscriber__Span_tbl) Module Trace_subscriber__Span_tbl
This module is hidden.
diff --git a/trace/_doc-dir/CHANGES.md b/trace/_doc-dir/CHANGES.md
index dd9ae4f..55db48f 100644
--- a/trace/_doc-dir/CHANGES.md
+++ b/trace/_doc-dir/CHANGES.md
@@ -1,3 +1,22 @@
+# 0.10
+
+- breaking: manual spans now take a `explicit_span_ctx` as parent, that
+ can potentially be transmitted across processes/machines. It also
+ is intended to be more compatible with OTEL.
+- breaking `trace.subscriber`: timestamps are `int64`ns now, not floats
+- breaking `trace`: pass a `string` trace_id in manual spans, which helps
+ for backends such as opentelemetry. It's also useful for extensions.
+
+- refactor `trace-fuchsia`: full revamp of the library, modularized, using subscriber API
+- refactor `trace-tef`: split into exporter,writer,subscriber, using subscriber API
+- feat: add `trace.event`, useful for background threads
+- feat `trace.subscriber`: add `Span_tbl`, and a depopt on picos_aux
+- feat `trace.subscriber`: tee a whole array at once
+- feat tef-tldrs: use EMIT_TEF_AT_EXIT
+- feat `trace.subscriber`: depopt on unix for timestamps
+- refactor `trace-tef`: depopt on unix for TEF timestamps
+
+
# 0.9.1
diff --git a/trace/index.html b/trace/index.html
index ddfa448..14ad45a 100644
--- a/trace/index.html
+++ b/trace/index.html
@@ -1,2 +1,2 @@
-index (trace.index) Package trace
Trace Trace_core Trace.Trace_private_util Trace_subscriber Generic subscribers.
+index (trace.index) Package trace
Trace Trace_core Trace.Trace_event Trace_private_util Trace_subscriber Generic subscribers.