mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 20:33:36 -04:00
2 lines
No EOL
3.8 KiB
HTML
2 lines
No EOL
3.8 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Scope (opentelemetry.Opentelemetry.Scope)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><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> » <a href="../index.html">Opentelemetry</a> » Scope</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry.Scope</span></code></h1><p>Scopes.</p><p>A scope is a trace ID and the span ID of the currently active span.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = </span><span>{</span></code><table><tr id="type-t.trace_id" class="anchored"><td class="def record field"><a href="#type-t.trace_id" class="anchor"></a><code><span>trace_id : <a href="../Trace_id/index.html#type-t">Trace_id.t</a>;</span></code></td></tr><tr id="type-t.span_id" class="anchored"><td class="def record field"><a href="#type-t.span_id" class="anchor"></a><code><span>span_id : <a href="../Span_id/index.html#type-t">Span_id.t</a>;</span></code></td></tr><tr id="type-t.events" class="anchored"><td class="def record field"><a href="#type-t.events" class="anchor"></a><code><span><span class="keyword">mutable</span> events : <span><a href="../Event/index.html#type-t">Event.t</a> list</span>;</span></code></td></tr><tr id="type-t.attrs" class="anchored"><td class="def record field"><a href="#type-t.attrs" class="anchor"></a><code><span><span class="keyword">mutable</span> attrs : <span><a href="../index.html#type-key_value">key_value</a> list</span>;</span></code></td></tr></table><code><span>}</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-add_event" class="anchored"><a href="#val-add_event" class="anchor"></a><code><span><span class="keyword">val</span> add_event : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><span>( <span>unit <span class="arrow">-></span></span> <a href="../Event/index.html#type-t">Event.t</a> )</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Add an event to the scope. It will be aggregated into the span.</p><p>Note that this takes a function that produces an event, and will only call it if there is an instrumentation backend.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-add_attrs" class="anchored"><a href="#val-add_attrs" class="anchor"></a><code><span><span class="keyword">val</span> add_attrs : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><span>( <span>unit <span class="arrow">-></span></span> <span><a href="../index.html#type-key_value">key_value</a> list</span> )</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Add an attr to the scope. It will be aggregated into the span.</p><p>Note that this takes a function that produces attributes, and will only call it if there is an instrumentation backend.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-get_surrounding" class="anchored"><a href="#val-get_surrounding" class="anchor"></a><code><span><span class="keyword">val</span> get_surrounding : <span>?scope:<a href="#type-t">t</a> <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <span><a href="#type-t">t</a> option</span></span></code></div><div class="spec-doc"><p>Obtain current scope from thread-local storage, if available</p></div></div></div></body></html> |