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#81 from cloudflare/exclude
Add ignore block to match expessions
- Loading branch information
Showing
10 changed files
with
373 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
pint.ok -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" [36mpath=[0m.pint.hcl | ||
level=info msg="File parsed" [36mpath=[0mrules/0001.yml [36mrules=[0m2 | ||
level=debug msg="Found recording rule" [36mlines=[0m1-2 [36mpath=[0mrules/0001.yml [36mrecord=[0mcolo:recording | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:recording | ||
level=debug msg="Found alerting rule" [36malert=[0mcolo:alerting [36mlines=[0m4-5 [36mpath=[0mrules/0001.yml | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax","promql/without(job:true)","promql/by(job:true)"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:alerting | ||
rules/0001.yml:5: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/without) | ||
expr: sum(bar) without(job) | ||
|
||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
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 -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" [36mpath=[0m.pint.hcl | ||
level=info msg="File parsed" [36mpath=[0mrules/0001.yml [36mrules=[0m2 | ||
level=debug msg="Found recording rule" [36mlines=[0m1-2 [36mpath=[0mrules/0001.yml [36mrecord=[0mcolo:recording | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax","promql/without(job:true)","promql/by(job:true)"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:recording | ||
level=debug msg="Found alerting rule" [36malert=[0mcolo:alerting [36mlines=[0m4-5 [36mpath=[0mrules/0001.yml | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:alerting | ||
rules/0001.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/without) | ||
expr: sum(foo) without(job) | ||
|
||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
match { | ||
kind = "recording" | ||
} | ||
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 -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" [36mpath=[0m.pint.hcl | ||
level=info msg="File parsed" [36mpath=[0mrules/0001.yml [36mrules=[0m2 | ||
level=debug msg="Found recording rule" [36mlines=[0m1-2 [36mpath=[0mrules/0001.yml [36mrecord=[0mcolo:recording | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax","promql/without(job:true)","promql/by(job:true)"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:recording | ||
level=debug msg="Found alerting rule" [36malert=[0mcolo:alerting [36mlines=[0m4-5 [36mpath=[0mrules/0001.yml | ||
level=debug msg="Configured checks for rule" [36menabled=[0m["promql/syntax"] [36mpath=[0mrules/0001.yml [36mrule=[0mcolo:alerting | ||
rules/0001.yml:2: job label is required and should be preserved when aggregating "^.+$" rules, remove job from without() (promql/without) | ||
expr: sum(foo) without(job) | ||
|
||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pint.error -l debug lint rules | ||
! stdout . | ||
cmp stderr stderr.txt | ||
|
||
-- stderr.txt -- | ||
level=info msg="Loading configuration file" [36mpath=[0m.pint.hcl | ||
level=fatal msg="Fatal error" [31merror=[0m[31m"failed to load config file \".pint.hcl\": ignore block must have at least one condition"[0m | ||
-- rules/0001.yml -- | ||
- record: "colo:recording" | ||
expr: sum(foo) without(job) | ||
|
||
- alert: "colo:alerting" | ||
expr: sum(bar) without(job) | ||
|
||
-- .pint.hcl -- | ||
rule { | ||
ignore {} | ||
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
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
Oops, something went wrong.