Use the correct equality operator for Prometheus Alerts
What does this MR do?
The alerts interface currently allows =
as the equality operator instead of ==
. Prometheus requires the use of ==
https://prometheus.io/docs/prometheus/latest/querying/operators/#comparison-binary-operators
If =
is used as the equality operator a syntax error is returned from Prometheus and no alerts will be updated.
Screenshots
Pod logs:
level=error ts=2019-10-21T23:05:07.494875469Z caller=manager.go:656 component="rule manager" msg="loading groups failed" err="group \"production.rules\", rule 3, \"More requests\": could not parse expression: parse error at char 66: could not parse remaining input \"= 0.1\"..."
level=error ts=2019-10-21T23:05:07.49691446Z caller=main.go:643 msg="Failed to apply configuration" err="error loading rules, previous rule set restored"
level=error ts=2019-10-21T23:05:07.499299278Z caller=main.go:484 msg="Error reloading config" err="one or more errors occurred while applying the new configuration (--config.file=\"/etc/config/prometheus.yml\")"
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation created/updated or follow-up review issue created
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Addresses #34784 (closed)
Edited by 🤖 GitLab Bot 🤖