# Monitoring configuration fragment
# Conditional: when enable_monitoring == true

[[elements]]
default = true
help = "Enable Prometheus for metrics collection"
name = "enable_prometheus"
nickel_path = ["provisioning", "monitoring", "prometheus", "enabled"]
prompt = "Enable Prometheus?"
required = true
type = "confirm"
when = "enable_monitoring == true"

[[elements]]
custom_type = "u16"
default = "9090"
help = "Port for Prometheus web UI"
maximum = "65535"
minimum = "1024"
name = "prometheus_port"
nickel_path = ["provisioning", "monitoring", "prometheus", "port"]
prompt = "Prometheus port"
required = true
type = "custom"
when = "enable_monitoring == true && enable_prometheus == true"

[[elements]]
default = "15d"
help = "How long to keep metrics (e.g., '15d', '30d')"
name = "prometheus_retention"
nickel_path = ["provisioning", "monitoring", "prometheus", "retention"]
prompt = "Data retention period"
required = true
type = "text"
when = "enable_monitoring == true && enable_prometheus == true"

[[elements]]
default = true
help = "Enable Grafana for visualizing metrics"
name = "enable_grafana"
nickel_path = ["provisioning", "monitoring", "grafana", "enabled"]
prompt = "Enable Grafana?"
required = true
type = "confirm"
when = "enable_monitoring == true"

[[elements]]
custom_type = "u16"
default = "3000"
help = "Port for Grafana web UI"
maximum = "65535"
minimum = "1024"
name = "grafana_port"
nickel_path = ["provisioning", "monitoring", "grafana", "port"]
prompt = "Grafana port"
required = true
type = "custom"
when = "enable_monitoring == true && enable_grafana == true"

[[elements]]
default = "admin"
help = "Admin username for Grafana"
name = "grafana_admin_user"
nickel_path = ["provisioning", "monitoring", "grafana", "admin_user"]
prompt = "Grafana admin username"
required = true
type = "text"
when = "enable_monitoring == true && enable_grafana == true"

[[elements]]
default = "changeme"
help = "Admin password for Grafana (min 8 characters)"
name = "grafana_admin_password"
nickel_path = ["provisioning", "monitoring", "grafana", "admin_password"]
prompt = "Grafana admin password"
required = true
type = "password"
when = "enable_monitoring == true && enable_grafana == true"

[[elements]]
default = false
help = "Enable Loki for log aggregation"
name = "enable_loki"
nickel_path = ["provisioning", "monitoring", "loki", "enabled"]
prompt = "Enable Loki?"
required = true
type = "confirm"
when = "enable_monitoring == true"

[[elements]]
default = false
help = "Enable Jaeger for distributed tracing"
name = "enable_jaeger"
nickel_path = ["provisioning", "monitoring", "jaeger", "enabled"]
prompt = "Enable Jaeger?"
required = true
type = "confirm"
when = "enable_monitoring == true"
