Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file collector.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105(** 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.
*)openTypesletdummy_span:span=Int64.min_intletdummy_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. *)moduletypeS=sigvalwith_span:__FUNCTION__:stringoption->__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 *)valenter_span:__FUNCTION__:stringoption->__FILE__:string->__LINE__:int->data:(string*user_data)list->string->span(** Enter a new implicit span. For many uses cases, {!with_span} will
be easier to use.
@since 0.6 *)valexit_span:span->unit(** 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}.
@since 0.6 *)valenter_manual_span:parent:explicit_spanoption->flavor:[`Sync|`Async]option->__FUNCTION__:stringoption->__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 *)valexit_manual_span:explicit_span->unit(** Exit an explicit span.
@since 0.3 *)valadd_data_to_span:span->(string*user_data)list->unit(** @since Adds data to the current span.
0.4 *)valadd_data_to_manual_span:explicit_span->(string*user_data)list->unit(** Adds data to the given span.
@since 0.4 *)valmessage:?span:span->data:(string*user_data)list->string->unit(** Emit a message with associated metadata. *)valname_thread:string->unit(** Give a name to the current thread. *)valname_process:string->unit(** Give a name to the current process. *)valcounter_int:data:(string*user_data)list->string->int->unit(** Integer counter. *)valcounter_float:data:(string*user_data)list->string->float->unit(** Float counter. *)valextension_event:extension_event->unit(** Handle an extension event.
A collector {b MUST} simple ignore events it doesn't know,
and return [()] silently.
@since 0.8 *)valshutdown:unit->unit(** Shutdown collector, possibly waiting for it to finish sending data. *)end