From 6c145f1100f75ac051b4405e5437d67fc591f91e Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 28 Apr 2025 16:31:22 -0400 Subject: [PATCH] wip: initial layout --- .../modules/monitoring/monitoring_alerting.rs | 4 +--- .../modules/monitoring/resources/grafana.rs | 19 ------------------ .../{prometheus.rs => kube_prometheus.rs} | 6 ++++-- .../src/modules/monitoring/resources/mod.rs | 4 +--- .../resources/prometheus_alert_manager.rs | 20 ------------------- 5 files changed, 6 insertions(+), 47 deletions(-) delete mode 100644 harmony/src/modules/monitoring/resources/grafana.rs rename harmony/src/modules/monitoring/resources/{prometheus.rs => kube_prometheus.rs} (70%) delete mode 100644 harmony/src/modules/monitoring/resources/prometheus_alert_manager.rs diff --git a/harmony/src/modules/monitoring/monitoring_alerting.rs b/harmony/src/modules/monitoring/monitoring_alerting.rs index fd7772b..47d7e50 100644 --- a/harmony/src/modules/monitoring/monitoring_alerting.rs +++ b/harmony/src/modules/monitoring/monitoring_alerting.rs @@ -7,8 +7,6 @@ use crate::{ #[derive(Debug, Clone, Serialize)] pub struct MonitoringAlertingStackScore { monitoring: HelmChartScore, - alerting: HelmChartScore, - alert_manager: HelmChartScore, } impl Score for MonitoringAlertingStackScore { @@ -18,6 +16,6 @@ impl Score for MonitoringAlertingStackScore { } fn name(&self) -> String { - format!("Monitoring: {}\n, Alerting: {}\n, Alert Manager: {}\n", self.monitoring, self.alerting, self.alert_manager) + todo!() } } diff --git a/harmony/src/modules/monitoring/resources/grafana.rs b/harmony/src/modules/monitoring/resources/grafana.rs deleted file mode 100644 index 87cc512..0000000 --- a/harmony/src/modules/monitoring/resources/grafana.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::str::FromStr; - -use non_blank_string_rs::NonBlankString; - -use crate::modules::helm::chart::HelmChartScore; - - -pub fn grafana_score(ns: &str) -> HelmChartScore { - HelmChartScore { - namespace: Some(NonBlankString::from_str(ns).unwrap()), - release_name: NonBlankString::from_str("es").unwrap(), - chart_name: NonBlankString::from_str( - "oci://registry-1.docker.io/bitnamicharts/grafana", - ) - .unwrap(), - chart_version: None, - values_overrides: None, - } -} diff --git a/harmony/src/modules/monitoring/resources/prometheus.rs b/harmony/src/modules/monitoring/resources/kube_prometheus.rs similarity index 70% rename from harmony/src/modules/monitoring/resources/prometheus.rs rename to harmony/src/modules/monitoring/resources/kube_prometheus.rs index 844e351..4be77b3 100644 --- a/harmony/src/modules/monitoring/resources/prometheus.rs +++ b/harmony/src/modules/monitoring/resources/kube_prometheus.rs @@ -1,3 +1,4 @@ + use std::str::FromStr; use non_blank_string_rs::NonBlankString; @@ -5,12 +6,13 @@ use non_blank_string_rs::NonBlankString; use crate::modules::helm::chart::HelmChartScore; -pub fn elasticsearch_score(ns: &str) -> HelmChartScore { +pub fn kube_prometheus_score(ns: &str) -> HelmChartScore { HelmChartScore { namespace: Some(NonBlankString::from_str(ns).unwrap()), release_name: NonBlankString::from_str("es").unwrap(), chart_name: NonBlankString::from_str( - todo()! + todo!() //use kube prometheus chart which includes grafana, prometheus, alert + //manager, etc ) .unwrap(), chart_version: None, diff --git a/harmony/src/modules/monitoring/resources/mod.rs b/harmony/src/modules/monitoring/resources/mod.rs index 4af87f6..fd3d57a 100644 --- a/harmony/src/modules/monitoring/resources/mod.rs +++ b/harmony/src/modules/monitoring/resources/mod.rs @@ -1,3 +1 @@ -mod grafana; -mod prometheus; -mod prometheus_alert_manager; +mod kube_prometheus; diff --git a/harmony/src/modules/monitoring/resources/prometheus_alert_manager.rs b/harmony/src/modules/monitoring/resources/prometheus_alert_manager.rs deleted file mode 100644 index 4b2a583..0000000 --- a/harmony/src/modules/monitoring/resources/prometheus_alert_manager.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::str::FromStr; - -use non_blank_string_rs::NonBlankString; - -use crate::modules::helm::chart::HelmChartScore; - - -pub fn elasticsearch_score(ns: &str) -> HelmChartScore { - HelmChartScore { - namespace: Some(NonBlankString::from_str(ns).unwrap()), - release_name: NonBlankString::from_str("es").unwrap(), - chart_name: NonBlankString::from_str( - todo()! - ) - .unwrap(), - chart_version: None, - values_overrides: None, - } -} -