This commit is contained in:
mattjbray 2022-03-25 11:42:21 +00:00
parent 94ecad7866
commit 56699d02fc
5 changed files with 32 additions and 0 deletions

View file

@ -13,6 +13,7 @@
<ol>
<li><a href="opentelemetry/index.html">opentelemetry</a></li>
<li><a href="opentelemetry-client-ocurl/index.html">opentelemetry-client-ocurl</a></li>
<li><a href="opentelemetry-cohttp-lwt/index.html">opentelemetry-cohttp-lwt</a></li>
<li><a href="opentelemetry-lwt/index.html">opentelemetry-lwt</a></li>
</ol>
</div>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Server (opentelemetry-cohttp-lwt.Opentelemetry_cohttp_lwt.Server)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.0"/><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-cohttp-lwt</a> &#x00BB; <a href="../index.html">Opentelemetry_cohttp_lwt</a> &#x00BB; Server</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_cohttp_lwt.Server</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-trace" class="anchored"><a href="#val-trace" class="anchor"></a><code><span><span class="keyword">val</span> trace :
<span>service_name:string <span class="arrow">&#45;&gt;</span></span>
<span>?attrs:<span><a href="../../../opentelemetry/Opentelemetry/Span/index.html#type-key_value">Otel.Span.key_value</a> list</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>( <span><span class="type-var">'conn</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'body</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span class="xref-unresolved">Cohttp_lwt</span>.Response.t * <span class="type-var">'body</span>)</span> <span class="xref-unresolved">Lwt</span>.t</span> )</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'conn</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'body</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span class="xref-unresolved">Cohttp_lwt</span>.Response.t * <span class="type-var">'body</span>)</span> <span class="xref-unresolved">Lwt</span>.t</span></span></code></div><div class="spec-doc"><p>Trace requests to a Cohttp server.</p><p>Use it like this:</p><p>let my_server callback = let callback_traced = Opentelemetry_cohttp_lwt.Server.trace ~service_name:&quot;my-service&quot; (fun _scope -&gt; callback) in Cohttp_lwt_unix.Server.create ~mode:(`TCP (`Port 8080)) (Server.make () ~callback:callback_traced)</p></div></div><div class="odoc-spec"><div class="spec value" id="val-with_" class="anchored"><a href="#val-with_" class="anchor"></a><code><span><span class="keyword">val</span> with_ :
<span>?trace_state:string <span class="arrow">&#45;&gt;</span></span>
<span>?service_name:string <span class="arrow">&#45;&gt;</span></span>
<span>?attrs:<span><a href="../../../opentelemetry/Opentelemetry/Span/index.html#type-key_value">Otel.Span.key_value</a> list</span> <span class="arrow">&#45;&gt;</span></span>
<span>?kind:<a href="../../../opentelemetry/Opentelemetry/Span/index.html#type-kind">Otel.Span.kind</a> <span class="arrow">&#45;&gt;</span></span>
<span>?links:<span><span>(<a href="../../../opentelemetry/Opentelemetry/Trace_id/index.html#type-t">Otel.Trace_id.t</a> * <a href="../../../opentelemetry/Opentelemetry/Span_id/index.html#type-t">Otel.Span_id.t</a> * string)</span> list</span> <span class="arrow">&#45;&gt;</span></span>
<span>string <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span>
<span><span>( <span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="xref-unresolved">Lwt</span>.t</span> )</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'a</span> <span class="xref-unresolved">Lwt</span>.t</span></span></code></div><div class="spec-doc"><p>Trace a new internal span.</p><p>Identical to <code>Opentelemetry_lwt.Trace.with_</code>, but fetches/stores the trace scope in the <code>x-ocaml-otel-traceparent</code> header in the request for convenience.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-get_trace_context" class="anchored"><a href="#val-get_trace_context" class="anchor"></a><code><span><span class="keyword">val</span> get_trace_context :
<span>?from:<span>[ `Internal <span>| `External</span> ]</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span>
<span><a href="../../../opentelemetry/Opentelemetry/Trace/index.html#type-scope">Otel.Trace.scope</a> option</span></span></code></div><div class="spec-doc"><p>Get the tracing scope from the custom <code>x-ocaml-otel-traceparent</code> header added by <code>trace</code> and <code>with_</code>.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-set_trace_context" class="anchored"><a href="#val-set_trace_context" class="anchor"></a><code><span><span class="keyword">val</span> set_trace_context :
<span><a href="../../../opentelemetry/Opentelemetry/Trace/index.html#type-scope">Otel.Trace.scope</a> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span>
<span class="xref-unresolved">Cohttp_lwt</span>.Request.t</span></code></div><div class="spec-doc"><p>Set the tracing scope in the custom <code>x-ocaml-otel-traceparent</code> header used by <code>trace</code> and <code>with_</code>.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-remove_trace_context" class="anchored"><a href="#val-remove_trace_context" class="anchor"></a><code><span><span class="keyword">val</span> remove_trace_context : <span><span class="xref-unresolved">Cohttp_lwt</span>.Request.t <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Cohttp_lwt</span>.Request.t</span></code></div><div class="spec-doc"><p>Strip the custom <code>x-ocaml-otel-traceparent</code> header added by <code>trace</code> and <code>with_</code>.</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_cohttp_lwt (opentelemetry-cohttp-lwt.Opentelemetry_cohttp_lwt)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.0"/><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-cohttp-lwt</a> &#x00BB; Opentelemetry_cohttp_lwt</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry_cohttp_lwt</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module" id="module-Otel" class="anchored"><a href="#module-Otel" class="anchor"></a><code><span><span class="keyword">module</span> Otel</span><span> = <a href="../../opentelemetry/Opentelemetry/index.html">Opentelemetry</a></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Otel_lwt" class="anchored"><a href="#module-Otel_lwt" class="anchor"></a><code><span><span class="keyword">module</span> Otel_lwt</span><span> = <a href="../../opentelemetry-lwt/Opentelemetry_lwt/index.html">Opentelemetry_lwt</a></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Server" class="anchored"><a href="#module-Server" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Server/index.html">Server</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</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>index (opentelemetry-cohttp-lwt.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.0"/><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-cohttp-lwt</nav><header class="odoc-preamble"><h1 id="opentelemetry-cohttp-lwt-index"><a href="#opentelemetry-cohttp-lwt-index" class="anchor"></a>opentelemetry-cohttp-lwt index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-opentelemetry-cohttp-lwt">Library opentelemetry-cohttp-lwt</a></li></ul></nav><div class="odoc-content"><h2 id="library-opentelemetry-cohttp-lwt"><a href="#library-opentelemetry-cohttp-lwt" class="anchor"></a>Library opentelemetry-cohttp-lwt</h2><p>The entry point of this library is the module: <a href="Opentelemetry_cohttp_lwt/index.html"><code>Opentelemetry_cohttp_lwt</code></a>.</p></div></body></html>