pub struct TracingConfig {
pub enabled: bool,
pub endpoint: String,
pub protocol: OtlpProtocol,
pub service_name: String,
pub sample_ratio: f64,
}Expand description
OpenTelemetry OTLP distributed tracing configuration.
Fields§
§enabled: boolRequired. When true, span data is exported to the configured
OTLP endpoint.
endpoint: StringRequired. OTLP exporter endpoint URL (e.g. "http://localhost:4317"
for gRPC or "http://localhost:4318" for HTTP). Must start with
http:// or https://.
protocol: OtlpProtocolRequired. OTLP transport protocol. Valid values: "grpc", "http".
service_name: StringRequired. Service name recorded on every emitted span.
sample_ratio: f64Default: 1.0. Fraction of traces to sample, in the range 0.0
(no traces) to 1.0 (all traces).
Implementations§
Source§impl TracingConfig
impl TracingConfig
Sourcepub fn validate_endpoint(&self) -> Result<()>
pub fn validate_endpoint(&self) -> Result<()>
Validate endpoint URL format.
Sourcepub fn validate_sample_ratio(&self) -> Result<()>
pub fn validate_sample_ratio(&self) -> Result<()>
Validate sample ratio.
Sourcepub fn validate_service_name(&self) -> Result<()>
pub fn validate_service_name(&self) -> Result<()>
Validate service name.
Trait Implementations§
Source§impl Clone for TracingConfig
impl Clone for TracingConfig
Source§fn clone(&self) -> TracingConfig
fn clone(&self) -> TracingConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TracingConfig
impl Debug for TracingConfig
Source§impl Default for TracingConfig
impl Default for TracingConfig
Source§impl<'de> Deserialize<'de> for TracingConfig
impl<'de> Deserialize<'de> for TracingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TracingConfig
impl RefUnwindSafe for TracingConfig
impl Send for TracingConfig
impl Sync for TracingConfig
impl Unpin for TracingConfig
impl UnsafeUnpin for TracingConfig
impl UnwindSafe for TracingConfig
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