#[non_exhaustive]pub struct EventsConfig {
pub filter: Option<String>,
pub sampling: SamplingConfig,
pub limits: LimitsConfig,
pub audit: AuditConfig,
pub queues: QueuesConfig,
pub sinks: SinksConfig,
pub service: ServiceConfig,
pub dev_mode: bool,
}Expand description
The complete config tree. Every field is optional so a config file
can be a single line if the user only cares to override filter.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.filter: Option<String>EnvFilter-grammar directives. None ⇒ defer to OBS_FILTER
env var; if both unset, "info" applies.
sampling: SamplingConfigHead/tail sampling tunables.
limits: LimitsConfigPer-event byte caps.
audit: AuditConfigAUDIT-tier delivery policy (Phase 3 task 3.12 implements the
spool; the config struct lives here so user obs.yaml files
already have a stable shape).
queues: QueuesConfigPer-tier mpsc queue capacities (Phase 3 worker pool).
sinks: SinksConfigPer-sink configuration (Phase 3+ implements the sinks; the
config struct lives here so user obs.yaml files already have
a stable shape).
service: ServiceConfigService identity (overrides defaults read from env).
dev_mode: boolDev-mode toggle (OBS_DEV=1 or dev_mode: true). Enables
extra diagnostics intended for local iteration: more verbose
scope-field warnings, source-loc capture, and the
dev_ergonomics test path. Spec 13 § 2.3 / 60 § 7 / spec 94 §
3.10 / P3-A.
Implementations§
Source§impl EventsConfig
impl EventsConfig
Sourcepub fn builder() -> EventsConfigBuilder
pub fn builder() -> EventsConfigBuilder
Builder entry. See spec 15 § 5.1.
Sourcepub fn from_yaml_str(yaml: &str) -> Result<EventsConfig, ConfigError>
pub fn from_yaml_str(yaml: &str) -> Result<EventsConfig, ConfigError>
Parse YAML bytes into an EventsConfig. Spec 15 § 5.1 / spec
93 P0-9. ${VAR} references in scalar string values are
expanded against the process environment before parsing — set
${VAR:-default} to provide a fallback.
Unknown top-level keys fail parsing (struct is
deny_unknown_fields). The error message is annotated with the
valid root-key set so typos like filtr: surface with an
immediate fix-up hint — boundary-review § 4.1.
§Errors
Returns ConfigError::Yaml when parsing fails (unknown fields,
type mismatch, syntax error). Validation is left to the caller
— call Self::validate after loading.
Sourcepub fn from_yaml_path(
path: impl AsRef<Path>,
) -> Result<EventsConfig, ConfigError>
pub fn from_yaml_path( path: impl AsRef<Path>, ) -> Result<EventsConfig, ConfigError>
Read a YAML file from disk.
§Errors
Returns ConfigError::Io when the file cannot be read or
ConfigError::Yaml when parsing fails.
Sourcepub fn merged_with_env(self, prefix: &str) -> EventsConfig
pub fn merged_with_env(self, prefix: &str) -> EventsConfig
Apply environment-variable overrides under prefix. The
convention is <PREFIX>_<DOTTED_PATH_WITH___INSTEAD_OF_DOTS> —
e.g. OBS_FILTER for filter, OBS_AUDIT__SPOOL_DIR for
audit.spool_dir, OBS_SAMPLING__DEFAULT_RATE for
sampling.default_rate. Values are parsed by re-running
serde_yaml against the resulting flat map. Spec 15 § 5.1 / spec
93 P0-9.
Source§impl EventsConfig
impl EventsConfig
Trait Implementations§
Source§impl Clone for EventsConfig
impl Clone for EventsConfig
Source§fn clone(&self) -> EventsConfig
fn clone(&self) -> EventsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventsConfig
impl Debug for EventsConfig
Source§impl Default for EventsConfig
impl Default for EventsConfig
Source§fn default() -> EventsConfig
fn default() -> EventsConfig
Source§impl<'de> Deserialize<'de> for EventsConfig
impl<'de> Deserialize<'de> for EventsConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for EventsConfig
impl Serialize for EventsConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for EventsConfig
impl RefUnwindSafe for EventsConfig
impl Send for EventsConfig
impl Sync for EventsConfig
impl Unpin for EventsConfig
impl UnsafeUnpin for EventsConfig
impl UnwindSafe for EventsConfig
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
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> 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