diff --git a/src/stdext/dune b/src/stdext/dune new file mode 100644 index 0000000..f638470 --- /dev/null +++ b/src/stdext/dune @@ -0,0 +1,5 @@ +(library + (name trace_stdext) + (public_name trace.stdext) + (synopsis "standard extensions for trace") + (libraries trace.core)) diff --git a/src/stdext/trace_stdext.ml b/src/stdext/trace_stdext.ml new file mode 100644 index 0000000..4e966f5 --- /dev/null +++ b/src/stdext/trace_stdext.ml @@ -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))