Skip to content

Commit

Permalink
mixin: Exclude cache "add" operations from alerting
Browse files Browse the repository at this point in the history
Exclude alerts from firing about cache "add" operations failing since
this is expected during normal operation.

Related #9386

Signed-off-by: Nick Pillitteri <[email protected]>
  • Loading branch information
56quarters committed Oct 17, 2024
1 parent 9d8252f commit b5e02a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions operations/mimir-mixin-compiled-baremetal/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ groups:
expr: |
(
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operation_failures_total[1m])
rate(thanos_memcached_operation_failures_total{operation!="add"}[1m])
or
rate(thanos_cache_operation_failures_total[1m])
rate(thanos_cache_operation_failures_total{operation!="add"}[1m])
)
/
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operations_total[1m])
rate(thanos_memcached_operations_total{operation!="add"}[1m])
or
rate(thanos_cache_operations_total[1m])
rate(thanos_cache_operations_total{operation!="add"}[1m])
)
) * 100 > 5
for: 5m
Expand Down
8 changes: 4 additions & 4 deletions operations/mimir-mixin-compiled/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ groups:
expr: |
(
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operation_failures_total[1m])
rate(thanos_memcached_operation_failures_total{operation!="add"}[1m])
or
rate(thanos_cache_operation_failures_total[1m])
rate(thanos_cache_operation_failures_total{operation!="add"}[1m])
)
/
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operations_total[1m])
rate(thanos_memcached_operations_total{operation!="add"}[1m])
or
rate(thanos_cache_operations_total[1m])
rate(thanos_cache_operations_total{operation!="add"}[1m])
)
) * 100 > 5
for: 5m
Expand Down
10 changes: 6 additions & 4 deletions operations/mimir-mixin/alerts/alerts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,20 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
{
alert: $.alertName('CacheRequestErrors'),
// Specifically exclude "add" operations which are used for cache invalidation and "locking" since
// they are expected to sometimes fail in normal operation (such as when a "lock" alread exists).
expr: |||
(
sum by(%(group_by)s, name, operation) (
rate(thanos_memcached_operation_failures_total[%(range_interval)s])
rate(thanos_memcached_operation_failures_total{operation!="add"}[%(range_interval)s])
or
rate(thanos_cache_operation_failures_total[%(range_interval)s])
rate(thanos_cache_operation_failures_total{operation!="add"}[%(range_interval)s])
)
/
sum by(%(group_by)s, name, operation) (
rate(thanos_memcached_operations_total[%(range_interval)s])
rate(thanos_memcached_operations_total{operation!="add"}[%(range_interval)s])
or
rate(thanos_cache_operations_total[%(range_interval)s])
rate(thanos_cache_operations_total{operation!="add"}[%(range_interval)s])
)
) * 100 > 5
||| % {
Expand Down

0 comments on commit b5e02a6

Please sign in to comment.