mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
fix: emit traces, too
This commit is contained in:
parent
3f3a39eee7
commit
2c1c67bfe8
1 changed files with 6 additions and 4 deletions
|
|
@ -399,22 +399,24 @@ let mk_emitter ~(config:Config.t) () : (module EMITTER) =
|
|||
if force || (not force && E_metrics.is_big_enough ()) then (
|
||||
let batch = ref [AList.pop_all gc_metrics] in
|
||||
E_metrics.pop_iter_all (fun l -> batch := l :: !batch);
|
||||
if not (batch_is_empty !batch) then (
|
||||
let do_something = not (l_is_empty !batch) in
|
||||
if do_something then (
|
||||
send_metrics_http !batch;
|
||||
);
|
||||
Atomic.set last_wakeup (Mtime_clock.now());
|
||||
true
|
||||
do_something
|
||||
) else false
|
||||
in
|
||||
let emit_traces ?(force=false) () : bool =
|
||||
if force || (not force && E_trace.is_big_enough ()) then (
|
||||
let batch = ref [] in
|
||||
E_trace.pop_iter_all (fun l -> batch := l :: !batch);
|
||||
if not (l_is_empty !batch) then (
|
||||
let do_something = not (l_is_empty !batch) in
|
||||
if do_something then (
|
||||
send_traces_http !batch;
|
||||
);
|
||||
Atomic.set last_wakeup (Mtime_clock.now());
|
||||
true
|
||||
do_something
|
||||
) else false
|
||||
in
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue