Watch
0
0
Fork
You've already forked hyperhive
0

grafana: the identity-mint alert selects the controller's pod records

On k8s/v1 the swarm-controller runs as a pod. Its logs reach the store
through the pod-log receiver with `service.name` "controller" and no
`_SYSTEMD_UNIT`, so `hh-agent-identity-mint-failed`, which selected the unit
and grouped by the host journal's `F_AGENT`, could never match: a failed
agent identity mint fired nothing.

Select `service.name`, and read the agent out of the stdout line with
`extract "agent=<agent> step="`: the controller logs `agent=<name>
step=<step> error=<text>` as tracing's text format after the message, and
the pod-log receiver keeps the whole line as `_msg`. The summary names the
`agent` label and the `error=` text. The review classifier doc's example
query changes the same way.

A controller test renders the failure through the stdout format and pins
that order. A module-eval case pins the rule's selector, the extract and
the grouping, and that no rule selects the controller's unit any more.
This commit is contained in:
maia 2026-11-30 12:56:17 +01:00 • committed by maia
commit ac2999252b

View file

@ -697,15 +697,17 @@ and 500 when it can't read the list, both as problem+json.
Each recorded run is also one `info` event from `swarm-controller` with the
message `review classifier run finished`. The event carries the same fields,
with `rows` as JSON. It reaches VictoriaLogs through the host journal, where
each field arrives as `F_` and the name in capitals (`F_OUTCOME`, `F_REPO`), so
a run whose write failed is still there:
with `rows` as JSON. The controller runs as a pod, so the event is a line of
its stdout, and it reaches VictoriaLogs through the pod-log receiver with
`service.name` `controller`. The fields are `name=value` text after the message
in `_msg`, not fields of the record (`outcome=post-failed`, `repo=...`), so a
run whose write failed is still there:
```console
$ swarm-logs query '_time:7d _SYSTEMD_UNIT:="swarm-controller.service" _msg:="review classifier run finished" | fields _time, F_TRIGGER, F_REPO, F_PR, F_OUTCOME, F_DETAIL, F_REVIEW_URL' --format json
$ swarm-logs query '_time:7d "service.name":="controller" _msg:"review classifier run finished" | fields _time, _msg' --format json
```
Add a filter such as `F_OUTCOME:="post-failed"` before the `|` to narrow it.
Add a phrase filter such as `_msg:"outcome=post-failed"` before the `|` to narrow it.
## Observability and cost