Skip to content
Packages Examples Agents Blog Get started

The configuration section is ai_observability (loaded from the ai_observability: key in application.yaml).

KeyTypeDefaultEnv VariableDescription
enabledbooltrueORI_AI_OBSERVABILITY__ENABLEDMaster on/off switch for all AI observability
metrics_enabledbooltrueORI_AI_OBSERVABILITY__METRICS_ENABLEDEnable metrics collection (counters, histograms, gauges)
tracing_enabledbooltrueORI_AI_OBSERVABILITY__TRACING_ENABLEDEnable distributed tracing (span creation and export)
health_checks_enabledbooltrueORI_AI_OBSERVABILITY__HEALTH_CHECKS_ENABLEDEnable background health checking for AI components
trace_redaction_enabledboolfalseORI_AI_OBSERVABILITY__TRACE_REDACTION_ENABLEDRedact secret-shaped keys (password, token, api_key, secret, authorization, …) from trace span attributes and audit metadata. Default false — enabling is strongly recommended for production (see Production Warnings).
trace_max_attribute_lengthint0ORI_AI_OBSERVABILITY__TRACE_MAX_ATTRIBUTE_LENGTHCap on string attribute values written to trace spans, in characters (0 = disabled). A sensible value is 4096. Applies whether or not redaction is enabled.
ai_observability:
enabled: true
metrics_enabled: true
tracing_enabled: true
health_checks_enabled: true
trace_redaction_enabled: true
trace_max_attribute_length: 4096
ai_observability:
enabled: true
metrics_enabled: true
tracing_enabled: true
health_checks_enabled: true
Terminal window
export ORI_AI_OBSERVABILITY__ENABLED=true
export ORI_AI_OBSERVABILITY__TRACING_ENABLED=true
export ORI_AI_OBSERVABILITY__METRICS_ENABLED=false
export ORI_AI_OBSERVABILITY__TRACE_REDACTION_ENABLED=true
export ORI_AI_OBSERVABILITY__TRACE_MAX_ATTRIBUTE_LENGTH=4096

When Environment.PRODUCTION is detected, the config’s validate_for_environment() method emits warnings if tracing_enabled or metrics_enabled are false — these features are expected in production for operational visibility. It also warns when tracing_enabled is true but trace_redaction_enabled is false: with tracing on, tool arguments, agent actions, and retriever queries are exported to your tracing backend verbatim, and the recommended posture is to enable redaction.

from oridecon.ai.observability.config import ObservabilityConfig
config = ObservabilityConfig(
enabled=True,
metrics_enabled=True,
tracing_enabled=False,
health_checks_enabled=True,
)

Loaded as a BaseConfig subclass (ObservabilityConfig) by ObservabilityProvider. The config instance is registered as a container singleton at register() time and can be resolved by other services:

cfg = await container.resolve(ObservabilityConfig)