prepare for 0.7

This commit is contained in:
Simon Cruanes 2024-03-08 11:59:07 -05:00
parent e76a977330
commit 62063f3f94
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
8 changed files with 27 additions and 20 deletions

View file

@ -1,4 +1,11 @@
# 0.7
- feat: add levels to `Trace_core`. Levels are similar to `logs` levels, to help control verbosity.
- add hmap as a depopt (#28)
- fix: truncate large strings in fuchsia
# 0.6 # 0.6
- add `ppx_trace` for easier instrumentation. - add `ppx_trace` for easier instrumentation.

View file

@ -2,7 +2,7 @@
(name trace) (name trace)
(generate_opam_files true) (generate_opam_files true)
(version 0.6) (version 0.7)
(source (source
(github c-cube/ocaml-trace)) (github c-cube/ocaml-trace))

View file

@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead # This file is generated by dune, edit dune-project instead
opam-version: "2.0" opam-version: "2.0"
version: "0.6" version: "0.7"
synopsis: "A ppx-based preprocessor for trace" synopsis: "A ppx-based preprocessor for trace"
maintainer: ["Simon Cruanes"] maintainer: ["Simon Cruanes"]
authors: ["Simon Cruanes"] authors: ["Simon Cruanes"]

View file

@ -6,12 +6,12 @@
down the application or overwhelm the tracing system; yet down the application or overwhelm the tracing system; yet
they might be useful in debug situations. they might be useful in debug situations.
@since NEXT_RELEASE *) @since 0.7 *)
(** Level of tracing. These levels are in increasing order, i.e if (** Level of tracing. These levels are in increasing order, i.e if
level [Debug1] is enabled, everything below it (Error, Warning, Info, etc.) level [Debug1] is enabled, everything below it (Error, Warning, Info, etc.)
are also enabled. are also enabled.
@since NEXT_RELEASE *) @since 0.7 *)
type t = type t =
| Error (** Only errors *) | Error (** Only errors *)
| Warning (** Warnings *) | Warning (** Warnings *)
@ -21,7 +21,7 @@ type t =
| Debug3 (** Maximum verbosity debugging level *) | Debug3 (** Maximum verbosity debugging level *)
| Trace (** Enable everything (default level) *) | Trace (** Enable everything (default level) *)
(** @since NEXT_RELEASE *) (** @since 0.7 *)
let to_string : t -> string = function let to_string : t -> string = function
| Error -> "error" | Error -> "error"
| Warning -> "warning" | Warning -> "warning"

View file

@ -24,12 +24,12 @@ val enabled : unit -> bool
val get_default_level : unit -> Level.t val get_default_level : unit -> Level.t
(** Current default level for spans. (** Current default level for spans.
@since NEXT_RELEASE *) @since 0.7 *)
val set_default_level : Level.t -> unit val set_default_level : Level.t -> unit
(** Set level used for spans that do not specify it. The default (** Set level used for spans that do not specify it. The default
default value is [Level.Trace]. default value is [Level.Trace].
@since NEXT_RELEASE *) @since 0.7 *)
val with_span : val with_span :
?level:Level.t -> ?level:Level.t ->
@ -47,7 +47,7 @@ val with_span :
This is the recommended way to instrument most code. This is the recommended way to instrument most code.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
{b NOTE} an important restriction is that this is only supposed to {b NOTE} an important restriction is that this is only supposed to
@ -67,7 +67,7 @@ val enter_span :
span span
(** Enter a span manually. (** Enter a span manually.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. *) Default is set via {!set_default_level}. *)
val exit_span : span -> unit val exit_span : span -> unit
@ -98,7 +98,7 @@ val enter_manual_sub_span :
start and stop on one thread, and are nested purely by their timestamp; start and stop on one thread, and are nested purely by their timestamp;
and [`Async] spans can overlap, migrate between threads, etc. (as happens in and [`Async] spans can overlap, migrate between threads, etc. (as happens in
Lwt, Eio, Async, etc.) which impacts how the collector might represent them. Lwt, Eio, Async, etc.) which impacts how the collector might represent them.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
@since 0.3 *) @since 0.3 *)
@ -115,7 +115,7 @@ val enter_manual_toplevel_span :
[explicit_span] around until it's exited with {!exit_manual_span}. [explicit_span] around until it's exited with {!exit_manual_span}.
The span can be used as a parent in {!enter_manual_sub_span}. The span can be used as a parent in {!enter_manual_sub_span}.
@param flavor see {!enter_manual_sub_span} for more details. @param flavor see {!enter_manual_sub_span} for more details.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
@since 0.3 *) @since 0.3 *)
@ -140,7 +140,7 @@ val message :
unit unit
(** [message msg] logs a message [msg] (if a collector is installed). (** [message msg] logs a message [msg] (if a collector is installed).
Additional metadata can be provided. Additional metadata can be provided.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
@param span the surrounding span, if any. This might be ignored by the collector. *) @param span the surrounding span, if any. This might be ignored by the collector. *)
@ -153,7 +153,7 @@ val messagef :
(** [messagef (fun k->k"hello %s %d!" "world" 42)] is like (** [messagef (fun k->k"hello %s %d!" "world" 42)] is like
[message "hello world 42!"] but only computes the string formatting [message "hello world 42!"] but only computes the string formatting
if a collector is installed. if a collector is installed.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. *) Default is set via {!set_default_level}. *)
val set_thread_name : string -> unit val set_thread_name : string -> unit
@ -174,7 +174,7 @@ val counter_int :
unit unit
(** Emit a counter of type [int]. Counters represent the evolution of some quantity (** Emit a counter of type [int]. Counters represent the evolution of some quantity
over time. over time.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
@param data metadata for this metric (since 0.4) *) @param data metadata for this metric (since 0.4) *)
@ -185,7 +185,7 @@ val counter_float :
float -> float ->
unit unit
(** Emit a counter of type [float]. See {!counter_int} for more details. (** Emit a counter of type [float]. See {!counter_int} for more details.
@param level optional level for this span. since NEXT_RELEASE. @param level optional level for this span. since 0.7.
Default is set via {!set_default_level}. Default is set via {!set_default_level}.
@param data metadata for this metric (since 0.4) *) @param data metadata for this metric (since 0.4) *)
@ -204,12 +204,12 @@ val setup_collector : collector -> unit
val get_current_level : unit -> Level.t val get_current_level : unit -> Level.t
(** Get current level. This is only meaningful if (** Get current level. This is only meaningful if
a collector was set up with {!setup_collector}. a collector was set up with {!setup_collector}.
@since NEXT_RELEASE *) @since 0.7 *)
val set_current_level : Level.t -> unit val set_current_level : Level.t -> unit
(** Set the current level of tracing. This only has a visible (** Set the current level of tracing. This only has a visible
effect if a collector was installed with {!setup_collector}. effect if a collector was installed with {!setup_collector}.
@since NEXT_RELEASE *) @since 0.7 *)
val shutdown : unit -> unit val shutdown : unit -> unit
(** [shutdown ()] shutdowns the current collector, if one was installed, (** [shutdown ()] shutdowns the current collector, if one was installed,

View file

@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead # This file is generated by dune, edit dune-project instead
opam-version: "2.0" opam-version: "2.0"
version: "0.6" version: "0.7"
synopsis: synopsis:
"A high-performance backend for trace, emitting a Fuchsia trace into a file" "A high-performance backend for trace, emitting a Fuchsia trace into a file"
maintainer: ["Simon Cruanes"] maintainer: ["Simon Cruanes"]

View file

@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead # This file is generated by dune, edit dune-project instead
opam-version: "2.0" opam-version: "2.0"
version: "0.6" version: "0.7"
synopsis: synopsis:
"A simple backend for trace, emitting Catapult/TEF JSON into a file" "A simple backend for trace, emitting Catapult/TEF JSON into a file"
maintainer: ["Simon Cruanes"] maintainer: ["Simon Cruanes"]

View file

@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead # This file is generated by dune, edit dune-project instead
opam-version: "2.0" opam-version: "2.0"
version: "0.6" version: "0.7"
synopsis: synopsis:
"A stub for tracing/observability, agnostic in how data is collected" "A stub for tracing/observability, agnostic in how data is collected"
maintainer: ["Simon Cruanes"] maintainer: ["Simon Cruanes"]