From 1680cd6a42b275356cda3ff6adc2debee03a2a8c Mon Sep 17 00:00:00 2001 From: c-cube Date: Sat, 12 Jul 2025 04:26:53 +0000 Subject: [PATCH] deploy: a5af3c9b6563a3808ec5ea4248a5487057549246 --- logs/_doc-dir/CHANGES.md | 16 ++++++++++++++++ logs/_doc-dir/README.md | 12 +++--------- logs/_doc-dir/odoc-pages/index.mld | 2 +- .../Opentelemetry_client/Batch/index.html | 8 ++++++++ .../Opentelemetry_client/Config/index.html | 4 ++-- .../Signal/Decode/index.html | 2 ++ .../Signal/{Converter => Encode}/index.html | 4 ++-- .../Opentelemetry_client/Signal/Pp/index.html | 11 +++++++++++ .../Opentelemetry_client/Signal/index.html | 2 +- opentelemetry/Opentelemetry_client/index.html | 2 +- .../Opentelemetry_client__Batch/index.html | 2 ++ 11 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 opentelemetry/Opentelemetry_client/Batch/index.html create mode 100644 opentelemetry/Opentelemetry_client/Signal/Decode/index.html rename opentelemetry/Opentelemetry_client/Signal/{Converter => Encode}/index.html (56%) create mode 100644 opentelemetry/Opentelemetry_client/Signal/Pp/index.html create mode 100644 opentelemetry/Opentelemetry_client__Batch/index.html diff --git a/logs/_doc-dir/CHANGES.md b/logs/_doc-dir/CHANGES.md index fcc38d8e..ce6f2525 100644 --- a/logs/_doc-dir/CHANGES.md +++ b/logs/_doc-dir/CHANGES.md @@ -1,3 +1,19 @@ +v0.9.0 2025-07-08 Zagreb +------------------------ + +* Replace references and mutable fields by atomic references to avoid + race conditions (#56). Thanks to Nathan Taylor for reporting. +* Fix `Logs.{err,warn}_count`. The counts were counting the reports + not the logs which is not what the spec says. This means the counts + were wrong when the reporting level was below the corresponding + level (#55). Thanks to Mathieu Barbin for the report. +* Fix `Log.Tag.list` always returning the empty list. +* `Logs.format_reporter` and `Logs_fmt.reporter` replace a few format + strings and `^^` uses by direct calls to `Format` primitives. +* Requires OCaml >= 4.14. +* Use Format.pp_print_text instead of your own. +* Export `logs` from each sub library. + v0.8.0 2025-03-10 La Forclaz (VS) --------------------------------- diff --git a/logs/_doc-dir/README.md b/logs/_doc-dir/README.md index bb3adc25..89605a06 100644 --- a/logs/_doc-dir/README.md +++ b/logs/_doc-dir/README.md @@ -1,6 +1,5 @@ Logs — Logging infrastructure for OCaml -------------------------------------------------------------------------------- -v0.8.0 +======================================= Logs provides a logging infrastructure for OCaml. Logging is performed on sources whose reporting level can be set independently. Log message @@ -24,7 +23,7 @@ Logs and its reporters are distributed under the ISC license. [cmdliner]: http://erratique.ch/software/cmdliner [lwt]: http://ocsigen.org/lwt/ -Home page: http://erratique.ch/software/logs +Home page: ## Installation @@ -46,12 +45,7 @@ than on the issue tracker. [doc]: https://erratique.ch/software/logs/doc [ocaml-forum]: https://discuss.ocaml.org/ - -[doc]: http://erratique.ch/software/logs/doc/ - ## Sample programs -If you installed Logs with `opam` sample programs are located in -the directory `opam config var logs:doc`. - +A few tests can be found in the [`test`](test/) directory. diff --git a/logs/_doc-dir/odoc-pages/index.mld b/logs/_doc-dir/odoc-pages/index.mld index e4b7f6d4..76d2804c 100644 --- a/logs/_doc-dir/odoc-pages/index.mld +++ b/logs/_doc-dir/odoc-pages/index.mld @@ -1,4 +1,4 @@ -{0 Logs {%html: v0.8.0%}} +{0 Logs {%html: v0.9.0%}} Logs provides a logging infrastructure. diff --git a/opentelemetry/Opentelemetry_client/Batch/index.html b/opentelemetry/Opentelemetry_client/Batch/index.html new file mode 100644 index 00000000..11c48566 --- /dev/null +++ b/opentelemetry/Opentelemetry_client/Batch/index.html @@ -0,0 +1,8 @@ + +Batch (opentelemetry.Opentelemetry_client.Batch)

Module Opentelemetry_client.Batch

A thread-safe batch of resources to be popper when ready .

type 'a t
val make : + ?batch:int -> + ?high_watermark:int -> + ?now:Mtime.t -> + ?timeout:Mtime.span -> + unit -> + 'a t

make () is a new batch

  • parameter batch

    the number of elements after which the batch will be considered full, and ready to pop. Set to 0 to disable batching. It is required that batch >= 0. Default 1.

  • parameter high_watermark

    the batch size limit after which new elements will be `Dropped by push. This prevents the queue from growing too fast for effective transmission in case of signal floods. Default if batch = 1 then 100 else batch * 10.

  • parameter now

    the current time. Default Mtime_clock.now ().

  • parameter timeout

    the time span after which a batch is ready to pop, whether or not it is full.

val pop_if_ready : ?force:bool -> now:Mtime.t -> 'a t -> 'a list option

pop_if_ready ~now b is Some xs, where is xs includes all the elements pushed since the last batch, if the batch ready to be emitted.

A batch is ready to pop if it contains some elements and

  • batching is disabled, and any elements have been batched, or batching was enabled and at least batch elements have been pushed, or
  • a timeout was provided, and more than a timeout span has passed since the last pop was ready, or
  • the pop is forced,
  • parameter now

    the current time

  • parameter force

    override the other batch conditions, for when when we just want to emit batches before exit or because the user asks for it

val push : 'a t -> 'a list -> [ `Dropped | `Ok ]

push b xs is `Ok if it succeeds in pushing the values in xs into the batch b, or `Dropped if the current size of the batch has exceeded the high water mark determined by the batch argument to make]. )

diff --git a/opentelemetry/Opentelemetry_client/Config/index.html b/opentelemetry/Opentelemetry_client/Config/index.html index 0173a7b9..85797779 100644 --- a/opentelemetry/Opentelemetry_client/Config/index.html +++ b/opentelemetry/Opentelemetry_client/Config/index.html @@ -1,5 +1,5 @@ -Config (opentelemetry.Opentelemetry_client.Config)

Module Opentelemetry_client.Config

Constructing and managing the configuration needed in common by all clients

type t = private {
  1. debug : bool;
  2. url_traces : string;
    (*

    Url to send traces

    *)
  3. url_metrics : string;
    (*

    Url to send metrics

    *)
  4. url_logs : string;
    (*

    Url to send logs

    *)
  5. headers : (string * string) list;
    (*

    API headers sent to the endpoint. Default is none or "OTEL_EXPORTER_OTLP_HEADERS" if set.

    *)
  6. batch_traces : int option;
    (*

    Batch traces? If Some i, then this produces batches of (at most) i items. If None, there is no batching.

    Note that traces and metrics are batched separately. Default Some 400.

    *)
  7. batch_metrics : int option;
    (*

    Batch metrics? If Some i, then this produces batches of (at most) i items. If None, there is no batching.

    Note that traces and metrics are batched separately. Default None.

    *)
  8. batch_logs : int option;
    (*

    Batch logs? See batch_metrics for details. Default Some 400

    *)
  9. batch_timeout_ms : int;
    (*

    Number of milliseconds after which we will emit a batch, even incomplete. Note that the batch might take longer than that, because this is only checked when a new event occurs or when a tick is emitted. Default 2_000.

    *)
  10. self_trace : bool;
    (*

    If true, the OTEL library will also emit its own spans. Default false.

    • since 0.7
    *)
}

Configuration.

To build one, use make below. This might be extended with more fields in the future.

val pp : Stdlib.Format.formatter -> t -> unit
type 'k make = +Config (opentelemetry.Opentelemetry_client.Config)

Module Opentelemetry_client.Config

Constructing and managing the configuration needed in common by all clients

type t = private {
  1. debug : bool;
  2. url_traces : string;
    (*

    Url to send traces

    *)
  3. url_metrics : string;
    (*

    Url to send metrics

    *)
  4. url_logs : string;
    (*

    Url to send logs

    *)
  5. headers : (string * string) list;
    (*

    API headers sent to the endpoint. Default is none or "OTEL_EXPORTER_OTLP_HEADERS" if set.

    *)
  6. batch_traces : int option;
    (*

    Batch traces? If Some i, then this produces batches of (at most) i items. If None, there is no batching.

    Note that traces and metrics are batched separately. Default Some 400.

    *)
  7. batch_metrics : int option;
    (*

    Batch metrics? If Some i, then this produces batches of (at most) i items. If None, there is no batching.

    Note that traces and metrics are batched separately. Default None.

    *)
  8. batch_logs : int option;
    (*

    Batch logs? See batch_metrics for details. Default Some 400

    *)
  9. batch_timeout_ms : int;
    (*

    Number of milliseconds after which we will emit a batch, even incomplete. Note that the batch might take longer than that, because this is only checked when a new event occurs or when a tick is emitted. Default 2_000.

    *)
  10. self_trace : bool;
    (*

    If true, the OTEL library will also emit its own spans. Default false.

    • since 0.7
    *)
}

Configuration.

To build one, use make below. This might be extended with more fields in the future.

val default_url : string

The default base URL for the config.

val pp : Stdlib.Format.formatter -> t -> unit
type 'k make = ?debug:bool -> ?url:string -> ?url_traces:string -> @@ -11,4 +11,4 @@ ?headers:(string * string) list -> ?batch_timeout_ms:int -> ?self_trace:bool -> - 'k

A function that gathers all the values needed to construct a t, and produces a 'k. 'k is typically a continuation used to construct a configuration that includes a t.

  • parameter url

    base url used to construct per-signal urls. Per-signal url options take precedence over this base url. Default is "http://localhost:4318", or "OTEL_EXPORTER_OTLP_ENDPOINT" if set.

Example of constructed per-signal urls with the base url http://localhost:4318

  • Traces: http://localhost:4318/v1/traces
  • Metrics: http://localhost:4318/v1/metrics
  • Logs: http://localhost:4318/v1/logs

Use per-signal url options if different urls are needed for each signal type.

  • parameter url_traces

    url to send traces, or "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" if set. The url is used as-is without any modification.

  • parameter url_metrics

    url to send metrics, or "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" if set. The url is used as-is without any modification.

  • parameter url_logs

    url to send logs, or "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT" if set. The url is used as-is without any modification.

module type ENV = sig ... end

Construct, inspect, and update t configurations, drawing defaults from the environment and encapsulating state

module Env () : ENV

A generative functor that produces a state-space that can read configuration values from the environment, provide stateful configuration setting and accessing operations, and a way to make a new t configuration record

+ 'k

A function that gathers all the values needed to construct a t, and produces a 'k. 'k is typically a continuation used to construct a configuration that includes a t.

  • parameter url

    base url used to construct per-signal urls. Per-signal url options take precedence over this base url. If not provided, this defaults to "OTEL_EXPORTER_OTLP_ENDPOINT" if set, or if not default_url.

Example of constructed per-signal urls with the base url http://localhost:4318

  • Traces: http://localhost:4318/v1/traces
  • Metrics: http://localhost:4318/v1/metrics
  • Logs: http://localhost:4318/v1/logs

Use per-signal url options if different urls are needed for each signal type.

  • parameter url_traces

    url to send traces, or "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" if set. The url is used as-is without any modification.

  • parameter url_metrics

    url to send metrics, or "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" if set. The url is used as-is without any modification.

  • parameter url_logs

    url to send logs, or "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT" if set. The url is used as-is without any modification.

module type ENV = sig ... end

Construct, inspect, and update t configurations, drawing defaults from the environment and encapsulating state

module Env () : ENV

A generative functor that produces a state-space that can read configuration values from the environment, provide stateful configuration setting and accessing operations, and a way to make a new t configuration record

diff --git a/opentelemetry/Opentelemetry_client/Signal/Decode/index.html b/opentelemetry/Opentelemetry_client/Signal/Decode/index.html new file mode 100644 index 00000000..9bdd1da5 --- /dev/null +++ b/opentelemetry/Opentelemetry_client/Signal/Decode/index.html @@ -0,0 +1,2 @@ + +Decode (opentelemetry.Opentelemetry_client.Signal.Decode)

Module Signal.Decode

Decode signals from protobuf encoded strings, received over the wire

val logs : string -> Opentelemetry_proto.Logs.resource_logs list

logs s is a list of log resources decoded from the protobuf encoded string s.

metrics s is a list of metrics resources decoded from the protobuf encoded string s.

val traces : string -> Opentelemetry_proto.Trace.resource_spans list

traces s is a list of span resources decoded from the protobuf encoded string s.

diff --git a/opentelemetry/Opentelemetry_client/Signal/Converter/index.html b/opentelemetry/Opentelemetry_client/Signal/Encode/index.html similarity index 56% rename from opentelemetry/Opentelemetry_client/Signal/Converter/index.html rename to opentelemetry/Opentelemetry_client/Signal/Encode/index.html index 1864ea01..b847630b 100644 --- a/opentelemetry/Opentelemetry_client/Signal/Converter/index.html +++ b/opentelemetry/Opentelemetry_client/Signal/Encode/index.html @@ -1,5 +1,5 @@ -Converter (opentelemetry.Opentelemetry_client.Signal.Converter)

Module Signal.Converter

Convert signals to protobuf encoded strings, ready to be sent over the wire

NOTE: The converters share an underlying stateful encoder, so each domain or system thread should have its own Converter instance

val logs : +Encode (opentelemetry.Opentelemetry_client.Signal.Encode)

Module Signal.Encode

Encode signals to protobuf encoded strings, ready to be sent over the wire

val logs : ?encoder:Pbrt.Encoder.t -> Opentelemetry_proto.Logs.resource_logs list -> string

logs ls is a protobuf encoded string of the logs ls

  • parameter encoder

    provide an encoder state to reuse

val metrics : @@ -8,4 +8,4 @@ string

metrics ms is a protobuf encoded string of the metrics ms

  • parameter encoder

    provide an encoder state to reuse

val traces : ?encoder:Pbrt.Encoder.t -> Opentelemetry_proto.Trace.resource_spans list -> - string

metrics ts is a protobuf encoded string of the traces ts

  • parameter encoder

    provide an encoder state to reuse

+ string

traces ts is a protobuf encoded string of the traces ts

  • parameter encoder

    provide an encoder state to reuse

diff --git a/opentelemetry/Opentelemetry_client/Signal/Pp/index.html b/opentelemetry/Opentelemetry_client/Signal/Pp/index.html new file mode 100644 index 00000000..b54bd3de --- /dev/null +++ b/opentelemetry/Opentelemetry_client/Signal/Pp/index.html @@ -0,0 +1,11 @@ + +Pp (opentelemetry.Opentelemetry_client.Signal.Pp)

Module Signal.Pp

diff --git a/opentelemetry/Opentelemetry_client/Signal/index.html b/opentelemetry/Opentelemetry_client/Signal/index.html index dc179bc9..71722464 100644 --- a/opentelemetry/Opentelemetry_client/Signal/index.html +++ b/opentelemetry/Opentelemetry_client/Signal/index.html @@ -1,2 +1,2 @@ -Signal (opentelemetry.Opentelemetry_client.Signal)

Module Opentelemetry_client.Signal

Constructing and managing OTel signals

module Converter : sig ... end

Convert signals to protobuf encoded strings, ready to be sent over the wire

+Signal (opentelemetry.Opentelemetry_client.Signal)

Module Opentelemetry_client.Signal

Constructing and managing OTel signals

The type of signals

This is not the principle type of signals from the perspective of what gets encoded and sent via protocl buffers, but it is the principle type that collector clients needs to reason about.

val to_traces : t -> Opentelemetry_proto.Trace.resource_spans list option
val to_metrics : t -> Opentelemetry_proto.Metrics.resource_metrics list option
val to_logs : t -> Opentelemetry_proto.Logs.resource_logs list option
val is_traces : t -> bool
val is_metrics : t -> bool
val is_logs : t -> bool
module Encode : sig ... end

Encode signals to protobuf encoded strings, ready to be sent over the wire

module Decode : sig ... end

Decode signals from protobuf encoded strings, received over the wire

module Pp : sig ... end
diff --git a/opentelemetry/Opentelemetry_client/index.html b/opentelemetry/Opentelemetry_client/index.html index bdeebe40..46fd48d4 100644 --- a/opentelemetry/Opentelemetry_client/index.html +++ b/opentelemetry/Opentelemetry_client/index.html @@ -1,2 +1,2 @@ -Opentelemetry_client (opentelemetry.Opentelemetry_client)

Module Opentelemetry_client

module Client : sig ... end

Utilities for writing clients

module Config : sig ... end

Constructing and managing the configuration needed in common by all clients

module Self_trace : sig ... end

Mini tracing module (disabled if config.self_trace=false)

module Signal : sig ... end

Constructing and managing OTel signals

+Opentelemetry_client (opentelemetry.Opentelemetry_client)

Module Opentelemetry_client

module Batch : sig ... end

A thread-safe batch of resources to be popper when ready .

module Client : sig ... end

Utilities for writing clients

module Config : sig ... end

Constructing and managing the configuration needed in common by all clients

module Self_trace : sig ... end

Mini tracing module (disabled if config.self_trace=false)

module Signal : sig ... end

Constructing and managing OTel signals

diff --git a/opentelemetry/Opentelemetry_client__Batch/index.html b/opentelemetry/Opentelemetry_client__Batch/index.html new file mode 100644 index 00000000..74562a25 --- /dev/null +++ b/opentelemetry/Opentelemetry_client__Batch/index.html @@ -0,0 +1,2 @@ + +Opentelemetry_client__Batch (opentelemetry.Opentelemetry_client__Batch)

Module Opentelemetry_client__Batch

This module is hidden.