pub fn get_global_guard() -> Result<Arc<Mutex<OtelGuard>>, GlobalError>
Expand description
Get the global guard for OpenTelemetry
§Returns
Ok(Arc<Mutex<OtelGuard>>)
if guard existsErr(GuardError)
if guard not initialized
§Example
use rustfs_obs::get_global_guard;
async fn trace_operation() -> Result<(), Box<dyn std::error::Error>> {
let guard = get_global_guard()?;
let _lock = guard.lock().unwrap();
// Perform traced operation
Ok(())
}