package opentelemetry

  1. Overview
  2. Docs
Core library for instrumentation and serialization for https://opentelemetry.io

Install

dune-project
 Dependency

Authors

Maintainers

Sources

opentelemetry-0.92.tbz
sha256=b635c486d1333cbb7276cc0075d5e01b017d4b37bd5941377ee1be07dfa25a45
sha512=2a19bf4e371ed2751e018c734ead2fd130d378ef0e018cda7b4aa3048af3e0db771fbd78d936199b34164950454bce0f3cb6211455e3647f7b7a85f4649bb22c

doc/opentelemetry.ambient-context/Opentelemetry_ambient_context/index.html

Module Opentelemetry_ambient_contextSource

Just forward to the ambient-context library

include module type of struct include Ambient_context end
include module type of struct include Ambient_context_core end
Sourceval get_current_storage : unit -> Storage.t
Sourceval set_current_storage : Storage.t -> unit

Functions operating with the current storage

Sourceval get_context : unit -> Ambient_context_core.Context.t

Get the context from the current storage, or Hmap.empty if there is no ambient context.

Sourceval with_context : Ambient_context_core.Context.t -> (unit -> 'a) -> 'a

with_context ctx f calls f() in an ambient context in which get_context() will return ctx. Once f() returns, the storage is reset to its previous value.

Sourceval get : 'a Context.key -> 'a option

Get the ambient context and then look up k in it

Sourceval new_key : unit -> 'a Context.key

Create a new key

Sourceval with_key_bound_to : 'a Hmap.key -> 'a -> (unit -> 'b) -> 'b

with_key_bound_to storage k v f calls f() in a context updated to have k map to v.

Sourceval with_key_unbound : 'a Hmap.key -> (unit -> 'b) -> 'b

with_key_unbound k f calls f() in a context updated to have k bound to no value.