Collector.S
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.
val with_span :
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
(int64 -> 'a) ->
'a
Run the function in a new span.
val enter_span :
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
int64
Enter 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_ctx option ->
flavor:[ `Sync | `Async ] option ->
__FUNCTION__:string option ->
__FILE__:string ->
__LINE__:int ->
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
Trace_core__.Types.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
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
unit
0.4
val add_data_to_manual_span :
Trace_core__.Types.explicit_span ->
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
unit
Adds data to the given span.
val message :
?span:int64 ->
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
unit
Emit a message with associated metadata.
val counter_int :
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
int ->
unit
Integer counter.
val counter_float :
data:
(string
* [ `Int of int
| `String of string
| `Bool of bool
| `Float of float
| `None ])
list ->
string ->
float ->
unit
Float counter.
Handle an extension event. A collector MUST simple ignore events it doesn't know, and return ()
silently.