mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-09 20:33:34 -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 =
|
let espan =
|
||||||
match parent, force_toplevel with
|
match parent, force_toplevel with
|
||||||
| _, true | None, _ ->
|
| _, true | None, _ ->
|
||||||
enter_manual_toplevel_span ~flavor:`Sync ?__FUNCTION__ ~__FILE__ ~__LINE__
|
enter_manual_toplevel_span ~flavor:`Async ?__FUNCTION__ ~__FILE__
|
||||||
?data name
|
~__LINE__ ?data name
|
||||||
| Some parent, _ ->
|
| Some parent, _ ->
|
||||||
enter_manual_sub_span ~parent ~flavor:`Sync ?__FUNCTION__ ~__FILE__
|
enter_manual_sub_span ~parent ~flavor:`Async ?__FUNCTION__ ~__FILE__
|
||||||
~__LINE__ ?data name
|
~__LINE__ ?data name
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ val with_span :
|
||||||
'a
|
'a
|
||||||
(** [with_span ~__FILE__ ~__LINE__ name f] calls [f span]
|
(** [with_span ~__FILE__ ~__LINE__ name f] calls [f span]
|
||||||
where [span] is a new span named with [name]. The span is
|
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.
|
If [f] returns an ['a Lwt.t] future, use [with_span_lwt] instead.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue