monitoring-alerting #30

Merged
wjro merged 12 commits from monitoring-alerting into master 2025-05-06 17:50:57 +00:00
5 changed files with 6 additions and 47 deletions
Showing only changes of commit 6c145f1100 - Show all commits

View File

@ -7,8 +7,6 @@ use crate::{
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
pub struct MonitoringAlertingStackScore { pub struct MonitoringAlertingStackScore {
monitoring: HelmChartScore, monitoring: HelmChartScore,
alerting: HelmChartScore,
alert_manager: HelmChartScore,
} }
impl<T: Topology> Score<T> for MonitoringAlertingStackScore { impl<T: Topology> Score<T> for MonitoringAlertingStackScore {
@ -18,6 +16,6 @@ impl<T: Topology> Score<T> for MonitoringAlertingStackScore {
} }
fn name(&self) -> String { fn name(&self) -> String {
format!("Monitoring: {}\n, Alerting: {}\n, Alert Manager: {}\n", self.monitoring, self.alerting, self.alert_manager) todo!()
Outdated
Review

Why does the MonitoringAlertingStackScore need a Vec<Box<dyn Score<MonitoringAlertingTopology>>>? It seems like it's never used for anything.

A score's variables should be what is needed to set it up, i.e. any values, rules, etc you want to pass in for the interpret to use to spin up the score

Why does the `MonitoringAlertingStackScore` need a `Vec<Box<dyn Score<MonitoringAlertingTopology>>>`? It seems like it's never used for anything. A score's variables should be what is needed to set it up, i.e. any values, rules, etc you want to pass in for the interpret to use to spin up the score
} }
} }

View File

@ -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,
}
}

View File

@ -1,3 +1,4 @@
use std::str::FromStr; use std::str::FromStr;
use non_blank_string_rs::NonBlankString; use non_blank_string_rs::NonBlankString;
@ -5,12 +6,13 @@ use non_blank_string_rs::NonBlankString;
use crate::modules::helm::chart::HelmChartScore; use crate::modules::helm::chart::HelmChartScore;
pub fn elasticsearch_score(ns: &str) -> HelmChartScore { pub fn kube_prometheus_score(ns: &str) -> HelmChartScore {
HelmChartScore { HelmChartScore {
namespace: Some(NonBlankString::from_str(ns).unwrap()), namespace: Some(NonBlankString::from_str(ns).unwrap()),
release_name: NonBlankString::from_str("es").unwrap(), release_name: NonBlankString::from_str("es").unwrap(),
chart_name: NonBlankString::from_str( chart_name: NonBlankString::from_str(
todo()! todo!() //use kube prometheus chart which includes grafana, prometheus, alert
//manager, etc
) )
.unwrap(), .unwrap(),
chart_version: None, chart_version: None,

View File

@ -1,3 +1 @@
mod grafana; mod kube_prometheus;
mod prometheus;
mod prometheus_alert_manager;

View File

@ -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,
}
}