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 ... end

Callbacks used for subscribers.

module Subscriber : sig ... end

Trace subscribers

module Span_tbl : sig ... end

A table that can be used to remember information about spans.

Main API

type t = Subscriber.t

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 collector : t -> Trace_core.collector

A collector that calls the subscriber's callbacks.

It uses mtime (if available) to obtain timestamps.

module Span_generator : sig ... end

A counter-based span generator.

module Trace_id_8B_generator : sig ... end

A counter-based trace ID generator, producing 8-byte trace IDs.