Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in backends, call tick() before cleaning up #74

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/client-cohttp-lwt/opentelemetry_client_cohttp_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,8 @@ let create_backend ?(stop = Atomic.make false) ?(config = Config.make ()) () =

let setup_ ?stop ?config () =
let backend = create_backend ?stop ?config () in
let (module B : OT.Collector.BACKEND) = backend in
OT.Collector.set_backend backend;
B.cleanup
OT.Collector.remove_backend

let setup ?stop ?config ?(enable = true) () =
if enable then (
Expand Down
5 changes: 2 additions & 3 deletions src/client-ocurl/opentelemetry_client_ocurl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ let setup_ticker_thread ~stop ~sleep_ms (module B : Collector.BACKEND) () =

let setup_ ?(stop = Atomic.make false) ?(config : Config.t = Config.make ()) ()
=
let ((module B) as backend) = create_backend ~stop ~config () in
let backend = create_backend ~stop ~config () in
Opentelemetry.Collector.set_backend backend;

Atomic.set Self_trace.enabled config.self_trace;
Expand All @@ -508,8 +508,7 @@ let setup_ ?(stop = Atomic.make false) ?(config : Config.t = Config.make ()) ()
let sleep_ms = min 60_000 (max 2 config.ticker_interval_ms) in
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
);

B.cleanup
OT.Collector.remove_backend

let setup ?stop ?config ?(enable = true) () =
if enable then (
Expand Down
Loading