From 7814a3bbe824b1a6aeff3bc4c2ddb59318788cdf Mon Sep 17 00:00:00 2001 From: PierreDemailly <39910767+PierreDemailly@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:38:42 +0100 Subject: [PATCH] fix(agent): catch loki datasource call on alert (#330) --- src/agent/src/notifiers/rules.notifier.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/agent/src/notifiers/rules.notifier.ts b/src/agent/src/notifiers/rules.notifier.ts index f755b18..95d95ed 100644 --- a/src/agent/src/notifiers/rules.notifier.ts +++ b/src/agent/src/notifiers/rules.notifier.ts @@ -76,13 +76,13 @@ export class RuleNotifier extends Notifier { const { notifierConfig, rule } = alert; const ruleConfig = this.config.rules.find((configRule) => configRule.name === rule.name)!; - const notifierOptions = { - ...notifierConfig, - data: await this.#notiferAlertData(alert), - template: ruleConfig!.alert.template - }; - try { + const notifierOptions = { + ...notifierConfig, + data: await this.#notiferAlertData(alert), + template: ruleConfig!.alert.template + }; + await this.execute(notifierOptions); this.logger.info(`[${rule.name}](notify: success|notifier: ${notifierConfig.notifier})`);