the classifier alert also fires on an undecodable request and an unpublished reply
This commit is contained in:
parent
1c3551b030
commit
8847fa48c9
1 changed files with 26 additions and 17 deletions
|
|
@ -860,9 +860,9 @@ let
|
|||
&& lib.hasInfix "stats by (hive, agent)" expr;
|
||||
}
|
||||
{
|
||||
# A failed classifier run is visible only as this log line, so a
|
||||
# misspelled `_msg` provisions cleanly and never fires. The literal is
|
||||
# checked against the logging call's source.
|
||||
# A classifier run without a verdict is visible only as these log
|
||||
# lines, so a misspelled `_msg` provisions cleanly and never fires.
|
||||
# Each literal is checked against the logging calls' source.
|
||||
name = "the review-classifier failed-run alert rule matches the classifier's log message";
|
||||
ok =
|
||||
let
|
||||
|
|
@ -872,10 +872,15 @@ let
|
|||
rule = lib.findFirst (r: r.uid == "hh-review-classifier-run-failed") null rules;
|
||||
expr = (lib.head rule.data).model.expr;
|
||||
source = builtins.readFile ../../swarm-review-classifier/src/main.rs;
|
||||
messages = [
|
||||
"review classification run failed"
|
||||
"an undecodable try-out; answering with the error"
|
||||
"encoding a try-out's reply failed"
|
||||
"publishing a try-out's reply failed"
|
||||
];
|
||||
in
|
||||
rule != null
|
||||
&& lib.hasInfix ''_msg:"review classification run failed"'' expr
|
||||
&& lib.hasInfix ''"review classification run failed"'' source;
|
||||
&& lib.all (m: lib.hasInfix "_msg:\"${m}\"" expr && lib.hasInfix "\"${m}\"" source) messages;
|
||||
}
|
||||
{
|
||||
# The hive-health alerts query metric names that hive-c0re spells in
|
||||
|
|
|
|||
Loading…
Reference in a new issue