Add Prometheus metrics: /metrics, node_exporter and a page for it

The web UI serves the router's own state at /metrics (token needed);
router.metrics.nodeExporter runs node_exporter for the machine's and opens
its port only to the zones named. The Prometheus page edits those settings
and shows the scrape configuration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 11:30:02 +01:00
co-authored by Claude Sonnet 5.5
parent 32bf0d5fde
commit 6e23d183fc
13 changed files with 672 additions and 1 deletions
+20
View File
@@ -859,6 +859,26 @@ let
};
expect = [ "natOnly does not apply to the router itself" ];
};
exporterOnWan = {
router = {
lans.main = lan { };
metrics.nodeExporter = {
enable = true;
zones = [ "wan" ];
};
};
expect = [ "node_exporter must not be open to it" ];
};
exporterUnknownZone = {
router = {
lans.main = lan { };
metrics.nodeExporter = {
enable = true;
zones = [ "nowhere" ];
};
};
expect = [ "unknown source zone `nowhere`" ];
};
localNoPorts = {
router = {
lans.main = lan { };