update HTTP clients

This commit is contained in:
Simon Cruanes 2025-12-08 20:07:18 -05:00
parent d7da4c4443
commit b044203b79
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
6 changed files with 9 additions and 17 deletions

View file

@ -56,8 +56,8 @@ struct
Eio.Mutex.unlock self.mutex Eio.Mutex.unlock self.mutex
(** Ensure we get signalled when the queue goes from empty to non-empty *) (** Ensure we get signalled when the queue goes from empty to non-empty *)
let register_bounded_queue (self : t) (bq : _ Bounded_queue.t) : unit = let register_bounded_queue (self : t) (bq : _ Bounded_queue.Recv.t) : unit =
Bounded_queue.on_non_empty bq (fun () -> trigger self) Bounded_queue.Recv.on_non_empty bq (fun () -> trigger self)
end end
module Httpc : Generic_http_consumer.HTTPC with module IO = IO = struct module Httpc : Generic_http_consumer.HTTPC with module IO = IO = struct
@ -159,7 +159,7 @@ struct
end end
let create_consumer ?(config = Config.make ()) ~sw ~env () : let create_consumer ?(config = Config.make ()) ~sw ~env () :
Consumer.any_resource_builder = _ Consumer.Builder.t =
let module M = Make (struct let module M = Make (struct
let sw = sw let sw = sw

View file

@ -15,7 +15,7 @@ val create_consumer :
sw:Eio.Switch.t -> sw:Eio.Switch.t ->
env:Eio_unix.Stdenv.base -> env:Eio_unix.Stdenv.base ->
unit -> unit ->
Opentelemetry_client.Consumer.any_resource_builder Opentelemetry_client.Consumer.any_signal_l_builder
(** Consumer that pulls from a queue *) (** Consumer that pulls from a queue *)
val create_exporter : val create_exporter :

View file

@ -11,7 +11,7 @@ val set_headers : (string * string) list -> unit
module Config = Config module Config = Config
val create_consumer : val create_consumer :
?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_resource_builder ?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_signal_l_builder
(** Consumer that pulls from a queue *) (** Consumer that pulls from a queue *)
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t

View file

@ -11,7 +11,7 @@ val set_headers : (string * string) list -> unit
module Config = Config module Config = Config
val create_consumer : val create_consumer :
?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_resource_builder ?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_signal_l_builder
(** Consumer that pulls from a queue *) (** Consumer that pulls from a queue *)
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t

View file

@ -18,15 +18,7 @@ type error = OTELC.Export_error.t
open struct open struct
module Notifier = OTELC.Notifier_sync module Notifier = OTELC.Notifier_sync
module IO = OTELC.Io_sync
module IO : OTELC.Generic_io.S_WITH_CONCURRENCY with type 'a t = 'a = struct
include OTELC.Generic_io.Direct_style
let sleep_s = Thread.delay
let[@inline] spawn f =
ignore (OTELC.Util_thread.start_bg_thread f : Thread.t)
end
end end
module Httpc : OTELC.Generic_http_consumer.HTTPC with module IO = IO = struct module Httpc : OTELC.Generic_http_consumer.HTTPC with module IO = IO = struct
@ -82,7 +74,7 @@ end
module Consumer_impl = OTELC.Generic_http_consumer.Make (IO) (Notifier) (Httpc) module Consumer_impl = OTELC.Generic_http_consumer.Make (IO) (Notifier) (Httpc)
let consumer ?(config = Config.make ()) () : let consumer ?(config = Config.make ()) () :
Opentelemetry_client.Consumer.any_resource_builder = Opentelemetry_client.Consumer.any_signal_l_builder =
let n_workers = max 2 (min 32 config.bg_threads) in let n_workers = max 2 (min 32 config.bg_threads) in
let ticker_task = let ticker_task =
if config.ticker_thread then if config.ticker_thread then

View file

@ -14,7 +14,7 @@ val n_bytes_sent : unit -> int
(** Global counter of bytes sent (or attempted to be sent) *) (** Global counter of bytes sent (or attempted to be sent) *)
val consumer : val consumer :
?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_resource_builder ?config:Config.t -> unit -> Opentelemetry_client.Consumer.any_signal_l_builder
(** Consumer that pulls from a queue *) (** Consumer that pulls from a queue *)
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t