mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
parent
f8079a13ea
commit
041d05eb9f
1 changed files with 12 additions and 4 deletions
|
|
@ -200,11 +200,19 @@ module Internal = struct
|
|||
in
|
||||
|
||||
Otel.Scope.with_ambient_scope sb.scope @@ fun () ->
|
||||
let rv = cb otrace_id in
|
||||
match cb otrace_id with
|
||||
| res ->
|
||||
let otel_span = exit_span' otrace_id sb in
|
||||
Otel.Trace.emit [ otel_span ];
|
||||
res
|
||||
| exception e ->
|
||||
let bt = Printexc.get_raw_backtrace () in
|
||||
|
||||
let otel_span = exit_span' otrace_id sb in
|
||||
Otel.Trace.emit [ otel_span ];
|
||||
rv
|
||||
Otel.Scope.record_exception sb.scope e bt;
|
||||
let otel_span = exit_span' otrace_id sb in
|
||||
Otel.Trace.emit [ otel_span ];
|
||||
|
||||
Printexc.raise_with_backtrace e bt
|
||||
|
||||
let enter_span ~__FUNCTION__ ~__FILE__ ~__LINE__ ~data name :
|
||||
Trace_core.span =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue