mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 20:07:55 -04:00
deploy: 27d4f59523
This commit is contained in:
parent
ff0759e34d
commit
65a7c35892
7 changed files with 55 additions and 11 deletions
|
|
@ -150,9 +150,18 @@ Concrete tracing or observability formats such as:
|
|||
* [x] backend for [tldrs](https://github.com/imandra-ai/tldrs), a
|
||||
small rust daemon that aggregates TEF traces from multiple processes/clients
|
||||
into a single `.jsonl` file
|
||||
* [ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.
|
||||
* [x] [tldrs](https://github.com/imandra-ai/tldrs), to collect TEF traces from multiple processes in a clean way.
|
||||
This requires the rust `tldrs` program to be in path.
|
||||
* ~~[ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.~~ (subsumed by tldrs)
|
||||
- [x] Tracy (see [ocaml-tracy](https://github.com/imandra-ai/ocaml-tracy), more specifically `tracy-client.trace`)
|
||||
- [x] Opentelemetry (see [ocaml-opentelemetry](https://github.com/imandra-ai/ocaml-opentelemetry/), in `opentelemetry.trace`)
|
||||
- [ ] landmarks?
|
||||
- [ ] Logs (only for messages, obviously)
|
||||
|
||||
## Subscribers
|
||||
|
||||
The library `trace.subscriber` defines composable _subscribers_, which are sets of callbacks
|
||||
that consume tracing events.
|
||||
Multiple subscribers can be aggregated together (with events being dispatched to all of them)
|
||||
and be installed as a normal _collector_.
|
||||
|
|
|
|||
|
|
@ -150,9 +150,18 @@ Concrete tracing or observability formats such as:
|
|||
* [x] backend for [tldrs](https://github.com/imandra-ai/tldrs), a
|
||||
small rust daemon that aggregates TEF traces from multiple processes/clients
|
||||
into a single `.jsonl` file
|
||||
* [ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.
|
||||
* [x] [tldrs](https://github.com/imandra-ai/tldrs), to collect TEF traces from multiple processes in a clean way.
|
||||
This requires the rust `tldrs` program to be in path.
|
||||
* ~~[ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.~~ (subsumed by tldrs)
|
||||
- [x] Tracy (see [ocaml-tracy](https://github.com/imandra-ai/ocaml-tracy), more specifically `tracy-client.trace`)
|
||||
- [x] Opentelemetry (see [ocaml-opentelemetry](https://github.com/imandra-ai/ocaml-opentelemetry/), in `opentelemetry.trace`)
|
||||
- [ ] landmarks?
|
||||
- [ ] Logs (only for messages, obviously)
|
||||
|
||||
## Subscribers
|
||||
|
||||
The library `trace.subscriber` defines composable _subscribers_, which are sets of callbacks
|
||||
that consume tracing events.
|
||||
Multiple subscribers can be aggregated together (with events being dispatched to all of them)
|
||||
and be installed as a normal _collector_.
|
||||
|
|
|
|||
|
|
@ -150,9 +150,18 @@ Concrete tracing or observability formats such as:
|
|||
* [x] backend for [tldrs](https://github.com/imandra-ai/tldrs), a
|
||||
small rust daemon that aggregates TEF traces from multiple processes/clients
|
||||
into a single `.jsonl` file
|
||||
* [ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.
|
||||
* [x] [tldrs](https://github.com/imandra-ai/tldrs), to collect TEF traces from multiple processes in a clean way.
|
||||
This requires the rust `tldrs` program to be in path.
|
||||
* ~~[ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.~~ (subsumed by tldrs)
|
||||
- [x] Tracy (see [ocaml-tracy](https://github.com/imandra-ai/ocaml-tracy), more specifically `tracy-client.trace`)
|
||||
- [x] Opentelemetry (see [ocaml-opentelemetry](https://github.com/imandra-ai/ocaml-opentelemetry/), in `opentelemetry.trace`)
|
||||
- [ ] landmarks?
|
||||
- [ ] Logs (only for messages, obviously)
|
||||
|
||||
## Subscribers
|
||||
|
||||
The library `trace.subscriber` defines composable _subscribers_, which are sets of callbacks
|
||||
that consume tracing events.
|
||||
Multiple subscribers can be aggregated together (with events being dispatched to all of them)
|
||||
and be installed as a normal _collector_.
|
||||
|
|
|
|||
|
|
@ -1,2 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Callbacks (trace.Trace_subscriber.Callbacks)</title><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">trace</a> » <a href="../index.html">Trace_subscriber</a> » Callbacks</nav><header class="odoc-preamble"><h1>Module <code><span>Trace_subscriber.Callbacks</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-S"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-S/index.html">S</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>First class module signature for callbacks</p></div></div><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>'st t</span></span><span> = <span>(<span class="keyword">module</span> <a href="module-type-S/index.html">S</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="module-type-S/index.html#type-st">st</a> = <span class="type-var">'st</span>)</span></span></code></div><div class="spec-doc"><p>Callbacks for a subscriber. There is one callback per event in <a href="../../Trace/index.html"><code>Trace</code></a>. The type <code>'st</code> is the state that is passed to every single callback.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Dummy"><a href="#module-Dummy" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Dummy/index.html">Dummy</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Dummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle <b>all</b> events, but only some of them.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <span>unit <span class="arrow">-></span></span> <span><span class="type-var">'st</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>Dummy callbacks, do nothing.</p></div></div></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Callbacks (trace.Trace_subscriber.Callbacks)</title><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">trace</a> » <a href="../index.html">Trace_subscriber</a> » Callbacks</nav><header class="odoc-preamble"><h1>Module <code><span>Trace_subscriber.Callbacks</span></code></h1><p>Callbacks used for subscribers.</p><p>Each subscriber defines a set of callbacks, for each possible tracing event. These callbacks take a custom state that is paired with the callbacks in <a href="../Subscriber/index.html#type-t"><code>Subscriber.t</code></a>.</p><p>To use a default implementation for some callbacks, use:</p><pre class="language-ocaml"><code>module My_callbacks = struct
|
||||
type st = …
|
||||
|
||||
include Trace_subscriber.Callbacks.Dummy
|
||||
|
||||
let on_init (state:st) ~time_ns : unit = …
|
||||
|
||||
(* other customize callbacks *)
|
||||
end </code></pre></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-S"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-S/index.html">S</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>First class module signature for callbacks</p></div></div><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>'st t</span></span><span> = <span>(<span class="keyword">module</span> <a href="module-type-S/index.html">S</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="module-type-S/index.html#type-st">st</a> = <span class="type-var">'st</span>)</span></span></code></div><div class="spec-doc"><p>Callbacks for a subscriber. There is one callback per event in <a href="../../Trace/index.html"><code>Trace</code></a>. The type <code>'st</code> is the state that is passed to every single callback.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Dummy"><a href="#module-Dummy" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Dummy/index.html">Dummy</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Dummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle <b>all</b> events, but only some of them.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <span>unit <span class="arrow">-></span></span> <span><span class="type-var">'st</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>Dummy callbacks, ignores all events.</p></div></div></div></body></html>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Subscriber (trace.Trace_subscriber.Subscriber)</title><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">trace</a> » <a href="../index.html">Trace_subscriber</a> » Subscriber</nav><header class="odoc-preamble"><h1>Module <code><span>Trace_subscriber.Subscriber</span></code></h1></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> t</span><span> = </span></code><ol><li id="type-t.Sub" class="def variant constructor anchored"><a href="#type-t.Sub" class="anchor"></a><code><span>| </span><span><span class="constructor">Sub</span> : </span><span>{</span></code><ol><li id="type-t.st" class="def record field anchored"><a href="#type-t.st" class="anchor"></a><code><span>st : <span class="type-var">'st</span>;</span></code></li><li id="type-t.callbacks" class="def record field anchored"><a href="#type-t.callbacks" class="anchor"></a><code><span>callbacks : <span><span class="type-var">'st</span> <a href="../Callbacks/index.html#type-t">Callbacks.t</a></span>;</span></code></li></ol><code><span>}</span><span> <span class="arrow">-></span> <a href="#type-t">t</a></span></code></li></ol></div><div class="spec-doc"><p>A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket, config, etc.).</p><p>The design goal for this is that it should be possible to avoid allocations when the trace collector calls the callbacks.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Dummy subscriber that ignores every call.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tee"><a href="#val-tee" class="anchor"></a><code><span><span class="keyword">val</span> tee : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>tee s1 s2</code> is a subscriber that forwards every call to <code>s1</code> and <code>s2</code> both.</p></div></div></div></body></html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Subscriber (trace.Trace_subscriber.Subscriber)</title><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">trace</a> » <a href="../index.html">Trace_subscriber</a> » Subscriber</nav><header class="odoc-preamble"><h1>Module <code><span>Trace_subscriber.Subscriber</span></code></h1><p>Trace subscribers</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> t</span><span> = </span></code><ol><li id="type-t.Sub" class="def variant constructor anchored"><a href="#type-t.Sub" class="anchor"></a><code><span>| </span><span><span class="constructor">Sub</span> : </span><span>{</span></code><ol><li id="type-t.st" class="def record field anchored"><a href="#type-t.st" class="anchor"></a><code><span>st : <span class="type-var">'st</span>;</span></code></li><li id="type-t.callbacks" class="def record field anchored"><a href="#type-t.callbacks" class="anchor"></a><code><span>callbacks : <span><span class="type-var">'st</span> <a href="../Callbacks/index.html#type-t">Callbacks.t</a></span>;</span></code></li></ol><code><span>}</span><span> <span class="arrow">-></span> <a href="#type-t">t</a></span></code></li></ol></div><div class="spec-doc"><p>A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).</p><p>The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Dummy subscriber that ignores every call.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tee"><a href="#val-tee" class="anchor"></a><code><span><span class="keyword">val</span> tee : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>tee s1 s2</code> is a subscriber that forwards every call to <code>s1</code> and <code>s2</code> both.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tee_l"><a href="#val-tee_l" class="anchor"></a><code><span><span class="keyword">val</span> tee_l : <span><span><a href="#type-t">t</a> list</span> <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Tee multiple subscribers, ie return a subscriber that forwards to all the subscribers in <code>subs</code>.</p></div></div></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -150,9 +150,18 @@ Concrete tracing or observability formats such as:
|
|||
* [x] backend for [tldrs](https://github.com/imandra-ai/tldrs), a
|
||||
small rust daemon that aggregates TEF traces from multiple processes/clients
|
||||
into a single `.jsonl` file
|
||||
* [ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.
|
||||
* [x] [tldrs](https://github.com/imandra-ai/tldrs), to collect TEF traces from multiple processes in a clean way.
|
||||
This requires the rust `tldrs` program to be in path.
|
||||
* ~~[ ] richer bindings with [ocaml-catapult](https://github.com/imandra-ai/catapult),
|
||||
with multi-process backends, etc.~~ (subsumed by tldrs)
|
||||
- [x] Tracy (see [ocaml-tracy](https://github.com/imandra-ai/ocaml-tracy), more specifically `tracy-client.trace`)
|
||||
- [x] Opentelemetry (see [ocaml-opentelemetry](https://github.com/imandra-ai/ocaml-opentelemetry/), in `opentelemetry.trace`)
|
||||
- [ ] landmarks?
|
||||
- [ ] Logs (only for messages, obviously)
|
||||
|
||||
## Subscribers
|
||||
|
||||
The library `trace.subscriber` defines composable _subscribers_, which are sets of callbacks
|
||||
that consume tracing events.
|
||||
Multiple subscribers can be aggregated together (with events being dispatched to all of them)
|
||||
and be installed as a normal _collector_.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue