feat: scrape targets to be able to get snmp alerts from machines to prometheus #171
@ -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>>>>,
|
||||
letian marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
#[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,
|
||||
letian marked this conversation as resolved
Outdated
letian
commented
Should we actually configure something here? Because we pass an empty list it doesn't seem used. Should we actually configure something here? Because we pass an empty list it doesn't seem used.
wjro
commented
I will make this an Option<Vec> since it is not used in this score I will make this an Option<Vec<ScrapeTarget>> since it is not used in this score
|
||||
})
|
||||
}
|
||||
fn name(&self) -> String {
|
||||
|
Loading…
Reference in New Issue
Block a user
Should it be
scrape_targets
? as it's a vector