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.91.1.tbz
sha256=30f344e7168a793d02c12d69c0f566b06eb963f52db3321e415ef6c5cd3d504d
sha512=19160da37cab59a23333d815baa67035f666e700a386953ec9957c685a0b72fa87919bac6a6651e50b1619773b3be7170bcc067c2d5316436b988bcf8d18dcba

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