pub fn set_global_guard(guard: OtelGuard) -> Result<(), GlobalError>
Expand description
Set the global guard for OpenTelemetry
§Arguments
guard
- The OtelGuard instance to set globally
§Returns
Ok(())
if successfulErr(GuardError)
if setting fails
§Example
use rustfs_obs::{ init_obs, set_global_guard};
async fn init() -> Result<(), Box<dyn std::error::Error>> {
let (_, guard) = init_obs(None).await;
set_global_guard(guard)?;
Ok(())
}