mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
feat: add trace.stdext, with standard extensions
This commit is contained in:
parent
92d0a07168
commit
f490206538
2 changed files with 19 additions and 0 deletions
5
src/stdext/dune
Normal file
5
src/stdext/dune
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
(library
|
||||||
|
(name trace_stdext)
|
||||||
|
(public_name trace.stdext)
|
||||||
|
(synopsis "standard extensions for trace")
|
||||||
|
(libraries trace.core))
|
||||||
14
src/stdext/trace_stdext.ml
Normal file
14
src/stdext/trace_stdext.ml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
(** Standard extensions *)
|
||||||
|
|
||||||
|
open Trace_core
|
||||||
|
|
||||||
|
type extension_event +=
|
||||||
|
| Link of explicit_span * explicit_span_ctx
|
||||||
|
(** [Link (span, ctx)] establishes a link between two spans (one of which is
|
||||||
|
only known by context). The link is not a parent-child link, but a causality/relatedness link.
|
||||||
|
Each collector is free to interpret this as it wishes. *)
|
||||||
|
|
||||||
|
(** Link two spans together. *)
|
||||||
|
let[@inline] link (es:explicit_span) (ctx:explicit_span_ctx) : unit =
|
||||||
|
Trace_core.extension_event (Link (es, ctx))
|
||||||
Loading…
Add table
Reference in a new issue