forked from NationTech/harmony
56 lines
1.7 KiB
Rust
56 lines
1.7 KiB
Rust
use serde::Serialize;
|
|
|
|
use crate::modules::monitoring::kube_prometheus::types::{
|
|
AlertManagerAdditionalPromRules, AlertManagerChannelConfig, ServiceMonitor,
|
|
};
|
|
|
|
#[derive(Debug, Clone, Serialize)]
|
|
pub struct KubePrometheusConfig {
|
|
pub namespace: Option<String>,
|
|
pub default_rules: bool,
|
|
pub windows_monitoring: bool,
|
|
pub alert_manager: bool,
|
|
pub node_exporter: bool,
|
|
pub prometheus: bool,
|
|
pub grafana: bool,
|
|
pub kubernetes_service_monitors: bool,
|
|
pub kubernetes_api_server: bool,
|
|
pub kubelet: bool,
|
|
pub kube_controller_manager: bool,
|
|
pub core_dns: bool,
|
|
pub kube_etcd: bool,
|
|
pub kube_scheduler: bool,
|
|
pub kube_proxy: bool,
|
|
pub kube_state_metrics: bool,
|
|
pub prometheus_operator: bool,
|
|
pub alert_receiver_configs: Vec<AlertManagerChannelConfig>,
|
|
pub alert_rules: Vec<AlertManagerAdditionalPromRules>,
|
|
pub additional_service_monitors: Vec<ServiceMonitor>,
|
|
}
|
|
impl KubePrometheusConfig {
|
|
pub fn new() -> Self {
|
|
Self {
|
|
namespace: None,
|
|
default_rules: true,
|
|
windows_monitoring: false,
|
|
alert_manager: true,
|
|
grafana: true,
|
|
node_exporter: true,
|
|
prometheus: true,
|
|
kubernetes_service_monitors: true,
|
|
kubernetes_api_server: true,
|
|
kubelet: true,
|
|
kube_controller_manager: true,
|
|
kube_etcd: true,
|
|
kube_proxy: true,
|
|
kube_state_metrics: true,
|
|
prometheus_operator: true,
|
|
core_dns: true,
|
|
kube_scheduler: true,
|
|
alert_receiver_configs: vec![],
|
|
alert_rules: vec![],
|
|
additional_service_monitors: vec![],
|
|
}
|
|
}
|
|
}
|