From 949c34d33c030bf6790c935680418376b9adf9e7 Mon Sep 17 00:00:00 2001 From: Jorge Creixell Date: Mon, 23 Oct 2023 11:40:14 +0200 Subject: [PATCH] Fix alert for Agent Management in mixin The `AgentRemoteConfigBadAPIRequests` was using the wrong operator to evaluate the pattern. --- production/grafana-agent-mixin/alerts.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/grafana-agent-mixin/alerts.libsonnet b/production/grafana-agent-mixin/alerts.libsonnet index 80559639d42b..51fe81e0e539 100644 --- a/production/grafana-agent-mixin/alerts.libsonnet +++ b/production/grafana-agent-mixin/alerts.libsonnet @@ -242,7 +242,7 @@ local _config = config._config; { alert: 'AgentRemoteConfigBadAPIRequests', expr: ||| - 100 * sum(rate(agent_remote_config_fetches_total{status_code="(4|5).."}[10m])) by (%(group_by_cluster)s) + 100 * sum(rate(agent_remote_config_fetches_total{status_code=~"(4|5).."}[10m])) by (%(group_by_cluster)s) / sum(rate(agent_remote_config_fetches_total[10m])) by (%(group_by_cluster)s) > 5 @@ -260,7 +260,7 @@ local _config = config._config; { alert: 'AgentRemoteConfigBadAPIRequests', expr: ||| - 100 * sum(rate(agent_remote_config_fetches_total{status_code="(4|5).."}[10m])) by (%(group_by_cluster)s) + 100 * sum(rate(agent_remote_config_fetches_total{status_code=~"(4|5).."}[10m])) by (%(group_by_cluster)s) / sum(rate(agent_remote_config_fetches_total[10m])) by (%(group_by_cluster)s) > 10