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

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

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

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

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

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

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

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

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

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