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.util/Opentelemetry_util/Aswitch/index.html

Module Opentelemetry_util.AswitchSource

Aswitch for level-triggered cancellation and cleanup, atomically.

A switch can be flipped to false once, and remains off forever afterwards.

Inspired from https://ocsigen.org/lwt/5.5.0/api/Lwt_switch but thread-safe.

Sourcetype t
Sourcetype trigger

Can be used to turn the switch off

Sourceval pp : Format.formatter -> t -> unit
Sourceval show : t -> string
Sourceval create : ?parent:t -> unit -> t * trigger

New switch.

  • parameter parent

    inherit from this switch. It means that the result switches off if the parent does, but conversely we can turn the result off without affecting the parent. In other words, this switch's lifetime is a subset of the parent's lifetime

Sourceval on_turn_off : t -> (unit -> unit) -> unit

on_turn_off sw f will call f() when sw is turned off. If sw is already off then f() is called immediately.

NOTE f really should not fail, and should be as fast and light as possible.

Sourceval is_on : t -> bool
Sourceval is_off : t -> bool
Sourceval turn_off : trigger -> unit
Sourceval turn_off' : trigger -> [ `Was_off | `Was_on ]

Turn off switch, return previous state

link parent trigger turns off trigger when parent is turned off

Sourceval dummy : t

Always off switch

Sourcemodule Unsafe : sig ... end