diff --git a/harmony/src/modules/monitoring/monitoring_alerting.rs b/harmony/src/modules/monitoring/monitoring_alerting.rs index 47d7e50..1379e29 100644 --- a/harmony/src/modules/monitoring/monitoring_alerting.rs +++ b/harmony/src/modules/monitoring/monitoring_alerting.rs @@ -1,7 +1,11 @@ use serde::Serialize; use crate::{ - interpret::Interpret, maestro::Maestro, modules::helm::chart::HelmChartScore, score::Score, topology::{K8sclient, Topology} + interpret::Interpret, + maestro::Maestro, + modules::helm::chart::HelmChartScore, + score::Score, + topology::{K8sclient, Topology}, }; #[derive(Debug, Clone, Serialize)] @@ -10,12 +14,60 @@ pub struct MonitoringAlertingStackScore { } impl Score for MonitoringAlertingStackScore { - fn create_interpret(&self) -> Box> { - todo!() + Box::new(MonitoringAlertingStackInterpret { + score: self.clone(), + }) } fn name(&self) -> String { + format!( + "{} {} MonitoringAlertingStackScore", + self.monitoring.chart_name, self.monitoring.release_name + ) + } +} + +#[derive(Debug, Serialize)] +struct MonitoringAlertingStackInterpret { + pub score: MonitoringAlertingStackScore, +} + +#[async_trait] +impl Interpret for MonitoringAlertingStackInterpret { + fn execute<'life0, 'life1, 'life2, 'async_trait>( + &'life0 self, + inventory: &'life1 Inventory, + topology: &'life2 T, + ) -> ::core::pin::Pin< + Box< + dyn ::core::future::Future> + + ::core::marker::Send + + 'async_trait, + >, + > + where + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait, + Self: 'async_trait, + { + todo!() + } + + fn get_name(&self) -> InterpretName { + todo!() + } + + fn get_version(&self) -> Version { + todo!() + } + + fn get_status(&self) -> InterpretStatus { + todo!() + } + + fn get_children(&self) -> Vec { todo!() } } diff --git a/harmony/src/modules/monitoring/resources/kube_prometheus.rs b/harmony/src/modules/monitoring/resources/kube_prometheus.rs index 4be77b3..620b27e 100644 --- a/harmony/src/modules/monitoring/resources/kube_prometheus.rs +++ b/harmony/src/modules/monitoring/resources/kube_prometheus.rs @@ -9,10 +9,11 @@ use crate::modules::helm::chart::HelmChartScore; pub fn kube_prometheus_score(ns: &str) -> HelmChartScore { HelmChartScore { namespace: Some(NonBlankString::from_str(ns).unwrap()), - release_name: NonBlankString::from_str("es").unwrap(), + release_name: NonBlankString::from_str("kube-prometheus").unwrap(), chart_name: NonBlankString::from_str( - todo!() //use kube prometheus chart which includes grafana, prometheus, alert - //manager, etc + "https://prometheus-community.github.io/helm-charts" + //use kube prometheus chart which includes grafana, prometheus, alert + //manager, etc ) .unwrap(), chart_version: None,