pub struct TelemetryConfig { /* private fields */ }Expand description
Bootstrap configuration for the estate telemetry stack.
Built with TelemetryConfig::new and consumed by
Telemetry::init. Every setter is
chainable; unset fields keep the documented defaults.
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn new(service_name: impl Into<String>) -> Self
pub fn new(service_name: impl Into<String>) -> Self
Create a config for service_name with estate defaults:
version "0.0.0", env-filter "info" (overridden by RUST_LOG),
JSON logs, a 8192-series metrics budget, no OTLP endpoint (no trace
export), and a 1.0 sample rate.
Sourcepub fn version(self, version: impl Into<String>) -> Self
pub fn version(self, version: impl Into<String>) -> Self
Set the service version attached to OTLP resource attributes.
Sourcepub fn log_format(self, format: LogFormat) -> Self
pub fn log_format(self, format: LogFormat) -> Self
Set the log output format.
Sourcepub fn log_level(self, level: impl Into<String>) -> Self
pub fn log_level(self, level: impl Into<String>) -> Self
Set the env-filter directive string (e.g. "info",
"debug,hyper=warn").
RUST_LOG, when set and non-empty, always wins over this value.
Sourcepub fn metrics_budget(self, budget: usize) -> Self
pub fn metrics_budget(self, budget: usize) -> Self
Set the metrics-kit series budget (cardinality guard).
Sourcepub fn sample_rate(self, rate: f32) -> Self
pub fn sample_rate(self, rate: f32) -> Self
Set the trace sample rate in 0.0..=1.0; values outside the range
are clamped. A NaN falls back to the default 1.0 rather than
silently dropping every span.