# Metrics Feature Configuration - Development Environment
# Settings optimized for local development and debugging

[features]
metrics = true

# Metrics Configuration - Development
[metrics]
enabled = true
endpoint = "/metrics"
port = 9090
host = "127.0.0.1"
format = "prometheus"  # "prometheus", "json", "statsd"
collection_interval = 15  # seconds
retention_period = 3600  # 1 hour for development

# Prometheus Configuration - Development
[metrics.prometheus]
enabled = true
endpoint = "/metrics"
include_default_metrics = true
include_process_metrics = true
include_runtime_metrics = true
histogram_buckets = [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0]

# System Metrics - Development
[metrics.system]
enabled = true
collect_cpu = true
collect_memory = true
collect_disk = true
collect_network = true
collect_load = true
collect_processes = false
collection_interval = 10  # seconds

# HTTP Metrics - Development
[metrics.http]
enabled = true
track_requests = true
track_response_times = true
track_status_codes = true
track_request_size = true
track_response_size = true
track_user_agents = false
track_ip_addresses = false
histogram_buckets = [0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0]

# Database Metrics - Development
[metrics.database]
enabled = true
track_queries = true
track_query_duration = true
track_connection_pool = true
track_slow_queries = true
slow_query_threshold = 100  # milliseconds
track_query_types = true
log_queries = true

# Application Metrics - Development
[metrics.application]
enabled = true
track_business_metrics = true
track_custom_counters = true
track_custom_gauges = true
track_custom_histograms = true
track_feature_usage = true
track_errors = true
track_warnings = true

# Performance Metrics - Development
[metrics.performance]
enabled = true
track_memory_usage = true
track_cpu_usage = true
track_gc_metrics = true
track_thread_metrics = true
track_async_metrics = true
profile_slow_operations = true
profile_threshold = 50  # milliseconds

# Cache Metrics - Development
[metrics.cache]
enabled = true
track_hit_rate = true
track_miss_rate = true
track_eviction_rate = true
track_memory_usage = true
track_operation_times = true

# Security Metrics - Development
[metrics.security]
enabled = true
track_failed_logins = true
track_blocked_requests = true
track_rate_limit_hits = true
track_csrf_failures = true
track_auth_events = true
log_security_events = true

# Custom Metrics - Development
[metrics.custom]
enabled = true
user_registrations = true
user_logins = true
content_views = true
api_calls = true
feature_toggles = true
error_rates = true

# Alerting - Development (basic)
[metrics.alerting]
enabled = false
webhook_url = "http://localhost:3001/alerts"
alert_on_high_error_rate = false
error_rate_threshold = 0.1
alert_on_high_response_time = false
response_time_threshold = 1000  # milliseconds
alert_on_low_memory = false
memory_threshold = 0.1  # 10% available

# Export Configuration - Development
[metrics.export]
enabled = true
formats = ["prometheus", "json"]
file_export = true
export_dir = "metrics"
export_interval = 60  # seconds
compress_exports = false

# Grafana Integration - Development
[metrics.grafana]
enabled = false
url = "http://localhost:3000"
dashboard_enabled = false
auto_create_dashboards = false
api_key = ""

# StatsD Configuration - Development
[metrics.statsd]
enabled = false
host = "localhost"
port = 8125
prefix = "rustelo.dev"
tags_enabled = true

# Logging Configuration - Development
[metrics.logging]
enabled = true
log_level = "debug"
log_file = "logs/metrics.log"
log_to_console = true
log_slow_metrics = true
log_collection_errors = true

# Performance Settings - Development
[metrics.performance]
async_collection = true
buffer_size = 1000
batch_size = 100
collection_timeout = 5000  # milliseconds
max_memory_usage = 104857600  # 100MB

# Development Settings
[metrics.development]
debug_mode = true
verbose_logging = true
collect_debug_metrics = true
expose_internal_metrics = true
enable_metric_explorer = true
mock_external_metrics = true
