extension
Enhanced configuration and management for structured logging
This module provides core configuration and management functionality for structured logging without external extension system dependencies.
Structs
Section titled “Structs”EnhancedObservabilityConfig
Section titled “EnhancedObservabilityConfig”Enhanced configuration for structured logging with performance and convenience features
Fields
| Field | Type | Description |
|---|---|---|
base | observability_core::ObservabilityConfig | Base observability configuration |
performance | PerformanceConfig | Performance optimization settings |
correlation | CorrelationConfig | Correlation enhancement settings |
convenience | ConvenienceConfig | Convenience feature settings |
panic_handler | PanicHandlerConfig | Panic handling configuration |
Methods
with_base
Section titled “with_base”fn with_base(base: ObservabilityConfig) -> SelfCreate enhanced config with specified base config
with_panic_handler
Section titled “with_panic_handler”fn with_panic_handler(self, config: PanicHandlerConfig) -> SelfSet panic handler configuration
with_all_performance_features
Section titled “with_all_performance_features”fn with_all_performance_features(self) -> SelfEnable all performance features (feature-gated)
with_no_performance_features
Section titled “with_no_performance_features”fn with_no_performance_features(self) -> SelfDisable all performance features (feature-gated)
to_base_config
Section titled “to_base_config”fn to_base_config(&self) -> ObservabilityConfigConvert to base observability config
validate
Section titled “validate”fn validate(&self) -> Result<()>Validate configuration
to_json
Section titled “to_json”fn to_json(&self) -> Result<String>Serialize configuration to JSON
from_json
Section titled “from_json”fn from_json(json: &str) -> Result<Self>Deserialize configuration from JSON
PerformanceConfig
Section titled “PerformanceConfig”Performance optimization configuration
Fields
| Field | Type | Description |
|---|---|---|
enable_string_interning | bool | Enable string interning for common log field values |
string_interner_capacity | usize | Initial capacity for string interner |
enable_buffer_pooling | bool | Enable buffer pooling for log formatting |
buffer_pool_size | usize | Initial buffer pool size |
buffer_capacity | usize | Individual buffer capacity in bytes |
enable_fast_paths | bool | Enable zero-allocation fast paths for hot operations |
enable_wasm_optimizations | bool | Enable WASM-specific memory optimizations |
CorrelationConfig
Section titled “CorrelationConfig”Correlation enhancement configuration
Fields
| Field | Type | Description |
|---|---|---|
enable_baggage | bool | Enable W3C baggage support |
max_baggage_size | usize | Maximum baggage size in bytes |
enable_scoped_context | bool | Enable scoped context management |
max_context_depth | usize | Maximum context nesting depth |
enable_auto_propagation | bool | Enable automatic context propagation |
ConvenienceConfig
Section titled “ConvenienceConfig”Convenience feature configuration
Fields
| Field | Type | Description |
|---|---|---|
enable_llm_logging | bool | Enable LLM operation logging |
enable_template_logging | bool | Enable template rendering logging |
enable_a2a_logging | bool | Enable A2A message logging |
enable_convenience_macros | bool | Enable convenience macros |
enable_domain_fields | bool | Enable domain-specific field extraction |
PerformanceExtension
Section titled “PerformanceExtension”Enhanced observability manager with performance and convenience features
Methods
fn new(config: EnhancedObservabilityConfig) -> Result<Self>Create new enhanced extension
initialize
Section titled “initialize”fn initialize(&mut self) -> Result<()>Initialize all configured features
is_performance_enabled
Section titled “is_performance_enabled”fn is_performance_enabled(&self) -> boolCheck if performance features are enabled
is_correlation_enabled
Section titled “is_correlation_enabled”fn is_correlation_enabled(&self) -> boolCheck if correlation features are enabled
is_convenience_enabled
Section titled “is_convenience_enabled”fn is_convenience_enabled(&self) -> boolCheck if convenience features are enabled
fn base(&self) -> &ObservabilityManagerGet base observability manager
config
Section titled “config”fn config(&self) -> &EnhancedObservabilityConfigGet enhanced configuration
process_log_entry
Section titled “process_log_entry”fn process_log_entry(&self, entry: LogEntry) -> Result<LogEntry>Process log entry through all enabled features
get_performance_stats
Section titled “get_performance_stats”fn get_performance_stats(&self) -> Option<PerformanceStats>Get performance statistics (if enabled)
reset_performance_stats
Section titled “reset_performance_stats”fn reset_performance_stats(&self) -> Result<()>Reset performance statistics (if enabled)
get_panic_stats
Section titled “get_panic_stats”fn get_panic_stats(&self) -> Result<PanicStats>Get panic statistics if panic handler is enabled
reset_panic_stats
Section titled “reset_panic_stats”fn reset_panic_stats(&self) -> Result<()>Reset panic statistics if panic handler is enabled
capabilities
Section titled “capabilities”fn capabilities(&self) -> Vec<&''static str>Get manager capabilities
Functions
Section titled “Functions”create_performance_extension
Section titled “create_performance_extension”fn create_performance_extension(config: EnhancedObservabilityConfig) -> Result<PerformanceExtension>Create performance extension from configuration
create_performance_extension_from_config
Section titled “create_performance_extension_from_config”fn create_performance_extension_from_config(config_path: &str) -> Result<PerformanceExtension>Create performance extension from configuration file