pub struct TracingBuilder<S: BuilderState> { /* private fields */ }
Expand description
Makes it easy to build a valid Tracing
instance.
Implementations§
Source§impl TracingBuilder<PreServiceName>
impl TracingBuilder<PreServiceName>
Sourcepub fn service_name(self, service_name: &'static str) -> TracingBuilder<Config>
pub fn service_name(self, service_name: &'static str) -> TracingBuilder<Config>
Set the service name used in OTLP exports, and console output.
A service name is required for valid OTLP telemetry.
Source§impl TracingBuilder<Config>
impl TracingBuilder<Config>
Sourcepub fn with_console_output(
self,
console_log_settings: impl Into<ConsoleLogSettings>,
) -> TracingBuilder<Config>
pub fn with_console_output( self, console_log_settings: impl Into<ConsoleLogSettings>, ) -> TracingBuilder<Config>
Enable the console output tracing subscriber and set the default
[LevelFilter
] which is overridable through the given environment
variable.
Sourcepub fn with_file_output(
self,
file_log_settings: impl Into<FileLogSettings>,
) -> TracingBuilder<Config>
pub fn with_file_output( self, file_log_settings: impl Into<FileLogSettings>, ) -> TracingBuilder<Config>
Enable the file output tracing subscriber and set the default
[LevelFilter
] which is overridable through the given environment
variable.
Sourcepub fn with_otlp_log_exporter(
self,
otlp_log_settings: impl Into<OtlpLogSettings>,
) -> TracingBuilder<Config>
pub fn with_otlp_log_exporter( self, otlp_log_settings: impl Into<OtlpLogSettings>, ) -> TracingBuilder<Config>
Enable the OTLP logging subscriber and set the default [LevelFilter
]
which is overridable through the given environment variable.
You can configure the OTLP log exports through the variables defined
in the opentelemetry crates. See Tracing
.
Sourcepub fn with_otlp_trace_exporter(
self,
otlp_trace_settings: impl Into<OtlpTraceSettings>,
) -> TracingBuilder<Config>
pub fn with_otlp_trace_exporter( self, otlp_trace_settings: impl Into<OtlpTraceSettings>, ) -> TracingBuilder<Config>
Enable the OTLP tracing subscriber and set the default [LevelFilter
]
which is overridable through the given environment variable.
You can configure the OTLP trace exports through the variables defined
in the opentelemetry crates. See Tracing
.
Sourcepub fn build(self) -> Tracing
pub fn build(self) -> Tracing
Consumes self and returns a valid Tracing
instance.
Once built, you can call Tracing::init
to enable the configured
tracing subscribers.
Trait Implementations§
Source§impl<S: Default + BuilderState> Default for TracingBuilder<S>
impl<S: Default + BuilderState> Default for TracingBuilder<S>
Source§fn default() -> TracingBuilder<S>
fn default() -> TracingBuilder<S>
Auto Trait Implementations§
impl<S> Freeze for TracingBuilder<S>
impl<S> RefUnwindSafe for TracingBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for TracingBuilder<S>where
S: Send,
impl<S> Sync for TracingBuilder<S>where
S: Sync,
impl<S> Unpin for TracingBuilder<S>where
S: Unpin,
impl<S> UnwindSafe for TracingBuilder<S>where
S: UnwindSafe,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request