Get the Current Active Span
Examples
# Outside a span, returns NULL
current_span()
#> NULL
# Inside a span, returns the active Span
with_trace("demo", {
with_span("step", type = "custom", {
s <- current_span()
s$name
})
})
#> [1] "step"
Get the Current Active Span
# Outside a span, returns NULL
current_span()
#> NULL
# Inside a span, returns the active Span
with_trace("demo", {
with_span("step", type = "custom", {
s <- current_span()
s$name
})
})
#> [1] "step"