method Span.recording
True when the span is recorded (sampled and exported); guard expensive attribute computation with it.
Example:
use std.obs { span }
fn main() io {
let s = span.start("work")
// without an OTLP endpoint spans are not recorded
print("{s.recording()}")
s.end()
}Вывод
false
pub(api) fn recording() -> bool ioС версии. 1.0.0-beta
Возвращает
bool
Эффекты
io
Определено в: std/obs/obs.oxl:388