From 7fc2b1ebfe3774faa1a318a5ac2cf0b1c3dec983 Mon Sep 17 00:00:00 2001 From: Willem Date: Tue, 20 May 2025 15:59:01 -0400 Subject: [PATCH] feat: added monitoring stack example to lamp demo --- examples/lamp/src/main.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/lamp/src/main.rs b/examples/lamp/src/main.rs index 9d486eb..feac05d 100644 --- a/examples/lamp/src/main.rs +++ b/examples/lamp/src/main.rs @@ -3,10 +3,10 @@ use harmony::{ inventory::Inventory, maestro::Maestro, modules::{ - { lamp::{LAMPConfig, LAMPScore}, - }, - monitoring::monitoring_alerting::MonitoringAlertingStackScore, + monitoring::monitoring_alerting::{ + AlertChannel, MonitoringAlertingStackScore, WebhookServiceType, + }, }, topology::{K8sAnywhereTopology, Url}, }; @@ -45,8 +45,15 @@ async fn main() { .await .unwrap(); + let url = url::Url::parse("https://discord.com/api/webhooks/dummy_channel/dummy_token") + .expect("invalid URL"); + let mut monitoring_stack_score = MonitoringAlertingStackScore::new(); monitoring_stack_score.namespace = Some(lamp_stack.config.namespace.clone()); + monitoring_stack_score.alert_channel = Some(AlertChannel::WebHookUrl { + url: url, + webhook_service_type: WebhookServiceType::Discord, + }); maestro.register_all(vec![Box::new(lamp_stack), Box::new(monitoring_stack_score)]); // Here we bootstrap the CLI, this gives some nice features if you need them