package trace

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

trace-0.10.1.tbz
sha256=0b5121a2b3ca0f0d850017865333259f313ce83f77bba54da956f9cafbba6e34
sha512=06476b3b450d3f382ba7e5287591e2bb0f928d38b698af0bd6083d1518fcac93bf498815710d26ecbe9c80c71888638919c0166a79e447ee64ed625afd56dc4b

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_l : t list -> t

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

Sourceval tee : t -> t -> t

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