forked from NationTech/harmony
		
	fix: made targets plural and changed scrape targets to option in AlertingInterpret
This commit is contained in:
		
							parent
							
								
									a815f6ac9c
								
							
						
					
					
						commit
						cb66b7592e
					
				| @ -21,7 +21,7 @@ pub struct AlertingInterpret<S: AlertSender> { | ||||
|     pub sender: S, | ||||
|     pub receivers: Vec<Box<dyn AlertReceiver<S>>>, | ||||
|     pub rules: Vec<Box<dyn AlertRule<S>>>, | ||||
|     pub scrape_target: Vec<Box<dyn ScrapeTarget<S>>>, | ||||
|     pub scrape_targets: Option<Vec<Box<dyn ScrapeTarget<S>>>>, | ||||
| } | ||||
| 
 | ||||
| #[async_trait] | ||||
| @ -39,9 +39,11 @@ impl<S: AlertSender + Installable<T>, T: Topology> Interpret<T> for AlertingInte | ||||
|             debug!("installing rule: {:#?}", rule); | ||||
|             rule.install(&self.sender).await?; | ||||
|         } | ||||
|         for target in self.scrape_target.iter() { | ||||
|             debug!("installing scrape_target: {:#?}", target); | ||||
|             target.install(&self.sender).await?; | ||||
|         if let Some(targets) = &self.scrape_targets { | ||||
|             for target in targets.iter() { | ||||
|                 debug!("installing scrape_target: {:#?}", target); | ||||
|                 target.install(&self.sender).await?; | ||||
|             } | ||||
|         } | ||||
|         self.sender.ensure_installed(inventory, topology).await?; | ||||
|         Ok(Outcome::success(format!( | ||||
|  | ||||
| @ -31,7 +31,7 @@ impl<T: Topology + HelmCommand + TenantManager> Score<T> for HelmPrometheusAlert | ||||
|             sender: KubePrometheus { config }, | ||||
|             receivers: self.receivers.clone(), | ||||
|             rules: self.rules.clone(), | ||||
|             scrape_target: vec![], | ||||
|             scrape_targets: None, | ||||
|         }) | ||||
|     } | ||||
|     fn name(&self) -> String { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user