restore enter_manual_{sub,toplevel}_span, but deprecated

this will ease migration
This commit is contained in:
Simon Cruanes 2025-05-01 22:48:18 -04:00
parent 8f195adff9
commit 44fdc9557d
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 35 additions and 0 deletions

View file

@ -77,6 +77,16 @@ let[@inline] enter_manual_span ~parent ?flavor ?level ?__FUNCTION__ ~__FILE__
~__LINE__ ?data name
| _ -> Collector.dummy_explicit_span
let[@inline] enter_manual_toplevel_span ?flavor ?level ?__FUNCTION__ ~__FILE__
~__LINE__ ?data name : explicit_span =
enter_manual_span ~parent:None ?flavor ?level ?__FUNCTION__ ~__FILE__
~__LINE__ ?data name
let[@inline] enter_manual_sub_span ~parent ?flavor ?level ?__FUNCTION__
~__FILE__ ~__LINE__ ?data name : explicit_span =
enter_manual_span ~parent:(Some parent) ?flavor ?level ?__FUNCTION__ ~__FILE__
~__LINE__ ?data name
let[@inline] exit_manual_span espan : unit =
if espan != Collector.dummy_explicit_span then (
match A.get collector with

View file

@ -113,6 +113,31 @@ val enter_manual_span :
{!set_default_level}.
@since NEXT_RELEASE *)
val enter_manual_sub_span :
parent:explicit_span_ctx ->
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
explicit_span
[@@deprecated "use enter_manual_span"]
(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *)
val enter_manual_toplevel_span :
?flavor:[ `Sync | `Async ] ->
?level:Level.t ->
?__FUNCTION__:string ->
__FILE__:string ->
__LINE__:int ->
?data:(unit -> (string * user_data) list) ->
string ->
explicit_span
[@@deprecated "use enter_manual_span"]
(** @deprecated since NEXT_RELEASE, use {!enter_manual_span} *)
val exit_manual_span : explicit_span -> unit
(** Exit an explicit span. This can be on another thread, in a fiber or
lightweight thread, etc. and will be supported by backends nonetheless. The