mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-09 12:23:32 -04:00
fix: perfetto does not render Sync spans as children of Async spans
This commit is contained in:
parent
75fc4968fc
commit
f5c263e23f
2 changed files with 5 additions and 4 deletions
|
|
@ -45,10 +45,10 @@ let[@inline never] with_span_real_ ?parent ?(force_toplevel = false)
|
|||
let espan =
|
||||
match parent, force_toplevel with
|
||||
| _, true | None, _ ->
|
||||
enter_manual_toplevel_span ~flavor:`Sync ?__FUNCTION__ ~__FILE__ ~__LINE__
|
||||
?data name
|
||||
enter_manual_toplevel_span ~flavor:`Async ?__FUNCTION__ ~__FILE__
|
||||
~__LINE__ ?data name
|
||||
| Some parent, _ ->
|
||||
enter_manual_sub_span ~parent ~flavor:`Sync ?__FUNCTION__ ~__FILE__
|
||||
enter_manual_sub_span ~parent ~flavor:`Async ?__FUNCTION__ ~__FILE__
|
||||
~__LINE__ ?data name
|
||||
in
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ val with_span :
|
|||
'a
|
||||
(** [with_span ~__FILE__ ~__LINE__ name f] calls [f span]
|
||||
where [span] is a new span named with [name]. The span is
|
||||
traced as being synchronous.
|
||||
traced as being asynchronous, so each collector might represent
|
||||
it differently.
|
||||
|
||||
If [f] returns an ['a Lwt.t] future, use [with_span_lwt] instead.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue