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

Wrong override for complex expr #14

Open
varac opened this issue Oct 24, 2022 · 1 comment
Open

Wrong override for complex expr #14

varac opened this issue Oct 24, 2022 · 1 comment

Comments

@varac
Copy link

varac commented Oct 24, 2022

I have this alert expression which I'd like to override:

  - alert: BlackboxSlowProbe
    expr: 'avg_over_time(probe_duration_seconds[2m]) > 5'

The override looks like this:

  - alert: BlackboxSlowProbe_slow
    override: ["BlackboxSlowProbe"]
    expr: 'avg_over_time(probe_duration_seconds{instance=~"84.200.69.80|9.9.9.9|example.de:22"}[2m]) > 5'

But the resulted alerts look like this:

First, the additional new rule, where the expr is fine:

  - alert: BlackboxSlowProbe_slow
    expr: avg_over_time(probe_duration_seconds{instance=~"84.200.69.80|9.9.9.9|example.de:22"}[2m])
      > 5

But second, the overridden rule, where the label selector is wrongly placed:

  - alert: BlackboxSlowProbe                                                                                                                                                                                       
    expr: avg_over_time(probe_duration_seconds[2m]){instance!~"84.200.69.80|9.9.9.9|example.de:22"} > 5    
@robgordon89
Copy link
Contributor

I run into this today, if you wish to resolve this you can easily just add {} to the query

  - alert: BlackboxSlowProbe
    expr: 'avg_over_time(probe_duration_seconds{}[2m]) > 5'

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

2 participants