mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 20:07:55 -04:00
in backends, call tick() before cleaning up
this helps flushing signals that are being batched. close #69
This commit is contained in:
parent
a44c5dc33a
commit
424a82c8a5
2 changed files with 10 additions and 2 deletions
|
|
@ -569,7 +569,11 @@ let setup_ ?stop ?config () =
|
||||||
let backend = create_backend ?stop ?config () in
|
let backend = create_backend ?stop ?config () in
|
||||||
let (module B : OT.Collector.BACKEND) = backend in
|
let (module B : OT.Collector.BACKEND) = backend in
|
||||||
OT.Collector.set_backend backend;
|
OT.Collector.set_backend backend;
|
||||||
B.cleanup
|
let cleanup () =
|
||||||
|
B.tick ();
|
||||||
|
B.cleanup ()
|
||||||
|
in
|
||||||
|
cleanup
|
||||||
|
|
||||||
let setup ?stop ?config ?(enable = true) () =
|
let setup ?stop ?config ?(enable = true) () =
|
||||||
if enable then (
|
if enable then (
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,11 @@ let setup_ ?(stop = Atomic.make false) ?(config : Config.t = Config.make ()) ()
|
||||||
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
|
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
|
||||||
);
|
);
|
||||||
|
|
||||||
B.cleanup
|
let cleanup () =
|
||||||
|
B.tick ();
|
||||||
|
B.cleanup ()
|
||||||
|
in
|
||||||
|
cleanup
|
||||||
|
|
||||||
let setup ?stop ?config ?(enable = true) () =
|
let setup ?stop ?config ?(enable = true) () =
|
||||||
if enable then (
|
if enable then (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue