Skip to content

Commit 8b6f056

Browse files
authored
fix: Only alert on cluster drift when cluster_name is set (#5181)
1 parent 108a2bd commit 8b6f056

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

operations/alloy-mixin/alerts/clustering.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ local alert = import './utils/alert.jsonnet';
8080
'ClusterConfigurationDrift',
8181
if enableK8sCluster then |||
8282
count without (sha256) (
83-
max by (cluster, namespace, sha256, job, cluster_name) (alloy_config_hash and on(cluster, namespace, job, cluster_name) cluster_node_info)
83+
max by (cluster, namespace, sha256, job, cluster_name) (alloy_config_hash{cluster_name!=""} and on(cluster, namespace, job, cluster_name) cluster_node_info)
8484
) > 1
8585
||| else |||
8686
count without (sha256) (
87-
max by (sha256, job) (alloy_config_hash and on(job) cluster_node_info)
87+
max by (sha256, job) (alloy_config_hash{cluster_name!=""} and on(job) cluster_node_info)
8888
) > 1
8989
|||
9090
,

operations/alloy-mixin/rendered/alerts/alloy_clustering.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"summary": "Cluster configuration drifting."
5252
"expr": |
5353
count without (sha256) (
54-
max by (cluster, namespace, sha256, job, cluster_name) (alloy_config_hash and on(cluster, namespace, job, cluster_name) cluster_node_info)
54+
max by (cluster, namespace, sha256, job, cluster_name) (alloy_config_hash{cluster_name!=""} and on(cluster, namespace, job, cluster_name) cluster_node_info)
5555
) > 1
5656
"for": "5m"
5757
"labels":

0 commit comments

Comments
 (0)