pub struct ObservabilityConfig {
pub enable_sensitive_data: bool,
}Expand description
Observability configuration read from the process environment, mirroring
(a subset of) Python’s ObservabilitySettings (observability.py:347-394).
This port intentionally does not read ENABLE_OTEL: Python uses that
flag to skip constructing spans entirely when no heavier OTel SDK is
configured. This crate’s spans are plain tracing spans, which are
already effectively free when no subscriber is attached, so there is no
separate “enable” switch — attach a subscriber (optionally bridged to
OTel; see the module docs) to turn observability on.
This crate does not build an OTel Resource, exporter, or
MeterProvider — see the module docs for wiring those yourself.
Fields§
§enable_sensitive_data: boolWhether message / system-instructions / tool-definition / tool-call
content capture is enabled. Reads ENABLE_SENSITIVE_DATA (mirrors
Python’s enable_sensitive_data — “Warning: Sensitive events should
only be enabled on test and development environments.”).
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read configuration from the process environment. Unset or
unrecognized values default to false (matching Python’s default).
Recognized truthy values (case-insensitive, surrounding whitespace
ignored): "1", "true", "yes", "on".
Sourcepub fn otel_service_name(&self) -> String
pub fn otel_service_name(&self) -> String
The OTEL_SERVICE_NAME passthrough, defaulting to "agent_framework"
(mirrors Python’s _create_resource, observability.py:336-344).
This crate does not build a Resource from it — it’s exposed so an
app wiring its own OTel Resource (see the module docs) can
stay consistent with whatever this reads. Reads the environment fresh
on every call rather than caching it at from_env
time.
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