mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 20:07:55 -04:00
update example
This commit is contained in:
parent
619b389322
commit
9e19e323db
1 changed files with 6 additions and 2 deletions
|
|
@ -24,6 +24,12 @@ let run () =
|
||||||
"loop.inner" in
|
"loop.inner" in
|
||||||
Unix.sleepf !sleep_outer;
|
Unix.sleepf !sleep_outer;
|
||||||
|
|
||||||
|
T.Logs.(emit [
|
||||||
|
make_strf ~trace_id:scope.trace_id ~span_id:scope.span_id
|
||||||
|
~severity:Severity_number_info
|
||||||
|
"inner at %d" j
|
||||||
|
]);
|
||||||
|
|
||||||
incr i;
|
incr i;
|
||||||
|
|
||||||
(try
|
(try
|
||||||
|
|
@ -36,8 +42,6 @@ let run () =
|
||||||
Unix.sleepf !sleep_inner;
|
Unix.sleepf !sleep_inner;
|
||||||
if j=4 && !i mod 13 = 0 then failwith "oh no"; (* simulate a failure *)
|
if j=4 && !i mod 13 = 0 then failwith "oh no"; (* simulate a failure *)
|
||||||
|
|
||||||
T.Logs.(emit [make @@ `String "log"]);
|
|
||||||
|
|
||||||
T.Trace.add_event scope (fun()->T.Event.make "done with alloc");
|
T.Trace.add_event scope (fun()->T.Event.make "done with alloc");
|
||||||
with Failure _ ->
|
with Failure _ ->
|
||||||
());
|
());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue