This commit is contained in:
c-cube 2024-09-06 14:35:47 +00:00
parent b76cb42c89
commit fe6682fc65
35 changed files with 47 additions and 249 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context__ambient_context_unix__ (ambient-context.Ambient_context__ambient_context_unix__)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context__ambient_context_unix__</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context__ambient_context_unix__</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_atomic (ambient-context.Ambient_context_atomic)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_atomic</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_atomic</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Atomic"><a href="#module-Atomic" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Atomic/index.html">Atomic</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Atomic references.</p></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Types (ambient-context.Ambient_context_core.Types)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">ambient-context</a> &#x00BB; <a href="../index.html">Ambient_context_core</a> &#x00BB; Types</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_core.Types</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module-substitution anchored" id="module-Hmap"><a href="#module-Hmap" class="anchor"></a><code><span><span class="keyword">module</span> Hmap := <a href="../Ambient_context_hmap/index.html">Ambient_context_hmap</a></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a key</span></span><span> = <span><span class="type-var">'a</span> <a href="../Ambient_context_hmap/index.html#type-key">Hmap.key</a></span></span></code></div></div><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-STORAGE"><a href="#module-type-STORAGE" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-STORAGE/index.html">STORAGE</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-storage"><a href="#type-storage" class="anchor"></a><code><span><span class="keyword">type</span> storage</span><span> = <span>(<span class="keyword">module</span> <a href="module-type-STORAGE/index.html">STORAGE</a>)</span></span></code></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>STORAGE (ambient-context.Ambient_context_core.Types.STORAGE)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">ambient-context</a> &#x00BB; <a href="../../index.html">Ambient_context_core</a> &#x00BB; <a href="../index.html">Types</a> &#x00BB; STORAGE</nav><header class="odoc-preamble"><h1>Module type <code><span>Types.STORAGE</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_map"><a href="#val-get_map" class="anchor"></a><code><span><span class="keyword">val</span> get_map : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><a href="../../Ambient_context_hmap/index.html#type-t">Hmap.t</a> option</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_map"><a href="#val-with_map" class="anchor"></a><code><span><span class="keyword">val</span> with_map : <span><a href="../../Ambient_context_hmap/index.html#type-t">Hmap.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_key"><a href="#val-create_key" class="anchor"></a><code><span><span class="keyword">val</span> create_key : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> option</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_binding"><a href="#val-with_binding" class="anchor"></a><code><span><span class="keyword">val</span> with_binding : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-without_binding"><a href="#val-without_binding" class="anchor"></a><code><span><span class="keyword">val</span> without_binding : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_core (ambient-context.Ambient_context_core)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_core</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_core</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Ambient_context_hmap"><a href="#module-Ambient_context_hmap" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Ambient_context_hmap/index.html">Ambient_context_hmap</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Types"><a href="#module-Types" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Types/index.html">Types</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_core__Ambient_context_hmap (ambient-context.Ambient_context_core__Ambient_context_hmap)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_core__Ambient_context_hmap</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_core__Ambient_context_hmap</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_core__Types (ambient-context.Ambient_context_core__Types)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_core__Types</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_core__Types</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Thread_local (ambient-context.Ambient_context_thread_local.Thread_local)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">ambient-context</a> &#x00BB; <a href="../index.html">Ambient_context_thread_local</a> &#x00BB; Thread_local</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_thread_local.Thread_local</span></code></h1><p>Thread/Domain local storage</p><p>This allows the creation of global state that is per-domain or per-thread.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>Create new storage</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> option</span></span></code></div><div class="spec-doc"><p>Get current value</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_exn"><a href="#val-get_exn" class="anchor"></a><code><span><span class="keyword">val</span> get_exn : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p>Like <a href="#val-get"><code>get</code></a> but fails with an exception</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Not_found</code> <p>if no value was found</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span><span><span class="type-var">_</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_or_create"><a href="#val-get_or_create" class="anchor"></a><code><span><span class="keyword">val</span> get_or_create : <span><span class="label">create</span>:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div><div class="spec-doc"><p><code>with_ var x f</code> sets <code>var</code> to <code>x</code> for this thread, calls <code>f prev</code> where <code>prev</code> is the value currently in <code>var</code> (if any), and then restores the old value of <code>var</code> for this thread.</p></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_thread_local (ambient-context.Ambient_context_thread_local)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_thread_local</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_thread_local</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Thread_local"><a href="#module-Thread_local" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Thread_local/index.html">Thread_local</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Thread/Domain local storage</p></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_thread_local__Thread_local (ambient-context.Ambient_context_thread_local__Thread_local)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_thread_local__Thread_local</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_thread_local__Thread_local</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>M (ambient-context.Ambient_context_tls.M)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">ambient-context</a> &#x00BB; <a href="../index.html">Ambient_context_tls</a> &#x00BB; M</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_tls.M</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_map"><a href="#val-get_map" class="anchor"></a><code><span><span class="keyword">val</span> get_map : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><a href="../../Ambient_context_core/Ambient_context_hmap/index.html#type-t">Hmap.t</a> option</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_map"><a href="#val-with_map" class="anchor"></a><code><span><span class="keyword">val</span> with_map : <span><a href="../../Ambient_context_core/Ambient_context_hmap/index.html#type-t">Hmap.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_key"><a href="#val-create_key" class="anchor"></a><code><span><span class="keyword">val</span> create_key : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../../../hmap/Hmap/index.html#type-key">Hmap.key</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><span><span class="type-var">'a</span> <a href="../../Ambient_context_core/Ambient_context_hmap/index.html#type-key">Hmap.key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> option</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_binding"><a href="#val-with_binding" class="anchor"></a><code><span><span class="keyword">val</span> with_binding : <span><span><span class="type-var">'a</span> <a href="../../Ambient_context_core/Ambient_context_hmap/index.html#type-key">Hmap.key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'d</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-without_binding"><a href="#val-without_binding" class="anchor"></a><code><span><span class="keyword">val</span> without_binding : <span><span><span class="type-var">'a</span> <a href="../../Ambient_context_core/Ambient_context_hmap/index.html#type-key">Hmap.key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span></span></code></div></div></div></body></html>

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_tls (ambient-context.Ambient_context_tls)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_tls</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_tls</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-TLS"><a href="#module-TLS" class="anchor"></a><code><span><span class="keyword">module</span> TLS</span><span> = <a href="../Ambient_context_thread_local/Thread_local/index.html">Ambient_context_thread_local.Thread_local</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Hmap"><a href="#module-Hmap" class="anchor"></a><code><span><span class="keyword">module</span> Hmap</span><span> = <a href="../Ambient_context_core/Ambient_context_hmap/index.html">Ambient_context_core.Ambient_context_hmap</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-_internal_key"><a href="#val-_internal_key" class="anchor"></a><code><span><span class="keyword">val</span> _internal_key : <span><a href="../Ambient_context_core/Ambient_context_hmap/index.html#type-t">Hmap.t</a> <a href="../Ambient_context_thread_local/Thread_local/index.html#type-t">TLS.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span><span class="keyword">val</span> let* : <span><span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'c</span> option</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'c</span> option</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-M"><a href="#module-M" class="anchor"></a><code><span><span class="keyword">module</span> <a href="M/index.html">M</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-storage"><a href="#val-storage" class="anchor"></a><code><span><span class="keyword">val</span> storage : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="../Ambient_context_core/Types/index.html#type-storage">Ambient_context_core.Types.storage</a></span></code></div></div></div></body></html>

View file

@ -1,204 +0,0 @@
ocaml-ambient-context
=====================
This OCaml module provides a API that is type- and dependency-abstracted across thread-local storage, Lwt's [sequence-associated storage](https://github.com/ocsigen/lwt/blob/cc05e2bda6c34126a3fd8d150ee7cddb3b8a440b/src/core/lwt.ml#L727-L751 "Internal documentation for Lwt's SAS mechanism"), and Eio's [fiber-local storage](https://github.com/ocaml-multicore/eio/pull/256 "ocaml-multicore/eio#256, adding a fibre-local storage API") — all different approaches to "throwing" information "across the stack" at runtime, without modifying interleaving methods/components/dependencies.
As a library author, depending on `ambient-context` allows you to
1. abstract some sort of application-provided information into something like "thread-local storage",
2. while still being compatible with dependants who are calling into you from an asynchronous context (like Lwt or Eio),
3. *without* functorizing your interface over (or even depending on!) specifically Lwt or Eio, or preventing non-Lwt/Eio users from consuming your API.
Simply put, `ambient-context` allows you to communicate with your dependants in situations where you cannot control intermediate dependencies, and cannot modify the API of your own library to accept a new parameter.
> [!WARNING]
> Ambient context like this — effectively, implicit global state — is usually frowned upon for most uses, and with good reason. This module is *intended* to be used as a last resort, and exclusively for debugging, tracing, and reporting purposes, if at all possible.
Installation and usage ...
--------------------------
The intended usage of this library is in two collaborating components:
1. that of a "deep in the dependency-tree" library (e.g. `foo-deep-lib`),
2. and a top-of-the-dependency-tree (e.g. `widget-app`).
The former needs to be able to obtain information from the latter, *without* changing the API presented to intermediate dependencies (e.g. `bar-intermediary-lib`) — and equivalently, without changing the function-signatures of intermediate wrappers/callers.
<a name="as-a-top-level-application"></a>
### ... as a top-level application
If a library you depend on (let's pretend it's `foo-deep-lib`) uses `ambient-context`, they're effectively deferring an important decision about _how_ their library communicates with you.
_This means you must to choose, and configure, a storage-mechanism relevant to the callsite(s) in your own application._
Your choice will vary depending on *from where*, in your own code, you're calling into a library that uses `ambient-context` — that is, whether an asynchronous event-loop (such as Lwt or Eio) exists 'above' your calls on the stack. Having determined whether you'll be calling your dependancy (e.g. `foo-deep-lib`) from such an asynchronous context , you'll then need to install the relevant storage-provider at runtime with an appropriately-placed call to `Ambient_context.set_storage_provider`.
> **Example:** if you're writing an Lwt-enabled application, and you'll be calling `bar-intermediary-lib` below the `Lwt_main.run` event-loop on the stack, you'll need to install the `ambient-context-lwt` "storage provider" ...
>
> ```diff
> ; dune-project
> (depends
> (ocaml
> (>= 4.08))
> + ambient-context.unix
> + ambient-context-lwt
> bar-intermediary-lib
> (alcotest :with-test)
> (ocaml-lsp-server :with-dev-setup)
> ```
>
> ```diff
> ; src/dune
> (executable
> (name widget_app)
> - (libraries bar-intermediary-lib))
> + (libraries ambient-context.unix ambient-context-lwt bar-intermediary-lib))
> ```
>
> ... and at runtime, your application will need to dictate the relevant storage backend (TLS, Lwt, or Eio) for a delineated section of the stack — usually, this involves wrapping the invocation of your asynchronous thread-scheduler's runloop — in this example, `Lwt_main.run`:
>
> ```ocaml
> (* src/widget_app.ml *)
> module Ctx = Ambient_context
>
> let () =
> let sock = create_socket () in
> let serve = create_server sock in
>
> (* add this line before [Lwt_main.run]: *)
> Ctx.set_storage_provider (Ambient_context_lwt.storage ()) ;
> Lwt_main.run @@ serve ()
> ```
Once your application has configured the appropriate runtime context-storage, you'll presumably need to actually _use_ the ambient context in your calls to `foo-deep-lib`.
To communicate with transitive dependencies, you need an opaque `key` — these are usually created and exposed by your transitive dependency; see its documentation.
You can provide ambient values to the transitive dependency via calls to `Ambient_context.with_binding`; which takes that opaque `key`, the new `value` you want to set, and then a callback.
> **Example:** In our Lwt-enabled application, assuming `foo-deep-lib` takes advantage of the ambient context to communicate about a header it wants to add to HTTP requests, we can set that header in our application's top-level context, and it will be available to `foo-deep-lib`'s calls to `Curl`:
>
> ```ocaml
> (* src/widget_app.ml *)
> module Ctx = Ambient_context
>
> let () =
> let sock = create_socket () in
> let serve = create_server sock in
>
> Ctx.set_storage_provider (Ambient_context_lwt.storage ()) ;
> Lwt_main.run @@ fun () ->
> Ctx.with_binding Foo_deep.header_context_key "my header value" @@ fun () ->
> (* This empty [bind] may be necessary; see
> {!Ambient_context_lwt.with_binding}. *)
> Lwt.bind (serve ()) (fun () -> ())
> ```
Refer to your dependency's documentation for specific instructions on how to provide the ambient context they expect.
<!-- FIXME: v3.ocaml.org links for the backends' documentation -->
> [!NOTE]
> The precise semantics of `with_binding` depend on the chosen storage-backend; refer to your chosen backend's documentation.
### ... as a library
This library allows you to avoid depending on, or functorizing over, `Lwt.t`. In the most basic usage, you simply provide a `Ambient_context.key`, direct your consumers to the [above documentation](#as-a-top-level-application) and then anywhere in your API, you can pull the value 'currently' assigned to your key out of the ambient-context.
You need depend only on `ambient-context` itself, *not* `ambient-context-lwt`, or even `lwt` itself:
```diff
; dune-project
(depends
(ocaml
(>= 4.08))
+ ambient-context
(alcotest :with-test)
(ocaml-lsp-server :with-dev-setup)
```
```diff
; lib/dune
(library
(name foo-deep-lib)
- (libraries curl pcre)
+ (libraries ambient-context curl pcre))
```
Use `Ambient_context.create_key` to create an opaque key for the value, and expose that to your user:
```ocaml
(* lib/foo_deep.ml *)
module Ctx = Ambient_context
let header_context_key : string Ctx.key = Ctx.create_key ()
(* ... *)
```
Then, anywhere you like, you should be able to obtain the value assigned to `Foo_deep.header_context_key` by the consuming application up-stack from you:
```ocaml
(* lib/foo_deep.ml *)
module Ctx = Ambient_context
(* ... *)
let http_request ?headers ?body action url =
let open Curl in
let headers =
match Ctx.get Foo_deep.header_context_key with
| None -> headers
| Some header ->
let header = "x-foo-deep: " ^ header in
Some (header :: Option.default [] headers)
in
(* ... *)
```
Contributing
------------
1. Create an opam switch and install the dependencies:
```console
$ opam switch create . ocaml.5.0.0 --deps-only --no-install
# If you have opam >= 2.2
$ opam install . --deps-only --with-test --with-dev-setup
# ... or with opam < 2.2
$ opam install . --deps-only --with-test
$ opam install ocaml-lsp-server ocamlformat
```
2. Install [pre-commit][], and then configure your checkout:
```console
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
```
[pre-commit]: <https://pre-commit.com/index.html#install> "Installation instructions for th pre-commit tool"
License
-------
Copyright © 2023 ELLIOTTCABLE
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,2 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (ambient-context.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> ambient-context</nav><header class="odoc-preamble"><h1 id="package-ambient-context"><a href="#package-ambient-context" class="anchor"></a>Package ambient-context <nav> <a href="#package_info">more…</a></nav></h1><ul class="modules"><li><a href="Ambient_context/index.html"><code>Ambient_context</code></a> </li><li><a href="Ambient_context/index.html"><code>Ambient_context</code></a> </li><li><a href="Ambient_context_atomic/index.html"><code>Ambient_context_atomic</code></a> </li><li><a href="Ambient_context_core/index.html"><code>Ambient_context_core</code></a> </li><li><a href="Ambient_context_thread_local/index.html"><code>Ambient_context_thread_local</code></a> </li><li><a href="Ambient_context_tls/index.html"><code>Ambient_context_tls</code></a> </li></ul></header><nav class="odoc-toc"><ul><li><a href="#package_info">Package info</a></li></ul></nav><div class="odoc-content"><h2 id="package_info"><a href="#package_info" class="anchor"></a>Package info</h2><table class="package info"><tr id="info-readme-files"><td><a href="#info-readme-files" aria-hidden="true" class="anchor"></a>readme-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/README.md">README.md</a></li></ul></td></tr></table></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Opentelemetry_client_ocurl (opentelemetry-client-ocurl.Opentelemetry_client_ocurl)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">opentelemetry-client-ocurl</a> &#x00BB; Opentelemetry_client_ocurl</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_client_ocurl</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-get_url"><a href="#val-get_url" class="anchor"></a><code><span><span class="keyword">val</span> get_url : <span>unit <span class="arrow">&#45;&gt;</span></span> string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_url"><a href="#val-set_url" class="anchor"></a><code><span><span class="keyword">val</span> set_url : <span>string <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Url of the endpoint. Default is &quot;http://localhost:4318&quot;, or &quot;OTEL_EXPORTER_OTLP_ENDPOINT&quot; if set.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_headers"><a href="#val-get_headers" class="anchor"></a><code><span><span class="keyword">val</span> get_headers : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span>(string * string)</span> list</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_headers"><a href="#val-set_headers" class="anchor"></a><code><span><span class="keyword">val</span> set_headers : <span><span><span>(string * string)</span> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Set http headers that are sent on every http query to the collector.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Atomic"><a href="#module-Atomic" class="anchor"></a><code><span><span class="keyword">module</span> Atomic</span><span> = <a href="../../opentelemetry/Opentelemetry_atomic/Atomic/index.html">Opentelemetry_atomic.Atomic</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Config"><a href="#module-Config" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Config/index.html">Config</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Configuration for the ocurl backend</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_backend"><a href="#val-create_backend" class="anchor"></a><code><span><span class="keyword">val</span> create_backend :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Opentelemetry_client_ocurl (opentelemetry-client-ocurl.Opentelemetry_client_ocurl)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">opentelemetry-client-ocurl</a> &#x00BB; Opentelemetry_client_ocurl</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_client_ocurl</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-get_headers"><a href="#val-get_headers" class="anchor"></a><code><span><span class="keyword">val</span> get_headers : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span>(string * string)</span> list</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_headers"><a href="#val-set_headers" class="anchor"></a><code><span><span class="keyword">val</span> set_headers : <span><span><span>(string * string)</span> list</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Set http headers that are sent on every http query to the collector.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Atomic"><a href="#module-Atomic" class="anchor"></a><code><span><span class="keyword">module</span> Atomic</span><span> = <a href="../../opentelemetry/Opentelemetry_atomic/Atomic/index.html">Opentelemetry_atomic.Atomic</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Config"><a href="#module-Config" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Config/index.html">Config</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Configuration for the ocurl backend</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_backend"><a href="#val-create_backend" class="anchor"></a><code><span><span class="keyword">val</span> create_backend :
<span><span class="optlabel">?stop</span>:<span>bool <a href="../../opentelemetry/Opentelemetry_atomic/Atomic/index.html#type-t">Atomic.t</a></span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?config</span>:<a href="Config/index.html#type-t">Config.t</a> <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>

View file

@ -1,4 +1,10 @@
## 0.10
- feat: add support for per-signal urls (by @tatchi)
- build: disable protobuf regeneration during normal library use
- fix: emit GC metrics even in the absence of custom metrics
## 0.9
- compat with trace 0.7

View file

@ -1,4 +1,10 @@
## 0.10
- feat: add support for per-signal urls (by @tatchi)
- build: disable protobuf regeneration during normal library use
- fix: emit GC metrics even in the absence of custom metrics
## 0.9
- compat with trace 0.7

View file

@ -42,7 +42,7 @@
<span>(<span>unit <span class="arrow">&#45;&gt;</span></span>
<span class="type-var">'b</span>)</span>
* <span>(<span><span><span>(unit, string * <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a>)</span> <a href="../../../ocaml/Stdlib/index.html#type-result">result</a></span> <span class="arrow">&#45;&gt;</span></span>
unit)</span></span></code></div></div><p>Sync span guard.</p><p>Notably, this includes <em>implicit</em> scope-tracking: if called without a <code>~scope</code> argument (or <code>~parent</code>/<code>~trace_id</code>), it will check in the <a href="../../../ambient-context/Ambient_context/index.html"><code>Ambient_context</code></a> for a surrounding environment, and use that as the scope. Similarly, it uses <code>Scope.with_ambient_scope</code> to <em>set</em> a new scope in the ambient context, so that any logically-nested calls to <a href="#val-with_"><code>with_</code></a> will use this span as their parent.</p><p><b>NOTE</b> be careful not to call this inside a Gc alarm, as it can cause deadlocks.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">force_new_trace_id</span> <p>if true (default false), the span will not use a ambient scope, the <code>~scope</code> argument, nor <code>~trace_id</code>, but will instead always create fresh identifiers for this span</p></li></ul></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ :
unit)</span></span></code></div></div><p>Sync span guard.</p><p>Notably, this includes <em>implicit</em> scope-tracking: if called without a <code>~scope</code> argument (or <code>~parent</code>/<code>~trace_id</code>), it will check in the <code>Ambient_context</code> for a surrounding environment, and use that as the scope. Similarly, it uses <code>Scope.with_ambient_scope</code> to <em>set</em> a new scope in the ambient context, so that any logically-nested calls to <a href="#val-with_"><code>with_</code></a> will use this span as their parent.</p><p><b>NOTE</b> be careful not to call this inside a Gc alarm, as it can cause deadlocks.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">force_new_trace_id</span> <p>if true (default false), the span will not use a ambient scope, the <code>~scope</code> argument, nor <code>~trace_id</code>, but will instead always create fresh identifiers for this span</p></li></ul></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ :
<span><span class="optlabel">?force_new_trace_id</span>:bool <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?trace_state</span>:string <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?service_name</span>:string <span class="arrow">&#45;&gt;</span></span>

View file

@ -1,4 +1,10 @@
## 0.10
- feat: add support for per-signal urls (by @tatchi)
- build: disable protobuf regeneration during normal library use
- fix: emit GC metrics even in the absence of custom metrics
## 0.9
- compat with trace 0.7

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Host (opentelemetry.Opentelemetry.Conventions.Attributes.Host)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../../index.html">opentelemetry</a> &#x00BB; <a href="../../../index.html">Opentelemetry</a> &#x00BB; <a href="../../index.html">Conventions</a> &#x00BB; <a href="../index.html">Attributes</a> &#x00BB; Host</nav><header class="odoc-preamble"><h1>Module <code><span>Attributes.Host</span></code></h1><p>https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/host.md</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-id"><a href="#val-id" class="anchor"></a><code><span><span class="keyword">val</span> id : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-type_"><a href="#val-type_" class="anchor"></a><code><span><span class="keyword">val</span> type_ : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-arch"><a href="#val-arch" class="anchor"></a><code><span><span class="keyword">val</span> arch : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ip"><a href="#val-ip" class="anchor"></a><code><span><span class="keyword">val</span> ip : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-mac"><a href="#val-mac" class="anchor"></a><code><span><span class="keyword">val</span> mac : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-image_id"><a href="#val-image_id" class="anchor"></a><code><span><span class="keyword">val</span> image_id : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-image_name"><a href="#val-image_name" class="anchor"></a><code><span><span class="keyword">val</span> image_name : string</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-image_version"><a href="#val-image_version" class="anchor"></a><code><span><span class="keyword">val</span> image_version : string</span></code></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Attributes (opentelemetry.Opentelemetry.Conventions.Attributes)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">opentelemetry</a> &#x00BB; <a href="../../index.html">Opentelemetry</a> &#x00BB; <a href="../index.html">Conventions</a> &#x00BB; Attributes</nav><header class="odoc-preamble"><h1>Module <code><span>Conventions.Attributes</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Process"><a href="#module-Process" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Process/index.html">Process</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Code"><a href="#module-Code" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Code/index.html">Code</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Service"><a href="#module-Service" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Service/index.html">Service</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-HTTP"><a href="#module-HTTP" class="anchor"></a><code><span><span class="keyword">module</span> <a href="HTTP/index.html">HTTP</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Attributes (opentelemetry.Opentelemetry.Conventions.Attributes)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">opentelemetry</a> &#x00BB; <a href="../../index.html">Opentelemetry</a> &#x00BB; <a href="../index.html">Conventions</a> &#x00BB; Attributes</nav><header class="odoc-preamble"><h1>Module <code><span>Conventions.Attributes</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Process"><a href="#module-Process" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Process/index.html">Process</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Code"><a href="#module-Code" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Code/index.html">Code</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Service"><a href="#module-Service" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Service/index.html">Service</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-HTTP"><a href="#module-HTTP" class="anchor"></a><code><span><span class="keyword">module</span> <a href="HTTP/index.html">HTTP</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Host"><a href="#module-Host" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Host/index.html">Host</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/host.md</p></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -36,7 +36,7 @@
<span>(<span>unit <span class="arrow">&#45;&gt;</span></span>
<span class="type-var">'b</span>)</span>
* <span>(<span><span><span>(unit, string * <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a>)</span> <a href="../../../ocaml/Stdlib/index.html#type-result">result</a></span> <span class="arrow">&#45;&gt;</span></span>
unit)</span></span></code></div></div><p>Sync span guard.</p><p>Notably, this includes <em>implicit</em> scope-tracking: if called without a <code>~scope</code> argument (or <code>~parent</code>/<code>~trace_id</code>), it will check in the <a href="../../../ambient-context/Ambient_context/index.html"><code>Ambient_context</code></a> for a surrounding environment, and use that as the scope. Similarly, it uses <a href="../Scope/index.html#val-with_ambient_scope"><code>Scope.with_ambient_scope</code></a> to <em>set</em> a new scope in the ambient context, so that any logically-nested calls to <a href="#val-with_"><code>with_</code></a> will use this span as their parent.</p><p><b>NOTE</b> be careful not to call this inside a Gc alarm, as it can cause deadlocks.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">force_new_trace_id</span> <p>if true (default false), the span will not use a ambient scope, the <code>~scope</code> argument, nor <code>~trace_id</code>, but will instead always create fresh identifiers for this span</p></li></ul><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ :
unit)</span></span></code></div></div><p>Sync span guard.</p><p>Notably, this includes <em>implicit</em> scope-tracking: if called without a <code>~scope</code> argument (or <code>~parent</code>/<code>~trace_id</code>), it will check in the <code>Ambient_context</code> for a surrounding environment, and use that as the scope. Similarly, it uses <a href="../Scope/index.html#val-with_ambient_scope"><code>Scope.with_ambient_scope</code></a> to <em>set</em> a new scope in the ambient context, so that any logically-nested calls to <a href="#val-with_"><code>with_</code></a> will use this span as their parent.</p><p><b>NOTE</b> be careful not to call this inside a Gc alarm, as it can cause deadlocks.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">force_new_trace_id</span> <p>if true (default false), the span will not use a ambient scope, the <code>~scope</code> argument, nor <code>~trace_id</code>, but will instead always create fresh identifiers for this span</p></li></ul><div class="odoc-spec"><div class="spec value anchored" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ :
<span><span class="optlabel">?force_new_trace_id</span>:bool <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?trace_state</span>:string <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?service_name</span>:string <span class="arrow">&#45;&gt;</span></span>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ambient_context_atomic__Atomic (ambient-context.Ambient_context_atomic__Atomic)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">ambient-context</a> &#x00BB; Ambient_context_atomic__Atomic</nav><header class="odoc-preamble"><h1>Module <code><span>Ambient_context_atomic__Atomic</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Opentelemetry_ambient_context__ (opentelemetry.Opentelemetry_ambient_context__)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">opentelemetry</a> &#x00BB; Opentelemetry_ambient_context__</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_ambient_context__</span></code></h1></header><div class="odoc-content"><p>This module is hidden.</p></div></body></html>

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Opentelemetry_ambient_context_lwt (opentelemetry.Opentelemetry_ambient_context_lwt)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">opentelemetry</a> &#x00BB; Opentelemetry_ambient_context_lwt</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_ambient_context_lwt</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-storage"><a href="#val-storage" class="anchor"></a><code><span><span class="keyword">val</span> storage : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="../Opentelemetry_ambient_context/index.html#type-storage">Opentelemetry_ambient_context.storage</a></span></code></div><div class="spec-doc"><p>Storage using Lwt keys</p></div></div></div></body></html>

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Opentelemetry_ambient_context_types (opentelemetry.Opentelemetry_ambient_context_types)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">opentelemetry</a> &#x00BB; Opentelemetry_ambient_context_types</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_ambient_context_types</span></code></h1><p>Storage implementation.</p><p>There is a singleton storage for a given program, responsible for providing ambient context to the rest of the program.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a key</span></span><span> = <span><span class="type-var">'a</span> <a href="../../hmap/Hmap/index.html#type-key">Hmap.key</a></span></span></code></div></div><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-STORAGE"><a href="#module-type-STORAGE" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-STORAGE/index.html">STORAGE</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-storage"><a href="#type-storage" class="anchor"></a><code><span><span class="keyword">type</span> storage</span><span> = <span>(<span class="keyword">module</span> <a href="module-type-STORAGE/index.html">STORAGE</a>)</span></span></code></div></div></div></body></html>

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>STORAGE (opentelemetry.Opentelemetry_ambient_context_types.STORAGE)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">opentelemetry</a> &#x00BB; <a href="../index.html">Opentelemetry_ambient_context_types</a> &#x00BB; STORAGE</nav><header class="odoc-preamble"><h1>Module type <code><span>Opentelemetry_ambient_context_types.STORAGE</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : string</span></code></div><div class="spec-doc"><p>Name of the storage implementation.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_map"><a href="#val-get_map" class="anchor"></a><code><span><span class="keyword">val</span> get_map : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><a href="../../../hmap/Hmap/index.html#type-t">Hmap.t</a> option</span></span></code></div><div class="spec-doc"><p>Get the hmap from the current ambient context, or <code>None</code> if there is no ambient context.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_map"><a href="#val-with_map" class="anchor"></a><code><span><span class="keyword">val</span> with_map : <span><a href="../../../hmap/Hmap/index.html#type-t">Hmap.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div><div class="spec-doc"><p><code>with_hmap h cb</code> calls <code>cb()</code> in an ambient context in which <code>get_map()</code> will return <code>h</code>. Once <code>cb()</code> returns, the storage is reset to its previous value.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_key"><a href="#val-create_key" class="anchor"></a><code><span><span class="keyword">val</span> create_key : <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span></span></code></div><div class="spec-doc"><p>Create a new storage key, guaranteed to be distinct from any previously created key.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> option</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_binding"><a href="#val-with_binding" class="anchor"></a><code><span><span class="keyword">val</span> with_binding : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-without_binding"><a href="#val-without_binding" class="anchor"></a><code><span><span class="keyword">val</span> without_binding : <span><span><span class="type-var">'a</span> <a href="../index.html#type-key">key</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span></span></code></div></div></div></body></html>

View file

@ -1,4 +1,10 @@
## 0.10
- feat: add support for per-signal urls (by @tatchi)
- build: disable protobuf regeneration during normal library use
- fix: emit GC metrics even in the absence of custom metrics
## 0.9
- compat with trace 0.7

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (opentelemetry.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> opentelemetry</nav><header class="odoc-preamble"><h1 id="package-opentelemetry"><a href="#package-opentelemetry" class="anchor"></a>Package opentelemetry <nav><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">changes</a> <a href="#package_info">more…</a></nav></h1><ul class="modules"><li><a href="Opentelemetry/index.html"><code>Opentelemetry</code></a> <span class="synopsis">Opentelemetry types and instrumentation</span></li><li><a href="Opentelemetry_atomic/index.html"><code>Opentelemetry_atomic</code></a> </li><li><a href="Opentelemetry_proto/index.html"><code>Opentelemetry_proto</code></a> </li></ul></header><nav class="odoc-toc"><ul><li><a href="#package_info">Package info</a></li></ul></nav><div class="odoc-content"><h2 id="package_info"><a href="#package_info" class="anchor"></a>Package info</h2><table class="package info"><tr id="info-changes-files"><td><a href="#info-changes-files" aria-hidden="true" class="anchor"></a>changes-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">CHANGES.md</a></li></ul></td></tr><tr id="info-readme-files"><td><a href="#info-readme-files" aria-hidden="true" class="anchor"></a>readme-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/README.md">README.md</a></li></ul></td></tr></table></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (opentelemetry.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> opentelemetry</nav><header class="odoc-preamble"><h1 id="package-opentelemetry"><a href="#package-opentelemetry" class="anchor"></a>Package opentelemetry <nav><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">changes</a> <a href="#package_info">more…</a></nav></h1><ul class="modules"><li><a href="Opentelemetry/index.html"><code>Opentelemetry</code></a> <span class="synopsis">Opentelemetry types and instrumentation</span></li><li><a href="Opentelemetry_ambient_context/index.html"><code>Opentelemetry_ambient_context</code></a> <span class="synopsis">Ambient context.</span></li><li><a href="Opentelemetry_ambient_context_lwt/index.html"><code>Opentelemetry_ambient_context_lwt</code></a> </li><li><a href="Opentelemetry_ambient_context_types/index.html"><code>Opentelemetry_ambient_context_types</code></a> <span class="synopsis">Storage implementation.</span></li><li><a href="Opentelemetry_atomic/index.html"><code>Opentelemetry_atomic</code></a> </li><li><a href="Opentelemetry_proto/index.html"><code>Opentelemetry_proto</code></a> </li></ul></header><nav class="odoc-toc"><ul><li><a href="#package_info">Package info</a></li></ul></nav><div class="odoc-content"><h2 id="package_info"><a href="#package_info" class="anchor"></a>Package info</h2><table class="package info"><tr id="info-changes-files"><td><a href="#info-changes-files" aria-hidden="true" class="anchor"></a>changes-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">CHANGES.md</a></li></ul></td></tr><tr id="info-readme-files"><td><a href="#info-readme-files" aria-hidden="true" class="anchor"></a>readme-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/README.md">README.md</a></li></ul></td></tr></table></div></body></html>