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.90.tbz
sha256=c3989bb678f57e5276209d3c60afb29cdca33122288de55e591fbbe2e50a662c
sha512=ba8339256c9b2d8c99c8304991a3047f280a01e492add4cf82bf1d43dfa51e790366c09c6901c0501b8b8e1f810c6e128e33dd33542d785013407f642ade4eea

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.