pub struct Tracer { /* private fields */ }Expand description
Tracer for creating and managing spans
Implementations§
Source§impl Tracer
impl Tracer
Sourcepub fn new(config: TracingConfig) -> Self
pub fn new(config: TracingConfig) -> Self
Create a new tracer
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration
Sourcepub fn generate_request_id(&self) -> String
pub fn generate_request_id(&self) -> String
Generate a request ID
Sourcepub fn start_span(&self, name: impl Into<String>) -> Span
pub fn start_span(&self, name: impl Into<String>) -> Span
Create a new root span
Sourcepub fn start_child_span(&self, name: impl Into<String>, parent: &Span) -> Span
pub fn start_child_span(&self, name: impl Into<String>, parent: &Span) -> Span
Create a child span
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if tracing is enabled
Sourcepub fn config(&self) -> &TracingConfig
pub fn config(&self) -> &TracingConfig
Get configuration
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Tracer
impl RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl UnsafeUnpin for Tracer
impl UnwindSafe for Tracer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more