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/src/trace.core/ambient_span_provider.ml.html

Source file ambient_span_provider.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(** Access/set the current span from some ambient context.
    @since 0.12 *)

open Types

module Callbacks = struct
  type 'st t = {
    with_current_span_set_to: 'a. 'st -> span -> (span -> 'a) -> 'a;
        (** [with_current_span_set_to span f] sets the span as current span,
            enters [f span], and restores the previous current span if any *)
    get_current_span: 'st -> span option;
        (** Access the current span from some ambient scope. This is only
            supported for collectors that provide a [current_span_wrap] field.
        *)
  }
end

type t =
  | ASP_none
  | ASP_some : 'st * 'st Callbacks.t -> t