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/Subscriber/index.html

Module Trace_subscriber.SubscriberSource

Trace subscribers

Sourcetype t =
  1. | Sub : {
    1. st : 'st;
    2. callbacks : 'st Callbacks.t;
    } -> 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.

Sourceval dummy : t

Dummy subscriber that ignores every call.

Sourceval tee : t -> t -> t

tee s1 s2 is a subscriber that forwards every call to s1 and s2 both.

Sourceval tee_l : t list -> t

Tee multiple subscribers, ie return a subscriber that forwards to all the subscribers in subs.

OCaml

Innovation. Community. Security.