package trace

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

trace-0.12.tbz
sha256=c173d6bf9433e9eeb41bbddda116a296373d45865841dcbb78bff3be8abd9fd8
sha512=1105c52112095fdc8d4961d7346b02e416627bde6ac79ddd137bff63ac0ff5cd23fa53192be642614efadb9cb0cbb83b7d571bb5a0d100ad0ae6d10bc61d3bba

doc/trace.debug/Trace_debug/Track_spans/index.html

Module Trace_debug.Track_spansSource

Helper to track which spans never get closed.

Sourcetype unclosed_spans = {
  1. num : int;
  2. by_name : (string * int) list;
}
Sourceval track : ?on_lingering_spans:[ `Out of out_channel | `Call of unclosed_spans -> unit ] -> Trace_core.Collector.t -> Trace_core.Collector.t

Modify the enter/exit span functions to track the set of spans that are open, and warn at the end if some are not closed.

implementation notes: for now this uses a regular Hashtbl protected by a mutex, so runtime overhead isn't trivial.

  • parameter on_lingering_spans

    what to do with the non-closed spans