mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
rename Client_config to Http_config
more accurate, really.
This commit is contained in:
parent
dfb0befab0
commit
09e4620603
12 changed files with 42 additions and 38 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
Loading…
Add table
Reference in a new issue