The CNPG exporter answers the whole /metrics request with HTTP 500 when a
custom query emits two rows with the same series name + label set, which
also drops every pg_stat_*/cnpg_pg_* series (Prometheus target down).
action_runner held three rows named siriussec-amd64 (one live, two
soft-deleted tombstones from the runner renames), so
cnpg_actions_runners_last_online_seconds was collected twice and the
endpoint returned 500.
- WHERE r.deleted IS NULL -> ignore Forgejo's soft-deleted runner rows.
- GROUP BY r.name with max(last_online) -> the label is the name, so a
duplicate name can never produce a duplicate series again; reporting the
most recent poll per name is the intended semantic.
- label cnpg.io/reload -> the instance manager re-reads the queries on
change instead of needing a pod restart (or kubectl cnpg reload) before
a query fix takes effect.