package trace

  1. Overview
  2. Docs
A stub for tracing/observability, agnostic in how data is collected

Install

Dune Dependency

Authors

Maintainers

Sources

trace-0.9.tbz
sha256=1a8c75efea8a691f1e0fa3dcf59ee0bf53fad7190b9fa0babde4f9a21bc10dd6
sha512=a082b3cbf34631069855bef7b8cf5017daf08141f8794dc0ef963e7afe0812749c388553fa3d21ecb35ce75909571dfd8fc38bcc4438b7eaaa9010296f28e2fc

doc/trace.subscriber/Trace_subscriber/Callbacks/index.html

Module Trace_subscriber.CallbacksSource

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

  let on_init (state:st) ~time_ns : unit = …

  (* … other custom callbacks … *)
end 
Sourcemodule type S = sig ... end

First class module signature for callbacks

Sourcetype 'st t = (module S with type st = 'st)

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.

Sourcemodule Dummy : sig ... end

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.

Sourceval dummy : unit -> 'st t

Dummy callbacks, ignores all events.

OCaml

Innovation. Community. Security.