monitoring-alerting #30

Merged
wjro merged 12 commits from monitoring-alerting into master 2025-05-06 17:50:57 +00:00
7 changed files with 88 additions and 0 deletions
Showing only changes of commit 40cd765019 - Show all commits

View File

@ -10,3 +10,4 @@ pub mod load_balancer;
pub mod okd;
pub mod opnsense;
pub mod tftp;
pub mod monitoring;

View File

@ -0,0 +1,3 @@
mod monitoring_alerting;
mod resources;
pub use monitoring_alerting::*;

View File

@ -0,0 +1,23 @@
use serde::Serialize;
use crate::{
interpret::Interpret, maestro::Maestro, modules::helm::chart::HelmChartScore, score::Score, topology::{K8sclient, Topology}
};
#[derive(Debug, Clone, Serialize)]
pub struct MonitoringAlertingStackScore {
monitoring: HelmChartScore,
alerting: HelmChartScore,
alert_manager: HelmChartScore,
}
impl<T: Topology> Score<T> for MonitoringAlertingStackScore {
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
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
fn name(&self) -> String {
format!("Monitoring: {}\n, Alerting: {}\n, Alert Manager: {}\n", self.monitoring, self.alerting, self.alert_manager)
}
}

View File

@ -0,0 +1,19 @@
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

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

View File

@ -0,0 +1,19 @@
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,
}
}

View File

@ -0,0 +1,20 @@
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,
}
}