Skip to content

Commit

Permalink
fix(agent): missing counter variable (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreDemailly authored Nov 14, 2023
1 parent 46d37d0 commit 99dfc19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: v18 temporarily disabled due to https://github.com/MyUnisoft/sigyn/actions/runs/6716893006/job/18253814002
node-version: [20.x]
node-version: [18.x, 20.x]
fail-fast: false
steps:
- name: Harden Runner
Expand All @@ -29,7 +28,7 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions src/agent/src/notifiers/rules.notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class RuleNotifier extends Notifier<RuleNotifierAlert> {
ruleConfig,
ruleName: rule.name,
count: rule.counter,
counter: rule.threshold,
threshold: ruleConfig.alert.on.count,
interval: ruleConfig.alert.on.interval,
label: { ...new StreamSelector(ruleConfig.logql).kv(), ...rule.labels },
Expand Down
2 changes: 1 addition & 1 deletion src/config/src/utils/compositeRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function handleTemplates(
return [];
}

const clonedRules = structuredClone(compositeRules);
const clonedRules = JSON.parse(JSON.stringify((compositeRules)));

for (const rule of clonedRules) {
if (typeof rule.template === "object" && rule.template.extends) {
Expand Down
6 changes: 3 additions & 3 deletions src/notifiers/src/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export class WebhookNotifier {
};

constructor(options: ExecuteWebhookOptions) {
this.webhookUrl = structuredClone(options.webhookUrl);
this.data = structuredClone(options.data);
this.template = structuredClone(options.template);
this.webhookUrl = JSON.parse(JSON.stringify((options.webhookUrl)));
this.data = JSON.parse(JSON.stringify((options.data)));
this.template = JSON.parse(JSON.stringify((options.template)));

this.#headers = {
"content-type": "application/json"
Expand Down

0 comments on commit 99dfc19

Please sign in to comment.