feat: Alerting module architecture to make it easy to use and extensible by external crates
Co-authored-by: Jean-Gabriel Gill-Couture <jg@nationtech.io> Reviewed-on: #61 Reviewed-by: johnride <jg@nationtech.io> Co-authored-by: Willem <wrolleman@nationtech.io> Co-committed-by: Willem <wrolleman@nationtech.io>
This commit is contained in:
25
examples/monitoring/src/main.rs
Normal file
25
examples/monitoring/src/main.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use harmony::{
|
||||
inventory::Inventory, maestro::Maestro,
|
||||
modules::monitoring::kube_prometheus::helm_prometheus_alert_score::HelmPrometheusAlertingScore,
|
||||
topology::K8sAnywhereTopology,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let alerting_score = HelmPrometheusAlertingScore { receivers: vec![] };
|
||||
let mut maestro = Maestro::<K8sAnywhereTopology>::initialize(
|
||||
Inventory::autoload(),
|
||||
K8sAnywhereTopology::from_env(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
//let monitoring = MonitoringAlertingScore {
|
||||
// alert_receivers: vec![],
|
||||
// alert_rules: vec![],
|
||||
// scrape_targets: vec![],
|
||||
//};
|
||||
//maestro.register_all(vec![Box::new(monitoring)]);
|
||||
maestro.register_all(vec![Box::new(alerting_score)]);
|
||||
harmony_cli::init(maestro, None).await.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user