diff --git a/src/client-cohttp-eio/config.ml b/src/client-cohttp-eio/config.ml index 4f3677de..ff3f0dfb 100644 --- a/src/client-cohttp-eio/config.ml +++ b/src/client-cohttp-eio/config.ml @@ -1,7 +1,7 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t -module Env = Opentelemetry_client.Client_config.Env () +module Env = Opentelemetry_client.Http_config.Env () -let pp = Opentelemetry_client.Client_config.pp +let pp = Opentelemetry_client.Http_config.pp let make = Env.make (fun common () -> common) diff --git a/src/client-cohttp-eio/config.mli b/src/client-cohttp-eio/config.mli index dff28732..624c866e 100644 --- a/src/client-cohttp-eio/config.mli +++ b/src/client-cohttp-eio/config.mli @@ -1,4 +1,4 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t (** Configuration. To build one, use {!make} below. This might be extended with more fields in @@ -6,7 +6,7 @@ type t = Opentelemetry_client.Client_config.t val pp : Format.formatter -> t -> unit -val make : (unit -> t) Opentelemetry_client.Client_config.make +val make : (unit -> t) Opentelemetry_client.Http_config.make (** Make a configuration {!t}. *) -module Env : Opentelemetry_client.Client_config.ENV +module Env : Opentelemetry_client.Http_config.ENV diff --git a/src/client-cohttp-lwt/config.ml b/src/client-cohttp-lwt/config.ml index 4f3677de..ff3f0dfb 100644 --- a/src/client-cohttp-lwt/config.ml +++ b/src/client-cohttp-lwt/config.ml @@ -1,7 +1,7 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t -module Env = Opentelemetry_client.Client_config.Env () +module Env = Opentelemetry_client.Http_config.Env () -let pp = Opentelemetry_client.Client_config.pp +let pp = Opentelemetry_client.Http_config.pp let make = Env.make (fun common () -> common) diff --git a/src/client-cohttp-lwt/config.mli b/src/client-cohttp-lwt/config.mli index dff28732..624c866e 100644 --- a/src/client-cohttp-lwt/config.mli +++ b/src/client-cohttp-lwt/config.mli @@ -1,4 +1,4 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t (** Configuration. To build one, use {!make} below. This might be extended with more fields in @@ -6,7 +6,7 @@ type t = Opentelemetry_client.Client_config.t val pp : Format.formatter -> t -> unit -val make : (unit -> t) Opentelemetry_client.Client_config.make +val make : (unit -> t) Opentelemetry_client.Http_config.make (** Make a configuration {!t}. *) -module Env : Opentelemetry_client.Client_config.ENV +module Env : Opentelemetry_client.Http_config.ENV diff --git a/src/client-ocurl-lwt/config.ml b/src/client-ocurl-lwt/config.ml index 4f3677de..ff3f0dfb 100644 --- a/src/client-ocurl-lwt/config.ml +++ b/src/client-ocurl-lwt/config.ml @@ -1,7 +1,7 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t -module Env = Opentelemetry_client.Client_config.Env () +module Env = Opentelemetry_client.Http_config.Env () -let pp = Opentelemetry_client.Client_config.pp +let pp = Opentelemetry_client.Http_config.pp let make = Env.make (fun common () -> common) diff --git a/src/client-ocurl-lwt/config.mli b/src/client-ocurl-lwt/config.mli index dff28732..624c866e 100644 --- a/src/client-ocurl-lwt/config.mli +++ b/src/client-ocurl-lwt/config.mli @@ -1,4 +1,4 @@ -type t = Opentelemetry_client.Client_config.t +type t = Opentelemetry_client.Http_config.t (** Configuration. To build one, use {!make} below. This might be extended with more fields in @@ -6,7 +6,7 @@ type t = Opentelemetry_client.Client_config.t val pp : Format.formatter -> t -> unit -val make : (unit -> t) Opentelemetry_client.Client_config.make +val make : (unit -> t) Opentelemetry_client.Http_config.make (** Make a configuration {!t}. *) -module Env : Opentelemetry_client.Client_config.ENV +module Env : Opentelemetry_client.Http_config.ENV diff --git a/src/client-ocurl/config.ml b/src/client-ocurl/config.ml index e06ebf7e..be9085ea 100644 --- a/src/client-ocurl/config.ml +++ b/src/client-ocurl/config.ml @@ -12,7 +12,7 @@ type t = { [ticker_thread] is [true]. This will be clamped between [2 ms] and some longer interval (maximum [60s] currently). Default 500. @since 0.7 *) - common: Client_config.t; + common: Http_config.t; (** Common configuration options @since 0.12*) } @@ -22,9 +22,9 @@ let pp out self = Format.fprintf out "{@[ bg_threads=%d;@ ticker_thread=%B;@ ticker_interval_ms=%d;@ common=%a \ @]}" - bg_threads ticker_thread ticker_interval_ms Client_config.pp common + bg_threads ticker_thread ticker_interval_ms Http_config.pp common -module Env = Client_config.Env () +module Env = Http_config.Env () let make = Env.make diff --git a/src/client-ocurl/config.mli b/src/client-ocurl/config.mli index 7726de12..c5b19e6d 100644 --- a/src/client-ocurl/config.mli +++ b/src/client-ocurl/config.mli @@ -12,7 +12,7 @@ type t = { [ticker_thread] is [true]. This will be clamped between [2 ms] and some longer interval (maximum [60s] currently). Default 500. @since 0.7 *) - common: Opentelemetry_client.Client_config.t; + common: Opentelemetry_client.Http_config.t; (** Common configuration options @since 0.12*) } @@ -29,7 +29,7 @@ val make : ?ticker_interval_ms:int -> unit -> t) - Opentelemetry_client.Client_config.make + Opentelemetry_client.Http_config.make (** Make a configuration {!t}. *) -module Env : Opentelemetry_client.Client_config.ENV +module Env : Opentelemetry_client.Http_config.ENV diff --git a/src/client/exporter_add_batching.ml b/src/client/exporter_add_batching.ml index 0c4766fb..0f2f68ca 100644 --- a/src/client/exporter_add_batching.ml +++ b/src/client/exporter_add_batching.ml @@ -10,7 +10,7 @@ open struct end (** Given an exporter, add batches for each emitter according to [config]. *) -let add_batching ~(config : Client_config.t) (exp : OTEL.Exporter.t) : +let add_batching ~(config : Http_config.t) (exp : OTEL.Exporter.t) : OTEL.Exporter.t = let timeout = Mtime.Span.(config.batch_timeout_ms * ms) in let add_batch_opt (b : int option) e = diff --git a/src/client/generic_http_consumer.ml b/src/client/generic_http_consumer.ml index 9c8ef396..60d77bad 100644 --- a/src/client/generic_http_consumer.ml +++ b/src/client/generic_http_consumer.ml @@ -31,7 +31,7 @@ module Make val consumer : ?override_n_workers:int -> ticker_task:float option -> - config:Client_config.t -> + config:Http_config.t -> unit -> Consumer.any_signal_l_builder (** Make a consumer builder, ie. a builder function that will take a bounded @@ -42,19 +42,18 @@ module Make seconds, or [None] to not start such a task at all. *) end = struct module Sender : - Generic_consumer.SENDER - with module IO = IO - and type config = Client_config.t = struct + Generic_consumer.SENDER with module IO = IO and type config = Http_config.t = + struct module IO = IO + type config = Http_config.t + type t = { - config: Client_config.t; + config: config; encoder: Pbrt.Encoder.t; http: Httpc.t; } - type config = Client_config.t - let create ~config () : t = { config; http = Httpc.create (); encoder = Pbrt.Encoder.create () } @@ -77,7 +76,7 @@ end = struct let default_n_workers = 50 - let consumer ?override_n_workers ~ticker_task ~(config : Client_config.t) () : + let consumer ?override_n_workers ~ticker_task ~(config : Http_config.t) () : Consumer.any_signal_l_builder = let n_workers = min 2 diff --git a/src/client/client_config.ml b/src/client/http_config.ml similarity index 100% rename from src/client/client_config.ml rename to src/client/http_config.ml diff --git a/src/client/client_config.mli b/src/client/http_config.mli similarity index 90% rename from src/client/client_config.mli rename to src/client/http_config.mli index 913642f4..cdc48de7 100644 --- a/src/client/client_config.mli +++ b/src/client/http_config.mli @@ -1,9 +1,12 @@ -(** Constructing and managing the configuration needed in common by all clients -*) +(** Constructing and managing the configuration common to many (most?) + HTTP-based clients. + + This is extended and reused by concrete client implementations that exports + signals over HTTP, depending on their needs. *) type t = private { - debug: bool; - url_traces: string; (** Url to send traces *) + debug: bool; (** Debug the client itself? *) + url_traces: string; (** Url to send traces/spans *) url_metrics: string; (** Url to send metrics*) url_logs: string; (** Url to send logs *) headers: (string * string) list; @@ -33,7 +36,9 @@ type t = private { Default [false]. @since 0.7 *) http_concurrency_level: int option; - (** How many HTTP requests can be done simultaneously (at most)? + (** How many HTTP requests can be done simultaneously (at most)? This can + be used to represent the size of a pool of workers where each worker + gets a batch to send, send it, and repeats. @since NEXT_RELEASE *) } (** Configuration.