Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override query with multiple metrics combined with OR #15

Open
varac opened this issue Nov 2, 2022 · 0 comments
Open

Can't override query with multiple metrics combined with OR #15

varac opened this issue Nov 2, 2022 · 0 comments

Comments

@varac
Copy link

varac commented Nov 2, 2022

The below example shows that prometheus-alert-overrider can't properly override a query with multiple metrics combined with OR.
The first metric is overridden fine, but the second one is not:

❯ cat bug-multiple-metrics-in-query.rules 
groups:
- name: example
  rules:

  - alert: test
    expr: 'probe_http_status_code <= 199 or probe_http_status_code >= 400'

  - alert: test_override
    override: ["test"]
    expr: 'probe_http_status_code{instance="https://example.org"} <= 199 or probe_http_status_code{instance="https://example.org"} >= 400'


❯ prometheus_alert_overrider bug-multiple-metrics-in-query.rules
groups:
- name: example
  rules:
  - alert: test
    expr: probe_http_status_code{instance!="https://example.org" <= 199 or probe_http_status_codeinstance="https://example.org"}
      <= 199 or probe_http_status_code >= 400
  - alert: test_override
    expr: probe_http_status_code{instance="https://example.org"} <= 199 or probe_http_status_code{instance="https://example.org"}
      >= 400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant