forked from cloudflare/pint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cloudflare#141 from cloudflare/multi-match
Allow multiple match/ignore blocks per rule
- Loading branch information
Showing
8 changed files
with
518 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
pint.ok --no-color -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" path=.pint.hcl | ||
level=info msg="File parsed" path=rules/0001.yml rules=2 | ||
level=debug msg="Found recording rule" lines=1-2 path=rules/0001.yml record=colo:recording | ||
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","promql/comparison","alerts/template","promql/fragile","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:recording | ||
level=debug msg="Found alerting rule" alert=colo:alerting lines=4-5 path=rules/0001.yml | ||
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","promql/comparison","alerts/template","promql/fragile","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:alerting | ||
rules/0001.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate) | ||
expr: sum(foo) without(job) | ||
|
||
rules/0001.yml:5: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/aggregate) | ||
expr: sum(bar) without(job) > 0 | ||
|
||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) > 0 | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
match { | ||
kind = "recording" | ||
} | ||
match { | ||
kind = "alerting" | ||
} | ||
aggregate ".+" { | ||
keep = [ "job" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
pint.ok --no-color -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" path=.pint.hcl | ||
level=info msg="File parsed" path=rules/0001.yml rules=2 | ||
level=debug msg="Found recording rule" lines=1-2 path=rules/0001.yml record=colo:recording | ||
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","promql/comparison","alerts/template","promql/fragile"] path=rules/0001.yml rule=colo:recording | ||
level=debug msg="Found alerting rule" alert=colo:alerting lines=4-5 path=rules/0001.yml | ||
level=debug msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","promql/comparison","alerts/template","promql/fragile"] path=rules/0001.yml rule=colo:alerting | ||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) > 0 | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
ignore { | ||
kind = "recording" | ||
} | ||
ignore { | ||
kind = "alerting" | ||
} | ||
aggregate ".+" { | ||
keep = [ "job" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.