Skip to content
GitHub

Configuration

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

KeyTypeDefaultEnv VariableDescription
enabledbooltrueLEX_AI_OBSERVABILITY__ENABLEDMaster on/off switch for all AI observability
metrics_enabledbooltrueLEX_AI_OBSERVABILITY__METRICS_ENABLEDEnable metrics collection (counters, histograms, gauges)
tracing_enabledbooltrueLEX_AI_OBSERVABILITY__TRACING_ENABLEDEnable distributed tracing (span creation and export)
health_checks_enabledbooltrueLEX_AI_OBSERVABILITY__HEALTH_CHECKS_ENABLEDEnable background health checking for AI components
ai_observability:
enabled: true
metrics_enabled: true
tracing_enabled: true
health_checks_enabled: true
ai_observability:
enabled: true
metrics_enabled: true
tracing_enabled: true
health_checks_enabled: true
Terminal window
export LEX_AI_OBSERVABILITY__ENABLED=true
export LEX_AI_OBSERVABILITY__TRACING_ENABLED=true
export LEX_AI_OBSERVABILITY__METRICS_ENABLED=false

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.

from lexigram.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)