mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
rename batching modules
This commit is contained in:
parent
31aadebfd6
commit
f31062a602
8 changed files with 19 additions and 16 deletions
|
|
@ -175,7 +175,7 @@ let create_exporter ?(config = Config.make ()) ~sw ~env () =
|
|||
~high_watermark:Bounded_queue.Defaults.high_watermark ()
|
||||
in
|
||||
Exporter_queued.create ~clock:Clock.ptime_clock ~q:bq ~consumer ()
|
||||
|> Exporter_add_batching.add_batching ~config
|
||||
|> Exporter_batch.add_batching ~config
|
||||
|
||||
let create_backend = create_exporter
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ let create_exporter ?(config = Config.make ()) () =
|
|||
~high_watermark:Bounded_queue.Defaults.high_watermark ()
|
||||
in
|
||||
Exporter_queued.create ~clock:Clock.ptime_clock ~q:bq ~consumer ()
|
||||
|> Exporter_add_batching.add_batching ~config
|
||||
|> Exporter_batch.add_batching ~config
|
||||
|
||||
let create_backend = create_exporter
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ let create_exporter ?(config = Config.make ()) () =
|
|||
~high_watermark:Bounded_queue.Defaults.high_watermark ()
|
||||
in
|
||||
Exporter_queued.create ~clock:Clock.ptime_clock ~q:bq ~consumer ()
|
||||
|> Exporter_add_batching.add_batching ~config
|
||||
|> Exporter_batch.add_batching ~config
|
||||
|
||||
let create_backend = create_exporter
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ let create_exporter ?(config = Config.make ()) () : OTEL.Exporter.t =
|
|||
in
|
||||
|
||||
OTELC.Exporter_queued.create ~clock:OTEL.Clock.ptime_clock ~q:bq ~consumer ()
|
||||
|> OTELC.Exporter_add_batching.add_batching ~config:config.common
|
||||
|> OTELC.Exporter_batch.add_batching ~config:config.common
|
||||
|
||||
let create_backend = create_exporter
|
||||
|
||||
|
|
|
|||
|
|
@ -1,26 +1,19 @@
|
|||
(** Add batching to the emitters of an exporter.
|
||||
|
||||
The exporter has multiple emitters (one per signal type), this can add
|
||||
batching on top of each of them (so that they emit less frequent, larger
|
||||
batches of signals, amortizing the per-signal cost). *)
|
||||
|
||||
open Common_
|
||||
|
||||
(** Given an exporter, add batches for each emitter according to [config]. *)
|
||||
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 emit_spans =
|
||||
Emitter_add_batching.add_batching_opt ~timeout
|
||||
~batch_size:config.batch_traces exp.emit_spans
|
||||
Emitter_batch.add_batching_opt ~timeout ~batch_size:config.batch_traces
|
||||
exp.emit_spans
|
||||
in
|
||||
let emit_metrics =
|
||||
Emitter_add_batching.add_batching_opt ~timeout
|
||||
~batch_size:config.batch_metrics exp.emit_metrics
|
||||
Emitter_batch.add_batching_opt ~timeout ~batch_size:config.batch_metrics
|
||||
exp.emit_metrics
|
||||
in
|
||||
let emit_logs =
|
||||
Emitter_add_batching.add_batching_opt ~timeout ~batch_size:config.batch_logs
|
||||
Emitter_batch.add_batching_opt ~timeout ~batch_size:config.batch_logs
|
||||
exp.emit_logs
|
||||
in
|
||||
|
||||
10
src/client/exporter_batch.mli
Normal file
10
src/client/exporter_batch.mli
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(** Add batching to the emitters of an exporter.
|
||||
|
||||
The exporter has multiple emitters (one per signal type), this can add
|
||||
batching on top of each of them (so that they emit less frequent, larger
|
||||
batches of signals, amortizing the per-signal cost). *)
|
||||
|
||||
open Common_
|
||||
|
||||
val add_batching : config:Http_config.t -> OTEL.Exporter.t -> OTEL.Exporter.t
|
||||
(** Given an exporter, add batches for each emitter according to [config]. *)
|
||||
Loading…
Add table
Reference in a new issue