pub struct ObservabilityConfig {
pub tool_name: ToolName,
pub log_root: PathBuf,
pub env_prefix: EnvPrefix,
pub queue_capacity: usize,
pub retained_log_policy: RetainedLogPolicy,
}Expand description
Top-level configuration for the observation routing runtime.
Routing owns tool identity, log-root selection, env-prefix derivation, and
queue capacity. Logging-specific level, retention, and redaction behavior
stay owned by LoggerConfig in sc-observability and are intentionally not
overridable at the ObservabilityConfig layer.
Fields§
§tool_name: ToolNameStable tool name used to derive service and log layout defaults.
log_root: PathBufRoot directory that owns the routing runtime log tree.
env_prefix: EnvPrefixEnvironment-variable prefix used by the owning application.
queue_capacity: usizeReserved for future async/backpressure implementation. Phase 1 execution is synchronous; this value is stored but not yet applied.
retained_log_policy: RetainedLogPolicyRetained-log policy forwarded to the built-in logging layer.
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn default_for(
tool_name: ToolName,
log_root: PathBuf,
) -> Result<Self, InitError>
pub fn default_for( tool_name: ToolName, log_root: PathBuf, ) -> Result<Self, InitError>
Builds the documented v1 defaults from a tool name and log root.
§Examples
use std::path::PathBuf;
use sc_observability_types::ToolName;
use sc_observe::ObservabilityConfig;
let config = ObservabilityConfig::default_for(
ToolName::new("demo-tool").expect("valid tool"),
PathBuf::from("logs"),
)
.expect("valid config");
assert_eq!(config.tool_name.as_str(), "demo-tool");Sourcepub fn service_name(&self) -> Result<ServiceName, InitError>
pub fn service_name(&self) -> Result<ServiceName, InitError>
Derives the logging/telemetry service name from the configured tool.
Trait Implementations§
Source§impl Clone for ObservabilityConfig
impl Clone for ObservabilityConfig
Source§fn clone(&self) -> ObservabilityConfig
fn clone(&self) -> ObservabilityConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more