mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
update HTTP clients
This commit is contained in:
parent
d7da4c4443
commit
b044203b79
6 changed files with 9 additions and 17 deletions
|
|
@ -56,8 +56,8 @@ struct
|
|||
Eio.Mutex.unlock self.mutex
|
||||
|
||||
(** Ensure we get signalled when the queue goes from empty to non-empty *)
|
||||
let register_bounded_queue (self : t) (bq : _ Bounded_queue.t) : unit =
|
||||
Bounded_queue.on_non_empty bq (fun () -> trigger self)
|
||||
let register_bounded_queue (self : t) (bq : _ Bounded_queue.Recv.t) : unit =
|
||||
Bounded_queue.Recv.on_non_empty bq (fun () -> trigger self)
|
||||
end
|
||||
|
||||
module Httpc : Generic_http_consumer.HTTPC with module IO = IO = struct
|
||||
|
|
@ -159,7 +159,7 @@ struct
|
|||
end
|
||||
|
||||
let create_consumer ?(config = Config.make ()) ~sw ~env () :
|
||||
Consumer.any_resource_builder =
|
||||
_ Consumer.Builder.t =
|
||||
let module M = Make (struct
|
||||
let sw = sw
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ val create_consumer :
|
|||
sw:Eio.Switch.t ->
|
||||
env:Eio_unix.Stdenv.base ->
|
||||
unit ->
|
||||
Opentelemetry_client.Consumer.any_resource_builder
|
||||
Opentelemetry_client.Consumer.any_signal_l_builder
|
||||
(** Consumer that pulls from a queue *)
|
||||
|
||||
val create_exporter :
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ val set_headers : (string * string) list -> unit
|
|||
module Config = Config
|
||||
|
||||
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 *)
|
||||
|
||||
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ val set_headers : (string * string) list -> unit
|
|||
module Config = Config
|
||||
|
||||
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 *)
|
||||
|
||||
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t
|
||||
|
|
|
|||
|
|
@ -18,15 +18,7 @@ type error = OTELC.Export_error.t
|
|||
|
||||
open struct
|
||||
module Notifier = OTELC.Notifier_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
|
||||
module IO = OTELC.Io_sync
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
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 ticker_task =
|
||||
if config.ticker_thread then
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ val n_bytes_sent : unit -> int
|
|||
(** Global counter of bytes sent (or attempted to be sent) *)
|
||||
|
||||
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 *)
|
||||
|
||||
val create_exporter : ?config:Config.t -> unit -> Opentelemetry.Exporter.t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue