From 4dfbb9fccf6afe337133dd4b05b279599becf41d Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Sat, 28 Nov 2026 15:06:03 -0800 Subject: [PATCH] feat(sensitive): Glance lists the last day's alerts and 25 releases Homelab gains a Last 24 hours panel of every warning and critical that fired, read back from Prometheus's ALERTS series with the existing reader token. Maintenance's releases list shows the newest 25 rather than 10. Co-Authored-By: Claude Opus 5.5 --- stacks/sensitive/README.md | 4 +- stacks/sensitive/glance/pages/homelab.yml | 47 ++++++++++++++++--- stacks/sensitive/glance/pages/maintenance.yml | 4 +- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 667ebb851..0e3fe41b9 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -631,8 +631,8 @@ everything: NBA, NFL, MLB and NHL scores from ESPN; the full ticker list with charts; and the TSP L 2060 fund with a year's sparkline. -- **Homelab** (`homelab.yml`): a headline strip, the Estate panel, uptime - badges, hosts, every console by category, the household monitor and +- **Homelab** (`homelab.yml`): a headline strip, the Estate panel, what + fired in the last 24 hours, uptime badges, hosts, every console by category, the household monitor and Saruman's VMs. - **Network & Storage** (`network.yml`): traffic per VLAN and at the WAN, the last speed test, pools and SMART, and the UPS. diff --git a/stacks/sensitive/glance/pages/homelab.yml b/stacks/sensitive/glance/pages/homelab.yml index e465e99bc..0e32b2564 100644 --- a/stacks/sensitive/glance/pages/homelab.yml +++ b/stacks/sensitive/glance/pages/homelab.yml @@ -1,9 +1,9 @@ -# Homelab: the estate at a glance (ADR-0100) — the headline -# strip, alerts, uptime, hosts, guests and every console. Network & Storage -# and Maintenance have the detail. Status here comes from Prometheus, never -# from a check this container makes, except the Household monitor: trinity -# cannot reach VLANs 30 and 40, so a direct check of a console there would -# always read down. +# Homelab: the estate at a glance (ADR-0100) — the headline strip, alerts +# now and over the last day, uptime, hosts, guests and every console. Network +# & Storage and Maintenance have the detail. Status here comes from +# Prometheus, never from a check this container makes, except the Household +# monitor: trinity cannot reach VLANs 30 and 40, so a direct check of a +# console there would always read down. - name: Homelab width: wide head-widgets: @@ -361,6 +361,41 @@

CHECKED AGO

{{ end }} + # What fired in the last 24 hours, firing still or not: the warnings + # and criticals, which are what Alertmanager sends to ntfy. Read back + # from Prometheus's own ALERTS series with the reader token, so it + # needs no ntfy credential. The value is seconds since each was last + # firing; the one-minute subquery step can miss an alert shorter than + # a minute. + - type: custom-api + title: Last 24 hours + cache: 5m + <<: *prometheus + parameters: + query: >- + time() - max by (alertname, instance, severity) (last_over_time(timestamp( + ALERTS{alertstate="firing", severity=~"warning|critical"})[24h:1m])) + template: | + {{ $rows := sortByFloat "value.1" "asc" (.JSON.Array "data.result") }} + {{ if ne .Response.StatusCode 200 }} +

Prometheus answered {{ .Response.StatusCode }}

+ {{ else if not $rows }} +

Nothing fired.

+ {{ else }} + + {{ end }} + # Uptime-Kuma-style badges from the blackbox probes Prometheus already # runs every 30 seconds: now, and the share of probes that passed over # 24 hours and 7 days. A service probed twice (by name and by address) diff --git a/stacks/sensitive/glance/pages/maintenance.yml b/stacks/sensitive/glance/pages/maintenance.yml index d2f6da44b..860a6d8d9 100644 --- a/stacks/sensitive/glance/pages/maintenance.yml +++ b/stacks/sensitive/glance/pages/maintenance.yml @@ -312,10 +312,12 @@ # New releases of the software this estate pins: the services, not the # lint and build tools. Dependabot opens the PR; this is the heads-up. # Once per six hours per repository, with the no-permission token so - # the 32 requests do not spend the house's anonymous 60 an hour. + # the 32 requests do not spend the house's anonymous 60 an hour. The + # newest 25 of them, six until expanded; Glance's default is 10. - type: releases cache: 6h token: ${GLANCE_GITHUB_TOKEN} + limit: 25 show-source-icon: false collapse-after: 6 repositories: