pub enum TracerWrapper {
OpenTelemetry(Arc<BoxedTracer>),
Tracing,
Noop(NoopTracer),
}Expand description
Wrapper para diferentes tipos de tracer, integrado com o sistema tracing
Este enum permite usar tanto tracers OpenTelemetry quanto o sistema tracing nativo do Rust de forma transparente.
Variants§
OpenTelemetry(Arc<BoxedTracer>)
Tracer OpenTelemetry para observabilidade distribuída
Tracing
Tracer baseado no sistema tracing nativo do Rust
Noop(NoopTracer)
Tracer noop para quando telemetria está desabilitada
Implementations§
Source§impl TracerWrapper
impl TracerWrapper
Sourcepub fn new_tracing() -> Self
pub fn new_tracing() -> Self
Cria um novo TracerWrapper usando o sistema tracing nativo
Sourcepub fn new_opentelemetry(tracer: Arc<BoxedTracer>) -> Self
pub fn new_opentelemetry(tracer: Arc<BoxedTracer>) -> Self
Cria um novo TracerWrapper usando OpenTelemetry
Sourcepub fn start_span(&self, name: &str) -> TracerSpan
pub fn start_span(&self, name: &str) -> TracerSpan
Inicia um novo span instrumentado
Este método cria spans de forma consistente independentemente do tipo de tracer sendo usado.
Sourcepub fn tracer_type(&self) -> &'static str
pub fn tracer_type(&self) -> &'static str
Retorna o tipo do tracer como string para logs/debug
Trait Implementations§
Source§impl Clone for TracerWrapper
impl Clone for TracerWrapper
Source§impl Default for TracerWrapper
impl Default for TracerWrapper
Source§fn default() -> TracerWrapper
fn default() -> TracerWrapper
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TracerWrapper
impl !RefUnwindSafe for TracerWrapper
impl Send for TracerWrapper
impl Sync for TracerWrapper
impl Unpin for TracerWrapper
impl !UnwindSafe for TracerWrapper
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more