Bug 2115347 - 03279843 | Sev 3 | Negative regex matchers for alertmanager silences not properly parsed or read by console
Summary: 03279843 | Sev 3 | Negative regex matchers for alertmanager silences not prop...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.12.0
Assignee: Andrew Pickering
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-04 13:16 UTC by David Caldwell
Modified: 2023-01-17 19:54 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-17 19:54:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 12139 0 None open [WIP] Bug 2115347: Monitoring: Add support for Alertmanager negative matchers 2022-10-06 04:15:38 UTC
Red Hat Product Errata RHSA-2022:7399 0 None None None 2023-01-17 19:54:35 UTC

Description David Caldwell 2022-08-04 13:16:46 UTC
Description of problem:

The web console is not parsing regular expressions containing exclamation marks when creating alertmanager silence rules nor when reading existing silence rules.

No other characters or expressions have been observed to not be parsed properly by the console in this way.

The webconsole URL used: [https://console-openshift-console.apps.ocpxx.cloud.xxxxx.app.domain.com/monitoring/silences?rowFilter-silence-state=active%2Cpending]


How reproducible:

Scenario 1:

Create an alertmanager rule that silences an alert using "!=" regex logic. 

Switch to webconsole and it is changed to "=".

Scenario 2:

Create a rule as above but directly in the webconsole. 

Notice that the rule is not saved with the "!=" expression logic.


Additional info:

Original customer description in private comment.

Please also see private attachment screenshots.

Comment 6 Robb Hamilton 2022-08-15 14:07:42 UTC
Reassigning to Andy since he is the most knowledgable regarding alerting and implemented the existing code.

Comment 12 Junqi Zhao 2022-10-27 06:32:32 UTC
tested with 4.12.0-0.nightly-2022-10-25-210451, "Create silence" page, "Negative matcher" check box is added, tested with comment in Comment 5
sh-4.4$ amtool --alertmanager.url http://localhost:9093 silence add 'alertname!~.*signalilo.*' -a author -c amtooltest -d 2h
ecf60de1-3320-4a97-990f-3eb38e38834d
sh-4.4$ amtool --alertmanager.url http://localhost:9093 alert query
Alertname  Starts At  Summary  State  
sh-4.4$ amtool --alertmanager.url http://localhost:9093 silence query
ID                                    Matchers                    Ends At                  Created By  Comment     
ecf60de1-3320-4a97-990f-3eb38e38834d  alertname!~".*signalilo.*"  2022-10-27 08:15:46 UTC  author      amtooltest  

checked in console page, silence matcher is alertname!~.*signalilo.*, negative regex matcher is properly parsed by console.

Comment 18 errata-xmlrpc 2023-01-17 19:54:14 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.12.0 bug fix and security 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-2022:7399


Note You need to log in before you can comment on or make changes to this bug.