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.10.tbz
sha256=c5a43827bbd5521e779c8856e44f4c718dccda902d00a242b598516110ada04d
sha512=f19cb25a767ed428cb1d4a497312267524bfaaf9550caa5fc1e84809494f0b7eaf26030d95563c75dea66606fcbec1be7e34baa4cba86fc57d64bc5d5b98efd5

doc/trace.subscriber/Trace_subscriber/index.html

Module Trace_subscriberSource

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.

  • since 0.8
Sourcemodule Callbacks : sig ... end

Callbacks used for subscribers.

Sourcemodule Subscriber : sig ... end

Trace subscribers

Sourcemodule Span_tbl : sig ... end

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

Sourcetype user_data =
  1. | U_bool of bool
  2. | U_float of float
  3. | U_int of int
  4. | U_none
  5. | U_string of string
    (*

    A non polymorphic-variant version of Trace_core.user_data

    *)
Sourcetype flavor =
  1. | Sync
  2. | Async
    (*

    A non polymorphic-variant version of Trace_core.flavor

    *)

Main API

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

A collector that calls the subscriber's callbacks.

It uses mtime (if available) to obtain timestamps.

OCaml

Innovation. Community. Security.

On This Page
  1. Main API