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

Cause promql/regexp check to fail #2

Closed
wants to merge 3 commits into from
Closed

Cause promql/regexp check to fail #2

wants to merge 3 commits into from

Conversation

gbprz
Copy link
Owner

@gbprz gbprz commented Mar 26, 2024

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request was validated by pint.

❗ Problems found.

Severity Number of problems
Bug 1
Stats

Stat Value
Version 0.57.2
Number of rules parsed 1
Number of rules checked 1
Number of problems found 1
Number of offline checks 6
Number of online checks 0
Checks duration 0

Problems

alerts/test.yaml:5-10 Bug: Unnecessary regexp match on static string `group!~"one-last-test-job"`, use `group!="one-last-test-job"` instead. (promql/regexp)
  5 |         expr: >
  6 |           sum(test_metric{
  7 |             group=~"test*",
  8 |             group!~"another-test-job.*",
  9 |             group!~"one-last-test-job",
 10 |           }) by (env, cluster) > 50

alerts/test.yaml Outdated
@@ -5,7 +5,7 @@ groups:
expr: >
sum(test_metric{
group=~"test*",
group!~"another-test-job.*",
group!~"another-test-job",

Choose a reason for hiding this comment

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

🛑 promql/regexp: Unnecessary regexp match on static string group!~"another-test-job", use group!="another-test-job" instead.

See Prometheus documentation for details on how vector selectors work.

@@ -6,7 +6,7 @@ groups:
sum(test_metric{
group=~"test*",
group!~"another-test-job.*",
group!~"one-last-test-job.*",
group!~"one-last-test-job",

Choose a reason for hiding this comment

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

🛑 promql/regexp: Unnecessary regexp match on static string group!~"one-last-test-job", use group!="one-last-test-job" instead.

See Prometheus documentation for details on how vector selectors work.

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

Successfully merging this pull request may close these issues.

1 participant