59 std::vector<std::string>
writers = {
"console"};
95 std::string
endpoint =
"http://localhost:4317";
286 {
"thread.pool_size",
"Number of worker threads (0 for auto)",
false,
287 "UNIFIED_THREAD_POOL_SIZE", {}},
288 {
"thread.queue_type",
"Task queue type",
false,
289 "UNIFIED_THREAD_QUEUE_TYPE", {
"mutex",
"lockfree",
"bounded"}},
290 {
"thread.max_queue_size",
"Maximum task queue size",
false,
291 "UNIFIED_THREAD_MAX_QUEUE_SIZE", {}},
294 {
"logger.level",
"Log level",
true,
295 "UNIFIED_LOGGER_LEVEL",
296 {
"trace",
"debug",
"info",
"warn",
"error",
"critical",
"off"}},
297 {
"logger.async",
"Enable async logging",
false,
298 "UNIFIED_LOGGER_ASYNC", {}},
299 {
"logger.buffer_size",
"Async buffer size",
false,
300 "UNIFIED_LOGGER_BUFFER_SIZE", {}},
301 {
"logger.file_path",
"Log file path",
true,
302 "UNIFIED_LOGGER_FILE_PATH", {}},
305 {
"monitoring.enabled",
"Enable monitoring",
false,
306 "UNIFIED_MONITORING_ENABLED", {}},
307 {
"monitoring.metrics_interval",
"Metrics collection interval (ms)",
true,
308 "UNIFIED_MONITORING_METRICS_INTERVAL_MS", {}},
309 {
"monitoring.tracing.enabled",
"Enable distributed tracing",
false,
310 "UNIFIED_MONITORING_TRACING_ENABLED", {}},
311 {
"monitoring.tracing.sampling_rate",
"Trace sampling rate",
true,
312 "UNIFIED_MONITORING_TRACING_SAMPLING_RATE", {}},
315 {
"database.backend",
"Database backend type",
false,
316 "UNIFIED_DATABASE_BACKEND",
317 {
"postgresql",
"mysql",
"sqlite",
"mongodb",
"redis"}},
318 {
"database.connection_string",
"Database connection string",
false,
319 "UNIFIED_DATABASE_CONNECTION_STRING", {}},
320 {
"database.pool.min_size",
"Minimum pool size",
false,
321 "UNIFIED_DATABASE_POOL_MIN_SIZE", {}},
322 {
"database.pool.max_size",
"Maximum pool size",
false,
323 "UNIFIED_DATABASE_POOL_MAX_SIZE", {}},
326 {
"network.tls.enabled",
"Enable TLS",
false,
327 "UNIFIED_NETWORK_TLS_ENABLED", {}},
328 {
"network.tls.version",
"TLS version",
false,
329 "UNIFIED_NETWORK_TLS_VERSION", {
"1.2",
"1.3"}},
330 {
"network.compression",
"Compression algorithm",
false,
331 "UNIFIED_NETWORK_COMPRESSION", {
"none",
"lz4",
"gzip",
"deflate",
"zstd"}},
332 {
"network.buffer_size",
"I/O buffer size",
false,
333 "UNIFIED_NETWORK_BUFFER_SIZE", {}},
343 static const std::vector<std::string> hot_reloadable_fields = {
346 "monitoring.metrics_interval",
347 "monitoring.tracing.sampling_rate",
350 for (
const auto& field : hot_reloadable_fields) {
351 if (field_path == field) {
std::vector< field_metadata > get_config_metadata()
Get metadata for all configuration fields.
constexpr const char * ENV_PREFIX
Environment variable prefix for configuration overrides.
bool is_hot_reloadable(const std::string &field_path)
Check if a configuration field supports hot-reload.
Database system configuration.
bool log_queries
Enable query logging.
std::string connection_string
Connection string or URI.
std::string backend
Database backend: "postgresql", "mysql", "sqlite", "mongodb", "redis".
pool_config pool
Connection pool configuration.
std::chrono::milliseconds slow_query_threshold
Slow query threshold.
Logging system configuration.
bool async
Enable async logging.
size_t max_file_size
Maximum file size in bytes (for rotating_file)
std::vector< std::string > writers
List of writers: "console", "file", "rotating_file", "network", "json".
std::string file_path
Log file path (for file writers)
size_t max_backup_files
Maximum number of backup files (for rotating_file)
size_t buffer_size
Async buffer size in bytes.
std::string format_pattern
Log format pattern.
std::string level
Log level: "trace", "debug", "info", "warn", "error", "critical", "off".
Monitoring system configuration.
std::chrono::milliseconds metrics_interval
Metrics collection interval.
bool enabled
Enable monitoring.
uint16_t prometheus_port
Prometheus metrics port (0 to disable)
std::chrono::milliseconds health_check_interval
Health check interval.
std::string prometheus_path
Prometheus metrics path.
tracing_config tracing
Tracing configuration.
Network system configuration.
std::chrono::milliseconds connect_timeout
Connection timeout.
size_t max_connections
Maximum concurrent connections (server)
std::chrono::milliseconds io_timeout
Read/write timeout.
size_t buffer_size
Send/receive buffer size.
tls_config tls
TLS configuration.
std::string compression
Compression type: "none", "lz4", "gzip", "deflate", "zstd".
std::chrono::milliseconds keepalive_interval
Keep-alive interval.
Database connection pool configuration.
size_t max_size
Maximum pool size.
size_t min_size
Minimum pool size.
std::chrono::milliseconds acquire_timeout
Connection acquisition timeout.
std::chrono::milliseconds idle_timeout
Idle connection timeout.
Thread pool configuration.
std::string queue_type
Queue type: "mutex", "lockfree", "bounded".
size_t pool_size
Number of worker threads (default: hardware concurrency)
size_t max_queue_size
Maximum queue size (for bounded queue)
std::string thread_name_prefix
Thread naming prefix.
std::string version
TLS version: "1.2", "1.3".
std::string key_path
Private key file path.
bool verify_peer
Verify peer certificate.
std::string cert_path
Certificate file path.
std::string ca_path
CA certificate path (for client verification)
Distributed tracing configuration.
std::string endpoint
Exporter endpoint.
std::string exporter
Exporter type: "otlp", "jaeger", "zipkin", "console".
bool enabled
Enable tracing.
double sampling_rate
Sampling rate (0.0 to 1.0)
Root configuration structure for the unified system.
network_config network
Network system configuration.
logger_config logger
Logger system configuration.
static unified_config defaults()
Create a configuration with all default values.
thread_config thread
Thread system configuration.
monitoring_config monitoring
Monitoring system configuration.
database_config database
Database system configuration.