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

Fire SsaCLIControllerNotOK only if status is not OK and not NOT CONFIGURED #373

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/prometheus_alert_rules/ssacli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ groups:
LABELS = {{ $labels }}

- alert: SsaCLIControllerNotOK
expr: ssacli_controller_info{status != "OK"} == 1
expr: ssacli_controller_info{status != "OK", status!="NOT CONFIGURED"} == 1
Copy link
Member

@gabrielcocenza gabrielcocenza Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid Promql expression.

I will revert this PR.

Please, also add unit tests using the promtool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a valid expression, I tested it

Copy link
Member

@gabrielcocenza gabrielcocenza Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you test this?

image

It won't break the query, but it always will return empty.
As far as I know you can't use two times status and expect this kind of behavior

You need to use regular expression and just use status once

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #376

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with the same unit test you provided, I just didn't add it to the PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredibly it pass the unit tests if I set the NOT CONFIGURED. However this is very likely a promtool bug that we should file.

As showed above this kind of query will always return empty in Prometheus so it's useless in a real scenario

for: 0m
labels:
severity: critical
Expand Down
Loading