OxL Reference

method Span.recording

True when the span is recorded (sampled and exported); guard expensive attribute computation with it.

Example:

oxl✓ checked in CI
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()
}
Output
false
pub(api) fn recording() -> bool  io

Since. 1.0.0-beta

Returns

bool

Effects

io

Defined in: std/obs/obs.oxl:388

See also