Configuration
Config Key
Section titled “Config Key”The configuration section is ai_observability (loaded from the ai_observability: key in application.yaml).
Options
Section titled “Options”| Key | Type | Default | Env Variable | Description |
|---|---|---|---|---|
enabled | bool | true | LEX_AI_OBSERVABILITY__ENABLED | Master on/off switch for all AI observability |
metrics_enabled | bool | true | LEX_AI_OBSERVABILITY__METRICS_ENABLED | Enable metrics collection (counters, histograms, gauges) |
tracing_enabled | bool | true | LEX_AI_OBSERVABILITY__TRACING_ENABLED | Enable distributed tracing (span creation and export) |
health_checks_enabled | bool | true | LEX_AI_OBSERVABILITY__HEALTH_CHECKS_ENABLED | Enable background health checking for AI components |
Example YAML
Section titled “Example YAML”ai_observability: enabled: true metrics_enabled: true tracing_enabled: true health_checks_enabled: trueMinimal (production-hardened) YAML
Section titled “Minimal (production-hardened) YAML”ai_observability: enabled: true metrics_enabled: true tracing_enabled: true health_checks_enabled: trueEnv Variable Override
Section titled “Env Variable Override”export LEX_AI_OBSERVABILITY__ENABLED=trueexport LEX_AI_OBSERVABILITY__TRACING_ENABLED=trueexport LEX_AI_OBSERVABILITY__METRICS_ENABLED=falseProduction Warnings
Section titled “Production Warnings”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.
Programmatic
Section titled “Programmatic”from lexigram.ai.observability.config import ObservabilityConfig
config = ObservabilityConfig( enabled=True, metrics_enabled=True, tracing_enabled=False, health_checks_enabled=True,)Config Model
Section titled “Config Model”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)