Skip to content

extension

Enhanced configuration and management for structured logging

This module provides core configuration and management functionality for structured logging without external extension system dependencies.

Enhanced configuration for structured logging with performance and convenience features

Fields

FieldTypeDescription
baseobservability_core::ObservabilityConfigBase observability configuration
performancePerformanceConfigPerformance optimization settings
correlationCorrelationConfigCorrelation enhancement settings
convenienceConvenienceConfigConvenience feature settings
panic_handlerPanicHandlerConfigPanic handling configuration

Methods

fn with_base(base: ObservabilityConfig) -> Self

Create enhanced config with specified base config

fn with_panic_handler(self, config: PanicHandlerConfig) -> Self

Set panic handler configuration

fn with_all_performance_features(self) -> Self

Enable all performance features (feature-gated)

fn with_no_performance_features(self) -> Self

Disable all performance features (feature-gated)

fn to_base_config(&self) -> ObservabilityConfig

Convert to base observability config

fn validate(&self) -> Result<()>

Validate configuration

fn to_json(&self) -> Result<String>

Serialize configuration to JSON

fn from_json(json: &str) -> Result<Self>

Deserialize configuration from JSON

Performance optimization configuration

Fields

FieldTypeDescription
enable_string_interningboolEnable string interning for common log field values
string_interner_capacityusizeInitial capacity for string interner
enable_buffer_poolingboolEnable buffer pooling for log formatting
buffer_pool_sizeusizeInitial buffer pool size
buffer_capacityusizeIndividual buffer capacity in bytes
enable_fast_pathsboolEnable zero-allocation fast paths for hot operations
enable_wasm_optimizationsboolEnable WASM-specific memory optimizations

Correlation enhancement configuration

Fields

FieldTypeDescription
enable_baggageboolEnable W3C baggage support
max_baggage_sizeusizeMaximum baggage size in bytes
enable_scoped_contextboolEnable scoped context management
max_context_depthusizeMaximum context nesting depth
enable_auto_propagationboolEnable automatic context propagation

Convenience feature configuration

Fields

FieldTypeDescription
enable_llm_loggingboolEnable LLM operation logging
enable_template_loggingboolEnable template rendering logging
enable_a2a_loggingboolEnable A2A message logging
enable_convenience_macrosboolEnable convenience macros
enable_domain_fieldsboolEnable domain-specific field extraction

Enhanced observability manager with performance and convenience features

Methods

fn new(config: EnhancedObservabilityConfig) -> Result<Self>

Create new enhanced extension

fn initialize(&mut self) -> Result<()>

Initialize all configured features

fn is_performance_enabled(&self) -> bool

Check if performance features are enabled

fn is_correlation_enabled(&self) -> bool

Check if correlation features are enabled

fn is_convenience_enabled(&self) -> bool

Check if convenience features are enabled

fn base(&self) -> &ObservabilityManager

Get base observability manager

fn config(&self) -> &EnhancedObservabilityConfig

Get enhanced configuration

fn process_log_entry(&self, entry: LogEntry) -> Result<LogEntry>

Process log entry through all enabled features

fn get_performance_stats(&self) -> Option<PerformanceStats>

Get performance statistics (if enabled)

fn reset_performance_stats(&self) -> Result<()>

Reset performance statistics (if enabled)

fn get_panic_stats(&self) -> Result<PanicStats>

Get panic statistics if panic handler is enabled

fn reset_panic_stats(&self) -> Result<()>

Reset panic statistics if panic handler is enabled

fn capabilities(&self) -> Vec<&''static str>

Get manager capabilities

fn create_performance_extension(config: EnhancedObservabilityConfig) -> Result<PerformanceExtension>

Create performance extension from configuration

fn create_performance_extension_from_config(config_path: &str) -> Result<PerformanceExtension>

Create performance extension from configuration file