Struct ObservabilityConfig
pub struct ObservabilityConfig {Show 19 fields
pub backend: ObservabilityBackend,
pub otel_endpoint: Option<String>,
pub otel_service_name: Option<String>,
pub otel_headers: Option<HashMap<String, String>>,
pub log_persistence: LogPersistence,
pub log_persistence_path: String,
pub log_persistence_max_entries: usize,
pub log_persistence_max_bytes: u64,
pub log_persistence_rotate_daily: bool,
pub log_persistence_retention_max_files: usize,
pub log_persistence_retention_max_age_days: u64,
pub log_tool_io: LogToolIo,
pub log_tool_io_truncate_bytes: usize,
pub log_tool_io_denylist: Vec<String>,
pub log_llm_request_payload: LogLlmRequestPayload,
pub otel_genai_content: OtelContentPolicy,
pub otel_genai_content_max_chars: usize,
pub otel_tool_io: OtelContentPolicy,
pub otel_tool_io_max_chars: usize,
}Expand description
Observability backend configuration ([observability] section).
Fields§
§backend: ObservabilityBackendObservability sink: none | log | verbose | prometheus | otel.
otel_endpoint: Option<String>OTLP endpoint (e.g. "http://localhost:4318"). Only used when backend = "otel".
otel_service_name: Option<String>Service name reported to the OTel collector. Defaults to “zeroclaw”.
otel_headers: Option<HashMap<String, String>>Optional HTTP headers sent with every OTLP export request (e.g. authorization). Specified as key-value pairs in TOML:
[observability.otel_headers]
Authorization = "Bearer sk-..."log_persistence: LogPersistenceLog persistence mode: “none” | “rolling” | “full”.
Controls whether every event passing through zeroclaw_log::record!
is appended to the on-disk JSONL log.
log_persistence_path: StringLog persistence file path. Relative paths resolve under workspace_dir.
log_persistence_max_entries: usizeMaximum entries retained when log_persistence = "rolling".
log_persistence_max_bytes: u64Size threshold in bytes that triggers an archive rotation when
log_persistence = "rotating". The active file is rotated once an
append leaves it at or above this size. 0 disables size-based
rotation. Ignored unless log_persistence = "rotating".
log_persistence_rotate_daily: boolRotate the active file to an archive on a UTC day boundary when
log_persistence = "rotating": before the first event of a new day is
appended, a file whose last write fell on an earlier day is archived.
Ignored unless log_persistence = "rotating".
log_persistence_retention_max_files: usizeRetention cap on the number of rotated archive files kept alongside the
active file when log_persistence = "rotating". After a rotation the
oldest archives beyond this count are deleted. 0 keeps all archives.
Ignored unless log_persistence = "rotating".
log_persistence_retention_max_age_days: u64Retention cap on the age (in days) of rotated archive files when
log_persistence = "rotating". After a rotation, archives older than
this many days are deleted. 0 disables age-based cleanup. Ignored
unless log_persistence = "rotating".
log_tool_io: LogToolIoTool I/O capture policy: “off” | “redacted” | “full”.
off: only tool name + outcome + duration land in the log.redacted(default): tool input + output are leak-scanned and truncated atlog_tool_io_truncate_bytesbefore persisting.full: full input + output, still leak-scanned. For operators who need replay fidelity and accept the disk cost.
log_tool_io_truncate_bytes: usizeTruncate the captured tool input and output at this many bytes when
log_tool_io = "redacted". Truncated events carry an explicit
tool_output_truncated: true flag plus tool_output_original_bytes.
log_tool_io_denylist: Vec<String>Tool names whose I/O is never logged beyond name + outcome + duration
regardless of log_tool_io. Use for tools whose I/O is intrinsically
sensitive (e.g. memory recall against personal namespaces, agent
secret reads). Empty by default.
log_llm_request_payload: LogLlmRequestPayloadLLM request payload capture: “off” | “redacted” | “full”.
off(default): onlymessages_countlands on thellm_requestevent. No prompt or conversation content is persisted.redacted: the full message history (role + content) is leak-scanned and truncated atlog_tool_io_truncate_bytesbefore persisting.full: full message history, still leak-scanned, untruncated. For operators who need replay fidelity and accept the disk cost.
Opt-in (default off) because full/redacted capture the entire system
prompt and conversation on every turn.
otel_genai_content: OtelContentPolicyOTel GenAI content capture: “off” | “redacted” | “full”.
Controls whether gen_ai.system_instructions, gen_ai.input.messages,
and gen_ai.output.messages are emitted on OTel spans.
off(default): no content attributes, only metadata.redacted: content is leak-scanned and truncated atotel_genai_content_max_chars.full: content is leak-scanned but not truncated.
otel_genai_content_max_chars: usizePer-field character truncation limit for OTel GenAI content when
otel_genai_content = "redacted". Each string field is truncated
independently. 0 is treated as off.
otel_tool_io: OtelContentPolicyOTel tool I/O capture: “off” | “redacted” | “full”.
Controls whether gen_ai.tool.arguments, input.value,
gen_ai.tool.result, and output.value are emitted on OTel spans.
off(default): no content attributes, only tool name + outcome.redacted: content is leak-scanned and truncated atotel_tool_io_max_chars.full: content is leak-scanned but not truncated.
otel_tool_io_max_chars: usizePer-field character truncation limit for OTel tool I/O when
otel_tool_io = "redacted". Each string field is truncated
independently. 0 is treated as off.
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn configurable_prefix() -> &'static str
pub fn configurable_prefix() -> &'static str
Returns the #[prefix] value for this Configurable struct.
Sourcepub fn secret_fields(&self) -> Vec<SecretFieldInfo>
pub fn secret_fields(&self) -> Vec<SecretFieldInfo>
Returns metadata about all #[secret] fields on this struct and nested children.
pub fn secret_field_terminals() -> Vec<&'static str>
Sourcepub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<()>
pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<()>
Encrypt all secret fields in place using the provided store.
Sourcepub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<()>
pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<()>
Decrypt all secret fields in place using the provided store.
Sourcepub fn set_secret(&mut self, name: &str, value: String) -> Result<()>
pub fn set_secret(&mut self, name: &str, value: String) -> Result<()>
Set a secret field by its full dotted name, dispatching to nested children.
Sourcepub fn prop_fields(&self) -> Vec<PropFieldInfo>
pub fn prop_fields(&self) -> Vec<PropFieldInfo>
Returns metadata about all property fields on this struct and nested children.
Sourcepub fn get_prop(&self, name: &str) -> Result<String>
pub fn get_prop(&self, name: &str) -> Result<String>
Get a property value by its full dotted name, returning it as a display string.
Sourcepub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<()>
pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<()>
Set a property value by its full dotted name, parsing from string.
Sourcepub fn prop_is_secret(name: &str) -> bool
pub fn prop_is_secret(name: &str) -> bool
Check if a property name refers to a secret field (static, no instance needed).
Sourcepub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
Instantiate None nested sections whose prefix matches.
Returns the prefixes that were initialized.
Sourcepub fn map_key_sections() -> Vec<MapKeySection>
pub fn map_key_sections() -> Vec<MapKeySection>
Enumerate every map-keyed (HashMap<String, T>) and list-shaped
(Vec<T>) section discoverable from this Configurable’s tree.
The dashboard / CLI consume this to surface “+ Add” affordances
without hardcoding the section list.
Sourcepub fn nested_section_help(name: &str) -> Option<&'static str>
pub fn nested_section_help(name: &str) -> Option<&'static str>
Help blurb for a #[nested] field on this struct, sourced from
the field-level /// docstring. Returns None for unknown
names so callers can fall through to a different lookup.
pub fn nested_section_group(name: &str) -> Option<&'static str>
Sourcepub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
Return the current alias keys at section_path, or None if
the path doesn’t resolve to a map-keyed section in this tree.
pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>
pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>
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) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObservabilityConfig
impl Debug for ObservabilityConfig
Source§impl Default for ObservabilityConfig
impl Default for ObservabilityConfig
Source§impl<'de> Deserialize<'de> for ObservabilityConfig
impl<'de> Deserialize<'de> for ObservabilityConfig
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>,
Source§impl JsonSchema for ObservabilityConfig
impl JsonSchema for ObservabilityConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl MaskSecrets for ObservabilityConfig
impl MaskSecrets for ObservabilityConfig
fn mask_secrets(&mut self)
fn restore_secrets_from(&mut self, current: &Self)
Auto Trait Implementations§
impl Freeze for ObservabilityConfig
impl RefUnwindSafe for ObservabilityConfig
impl Send for ObservabilityConfig
impl Sync for ObservabilityConfig
impl Unpin for ObservabilityConfig
impl UnsafeUnpin for ObservabilityConfig
impl UnwindSafe for ObservabilityConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more