From d9cd7621f54325d80114fc3d5be9ff59c98f7331 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 27 May 2025 09:58:19 -0400 Subject: [PATCH] prepare for 0.10 --- CHANGES.md | 16 ++++++++++++++-- dune-project | 2 +- ppx_trace.opam | 2 +- src/core/collector.ml | 2 +- src/core/trace_core.mli | 8 ++++---- src/core/types.ml | 4 ++-- trace-fuchsia.opam | 2 +- trace-tef.opam | 2 +- trace.opam | 2 +- 9 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0d68d50..55db48f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,9 +1,21 @@ -# 0.10 (wip) +# 0.10 - breaking: manual spans now take a `explicit_span_ctx` as parent, that can potentially be transmitted across processes/machines. It also is intended to be more compatible with OTEL. -- depopt on unix for TEF timestamps +- breaking `trace.subscriber`: timestamps are `int64`ns now, not floats +- breaking `trace`: pass a `string` trace_id in manual spans, which helps + for backends such as opentelemetry. It's also useful for extensions. + +- refactor `trace-fuchsia`: full revamp of the library, modularized, using subscriber API +- refactor `trace-tef`: split into exporter,writer,subscriber, using subscriber API +- feat: add `trace.event`, useful for background threads +- feat `trace.subscriber`: add `Span_tbl`, and a depopt on picos_aux +- feat `trace.subscriber`: tee a whole array at once +- feat tef-tldrs: use EMIT_TEF_AT_EXIT +- feat `trace.subscriber`: depopt on unix for timestamps +- refactor `trace-tef`: depopt on unix for TEF timestamps + # 0.9.1 diff --git a/dune-project b/dune-project index 918951b..7c0b2c3 100644 --- a/dune-project +++ b/dune-project @@ -4,7 +4,7 @@ (generate_opam_files true) -(version 0.9.1) +(version 0.10) (source (github c-cube/ocaml-trace)) diff --git a/ppx_trace.opam b/ppx_trace.opam index cb1235b..d719385 100644 --- a/ppx_trace.opam +++ b/ppx_trace.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.9.1" +version: "0.10" synopsis: "A ppx-based preprocessor for trace" maintainer: ["Simon Cruanes"] authors: ["Simon Cruanes"] diff --git a/src/core/collector.ml b/src/core/collector.ml index 59d36d4..5e3a267 100644 --- a/src/core/collector.ml +++ b/src/core/collector.ml @@ -62,7 +62,7 @@ module type S = sig hmap in the {!explicit_span}'s [meta] field. {b NOTE} the [parent] argument is now an {!explicit_span_ctx} and not an - {!explicit_span} since NEXT_RELEASE. + {!explicit_span} since 0.10. This means that the collector doesn't need to implement contextual storage mapping {!span} to scopes, metadata, etc. on its side; everything can be diff --git a/src/core/trace_core.mli b/src/core/trace_core.mli index 966f317..1f0e04b 100644 --- a/src/core/trace_core.mli +++ b/src/core/trace_core.mli @@ -33,7 +33,7 @@ val set_default_level : Level.t -> unit val ctx_of_span : explicit_span -> explicit_span_ctx (** Turn a span into a span context. - @since NEXT_RELEASE *) + @since 0.10 *) val with_span : ?level:Level.t -> @@ -111,7 +111,7 @@ val enter_manual_span : @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. - @since NEXT_RELEASE *) + @since 0.10 *) val enter_manual_sub_span : parent:explicit_span -> @@ -124,7 +124,7 @@ val enter_manual_sub_span : string -> explicit_span [@@deprecated "use enter_manual_span"] -(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *) +(** @deprecated since 0.10, use {!enter_manual_span} *) val enter_manual_toplevel_span : ?flavor:[ `Sync | `Async ] -> @@ -136,7 +136,7 @@ val enter_manual_toplevel_span : string -> explicit_span [@@deprecated "use enter_manual_span"] -(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *) +(** @deprecated since 0.10, use {!enter_manual_span} *) val exit_manual_span : explicit_span -> unit (** Exit an explicit span. This can be on another thread, in a fiber or diff --git a/src/core/types.ml b/src/core/types.ml index 047a4eb..5b8b67c 100644 --- a/src/core/types.ml +++ b/src/core/types.ml @@ -6,7 +6,7 @@ type span = int64 type trace_id = string (** A bytestring representing a (possibly distributed) trace made of async spans. With opentelemetry this is 16 bytes. - @since NEXT_RELEASE *) + @since 0.10 *) type user_data = [ `Int of int @@ -23,7 +23,7 @@ type explicit_span_ctx = { trace_id: trace_id; (** The trace this belongs to *) } (** A context, passed around for async traces. - @since NEXT_RELEASE *) + @since 0.10 *) type explicit_span = { span: span; diff --git a/trace-fuchsia.opam b/trace-fuchsia.opam index a5fdc37..bb54651 100644 --- a/trace-fuchsia.opam +++ b/trace-fuchsia.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.9.1" +version: "0.10" synopsis: "A high-performance backend for trace, emitting a Fuchsia trace into a file" maintainer: ["Simon Cruanes"] diff --git a/trace-tef.opam b/trace-tef.opam index 52d2733..10dbd4d 100644 --- a/trace-tef.opam +++ b/trace-tef.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.9.1" +version: "0.10" synopsis: "A simple backend for trace, emitting Catapult/TEF JSON into a file" maintainer: ["Simon Cruanes"] diff --git a/trace.opam b/trace.opam index 8813330..3a18fd3 100644 --- a/trace.opam +++ b/trace.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.9.1" +version: "0.10" synopsis: "A stub for tracing/observability, agnostic in how data is collected" maintainer: ["Simon Cruanes"]