Skip to main content

ObservabilityConfig

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: ObservabilityBackend

Observability 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: LogPersistence

Log 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: String

Log persistence file path. Relative paths resolve under workspace_dir.

§log_persistence_max_entries: usize

Maximum entries retained when log_persistence = "rolling".

§log_persistence_max_bytes: u64

Size 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: bool

Rotate 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: usize

Retention 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: u64

Retention 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: LogToolIo

Tool 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 at log_tool_io_truncate_bytes before persisting.
  • full: full input + output, still leak-scanned. For operators who need replay fidelity and accept the disk cost.
§log_tool_io_truncate_bytes: usize

Truncate 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: LogLlmRequestPayload

LLM request payload capture: “off” | “redacted” | “full”.

  • off (default): only messages_count lands on the llm_request event. No prompt or conversation content is persisted.
  • redacted: the full message history (role + content) is leak-scanned and truncated at log_tool_io_truncate_bytes before 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: OtelContentPolicy

OTel 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 at otel_genai_content_max_chars.
  • full: content is leak-scanned but not truncated.
§otel_genai_content_max_chars: usize

Per-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: OtelContentPolicy

OTel 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 at otel_tool_io_max_chars.
  • full: content is leak-scanned but not truncated.
§otel_tool_io_max_chars: usize

Per-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

Source

pub fn configurable_prefix() -> &'static str

Returns the #[prefix] value for this Configurable struct.

Source

pub fn secret_fields(&self) -> Vec<SecretFieldInfo>

Returns metadata about all #[secret] fields on this struct and nested children.

Source

pub fn secret_field_terminals() -> Vec<&'static str>

Source

pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<()>

Encrypt all secret fields in place using the provided store.

Source

pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<()>

Decrypt all secret fields in place using the provided store.

Source

pub fn set_secret(&mut self, name: &str, value: String) -> Result<()>

Set a secret field by its full dotted name, dispatching to nested children.

Source

pub fn prop_fields(&self) -> Vec<PropFieldInfo>

Returns metadata about all property fields on this struct and nested children.

Source

pub fn get_prop(&self, name: &str) -> Result<String>

Get a property value by its full dotted name, returning it as a display string.

Source

pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<()>

Set a property value by its full dotted name, parsing from string.

Source

pub fn prop_is_secret(name: &str) -> bool

Check if a property name refers to a secret field (static, no instance needed).

Source

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.

Source

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.

Source

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.

Source

pub fn nested_section_group(name: &str) -> Option<&'static str>

Source

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.

Source

pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>

Source

pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

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

Source§

fn clone(&self) -> ObservabilityConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObservabilityConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObservabilityConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ObservabilityConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ObservabilityConfig

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl MaskSecrets for ObservabilityConfig

Source§

fn mask_secrets(&mut self)

Source§

fn restore_secrets_from(&mut self, current: &Self)

Source§

impl Serialize for ObservabilityConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,