Opentelemetry_emitter.EmitterEmitters.
This is the composable abstraction we use to represent how signals are emitted, from their origin point (a site in user code or library code that was instrumented, and just created a span or log record or metric), down to the actual SDK exporter installed in the application.
type -'a t = {signal_name : string;Description of what signal is emitted
*)enabled : unit -> bool;Return true if emit has a chance of doing something with the signals it's given.
emit : 'a list -> unit;Emit signals.
*)tick : mtime:Mtime.t -> unit;Call regularly to ensure background work is done. The current monotonic timestamp is passed to improve testability.
*)closed : unit -> bool;True if the emitter is already closed. Beware TOCTOU bugs.
*)flush_and_close : unit -> unit;Flush internally buffered signals, then close.
*)self_metrics : now:Opentelemetry_util.Timestamp_ns.t ->
unit ->
Opentelemetry_proto.Metrics.metric list;metrics about the emitter itself.
*)}An emitter for values of type 'a.
val enabled : 'a t -> boolval emit : 'a t -> 'a list -> unitval closed : 'a t -> boolval flush_and_close : 'a t -> unitval self_metrics :
'a t ->
now:Opentelemetry_util.Timestamp_ns.t ->
Opentelemetry_proto.Metrics.metric listmap f emitter returns a new emitter that applies f to signals item-wise before passing them to emitter
map_l f emitter applies f to incoming lists of signals, and emits the resulting list (if non empty)
val make :
?tick:(mtime:Mtime.t -> unit) ->
?closed:(unit -> bool) ->
?enabled:(unit -> bool) ->
?flush_and_close:(unit -> unit) ->
?self_metrics:
(now:Opentelemetry_util.Timestamp_ns.t ->
unit ->
Opentelemetry_proto.Metrics.metric list) ->
signal_name:string ->
emit:('a list -> unit) ->
unit ->
'a tmake ~emit () is an emitter that calls emit.
val dummy : 'a tDummy emitter, doesn't accept or emit anything.