feat: added monitoring stack example to lamp demo
This commit is contained in:
parent
e80752ea3f
commit
7fc2b1ebfe
@ -3,10 +3,10 @@ use harmony::{
|
|||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
maestro::Maestro,
|
maestro::Maestro,
|
||||||
modules::{
|
modules::{
|
||||||
{
|
|
||||||
lamp::{LAMPConfig, LAMPScore},
|
lamp::{LAMPConfig, LAMPScore},
|
||||||
},
|
monitoring::monitoring_alerting::{
|
||||||
monitoring::monitoring_alerting::MonitoringAlertingStackScore,
|
AlertChannel, MonitoringAlertingStackScore, WebhookServiceType,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
topology::{K8sAnywhereTopology, Url},
|
topology::{K8sAnywhereTopology, Url},
|
||||||
};
|
};
|
||||||
@ -45,8 +45,15 @@ async fn main() {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.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();
|
let mut monitoring_stack_score = MonitoringAlertingStackScore::new();
|
||||||
monitoring_stack_score.namespace = Some(lamp_stack.config.namespace.clone());
|
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)]);
|
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
|
// Here we bootstrap the CLI, this gives some nice features if you need them
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user