Bug 1904161

Summary: AlertmanagerReceiversNotConfigured fires unconditionally on alertmanager restart
Product: OpenShift Container Platform Reporter: Seth Jennings <sjenning>
Component: MonitoringAssignee: Rick Rackow <rrackow>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.6CC: alegrand, anpicker, clasohm, erooth, kakkoyun, lcosic, lstanton, pkrupa, shishika, spasquie, surbania
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1967938 (view as bug list) Environment:
Last Closed: 2021-02-24 15:37:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1967938    

Description Seth Jennings 2020-12-03 18:10:13 UTC
Description of problem:

The alerting rule for AlertmanagerReceiversNotConfigured has a bug.

The alerting expression is `cluster:alertmanager_routing_enabled:max == 0`

`cluster:alertmanager_routing_enabled:max` is rule `clamp_max(sum(alertmanager_notifications_total), 1)`

`alertmanager_notifications_total` is simply the number of notifications an alertmanager instance has sent since it started.  However, in a newly started alertmanager instance, this is 0.  Thus, until alertmanager has sent the first alert, AlertmanagerReceiversNotConfigured will fire.

Hilariously enough, AlertmanagerReceiversNotConfigured firing and triggering an alert increases alertmanager_notifications_total and resolves the alert.

The end result is that every time a customer upgrades or rolls out a new MachineConfig to workers (i.e. anything that causes all the alertmanager instances to restart), they will get this alert.

Version-Release number of selected component (if applicable):
4.6.6

How reproducible:
Always

Steps to Reproduce:
1. Configure alertmanager receivers
2. oc scale statefulset alertmanager-main --replicas=0
3. CVO will override and scale alertmanager back up
4. After 10m, AlertmanagerReceiversNotConfigured will fire

Actual results:
AlertmanagerReceiversNotConfigured fires when receivers are configured

Expected results:
AlertmanagerReceiversNotConfigured should not fire when receivers are configured

Additional info:

Comment 5 Junqi Zhao 2020-12-10 07:49:26 UTC
tested with 4.7.0-0.nightly-2020-12-09-112139, followed the steps in comment 0, AlertmanagerReceiversNotConfigured alert was not fired again
      - expr: clamp_max(sum(alertmanager_integrations),1)
        record: cluster:alertmanager_routing_enabled:max

Comment 9 errata-xmlrpc 2021-02-24 15:37:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633

Comment 10 Simon Pasquier 2021-06-04 13:18:45 UTC
*** Bug 1965406 has been marked as a duplicate of this bug. ***