Watch
0
0
Fork
You've already forked hyperhive
0

review classifier: export request, verdict, check and run metrics, with a dashboard

The controller counts review requests, verdicts and per-check results and times each run; the classifier service counts retried asks. A provisioned Grafana dashboard charts them.
This commit is contained in:
atlas 2026-10-24 18:50:03 +02:00 • committed by mara
commit eaf26aaadd
13 changed files with 1390 additions and 28 deletions

View file

@ -382,6 +382,44 @@ let
&& lib.all (m: lib.hasInfix "\"${m}\"" pushed) queried
&& lib.any (v: v.name == "repo") board.templating.list;
}
{
# The review classifier board ships, and every metric it queries is a name
# the controller or the classifier service records: a renamed metric on
# either side is a board of empty panels. A histogram is queried by its
# `_bucket` series.
name = "the review classifier dashboard ships, and queries the metric names the controller and the classifier record";
ok =
let
provider = lib.head grafanaWithAuthelia.containers.swarm-grafana.config.services.grafana.provision.dashboards.settings.providers;
shipped = lib.attrNames provider.options.path.entries;
board = builtins.fromJSON (
builtins.readFile ../host-modules/swarm-grafana/dashboards/review-classifier.json
);
exprs = lib.concatMap (p: map (t: t.expr or "") (p.targets or [ ])) board.panels;
queried = lib.unique (
lib.concatMap (
e:
map (m: lib.removeSuffix "_bucket" (lib.head m)) (
lib.filter lib.isList (builtins.split ''"(hyperhive\.review_classifier\.[a-z_.]+)"'' e)
)
) exprs
);
recorded =
builtins.readFile ../../swarm-controller/src/review_classifier/metrics.rs
+ builtins.readFile ../../swarm-review-classifier/src/cost.rs;
in
lib.elem "review-classifier.json" shipped
&& lib.elem "bao.json" shipped
&&
lib.sort lib.lessThan queried == [
"hyperhive.review_classifier.ask.retries"
"hyperhive.review_classifier.checks"
"hyperhive.review_classifier.requests"
"hyperhive.review_classifier.run.duration"
"hyperhive.review_classifier.verdicts"
]
&& lib.all (m: lib.hasInfix "\"${m}\"" recorded) queried;
}
{
# The standing check on the collector's PRIORITY mapping — whether a line
# ever reaches the log store carrying no severity. It is shipped config