Keep a history of integration figures and draw it on each integration's page
The numbers integrations report (queries and blocked share, queue and missing items, speeds, photos, documents, failed runs, firing rules, targets down, monthly cost and more) are kept about every quarter of an hour for five weeks, then as hours and days for up to two years, taken from each integration's stored reading. Every card on the 14 integration pages gets a Show the history button with a chart per figure, how it changed and its lowest and highest. A stretch when the integration could not be read is a gap. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e4f3a54189
commit
e7f23ba13f
30 files changed
+10532
-1
No files matched your search
@@ -22,6 +22,16 @@ Every integration has a **Read now** button on the Integrations page (operators
|
||||
- **Not too often:** the same integration is not read again within **20 seconds** (HTTP 429, `Retry-After`) — some systems limit how often they may be asked. One that is switched off cannot be read (HTTP 400); one that is not there is a 404.
|
||||
- Which kinds have a stored reading is one list in `server/src/services/integrationSyncs.ts`, which also decides what happens when an integration is added, changed (a new address or credentials, or switched on) or deleted: it is read at once, and what was read is forgotten on delete. A new kind with a schedule is added there.
|
||||
|
||||
### History of the figures
|
||||
|
||||
The numbers an integration reports — queries a day and how many were blocked (AdGuard Home, Technitium), items in the queue and wanted-but-missing (Sonarr, Radarr, Prowlarr), download and upload speed (qBittorrent, SABnzbd), photos, videos, library size and disk (Immich), documents and the inbox (Paperless-ngx), users, files and free space (Nextcloud), devices and addresses (NetBox), failed runs (n8n), rules firing (Grafana), targets down and alerts (Prometheus), failed sign-ins (Authentik), the library (Jellyfin) and the estimated monthly cost and server count (Hetzner Cloud) — are kept over time, so a page can show how a figure has moved instead of only what it is now. Each of those pages has a **Show the history** button on every integration's card: a small chart for each figure with where it stands, how it changed over the stretch (*up 2,398*, *down 1.5 points*), its lowest and highest, over 24 hours, 7, 30 or 90 days or a year.
|
||||
|
||||
- **How:** every five minutes the stored reading of each enabled integration (the one its sync already keeps) is looked at, and about every quarter of an hour a reading of each figure is kept — for five weeks; beyond that its hours (four months) and days (about two years) as an average with a lowest and highest, the way the servers' trends are kept. Nothing is asked of the integration for this.
|
||||
- **A gap is a gap:** a reading that is more than 45 minutes old (the integration could not be read) is not recorded, so a stretch when it was unreachable is empty on the chart, not a flat line. A figure the integration could not give — a number that is null, not zero — is left out.
|
||||
- **Not covered:** the integrations that already keep a history of their own (UPS, Home Assistant, speedtest, who is streaming from Jellyfin, the storage of Proxmox and Synology) and those that are only read live when a page is opened (Proxmox, Synology, Tailscale, Gitea, Semaphore, Uptime Kuma, Proxmox Backup Server, osTicket, phpIPAM, Nginx Proxy Manager): there is nothing stored to take figures from. Asked for history of one of those, the endpoint says `kept: false`.
|
||||
- **Starting:** history begins when this was added; nothing is made up for the time before. A figure appears after its first reading.
|
||||
- **API:** `GET /api/integrations/:id/figures?days=7` (any signed-in user; 1 to 365 days) answers `{ kept, days, figures: [{ key, label, unit, latest, readAt, points, first, low, high }] }`. The extractors, one for each kind, are in `server/src/services/integrationFigures.ts`.
|
||||
|
||||
### Checking what an integration can read
|
||||
|
||||
On the Integrations page an administrator has an **Inspect** button on each integration that reads through the shared HTTP helper (Authentik, Immich, Jellyfin, NetBox, Nextcloud, Paperless-ngx, Prometheus, Hetzner Cloud, Hetzner Robot, Speedtest Tracker, Fragnet, Sonarr, Radarr, Prowlarr, Lidarr, Readarr, qBittorrent, SABnzbd, AdGuard Home, Technitium DNS and Grafana). It runs the integration's reader once and shows:
|
||||
|
||||
Reference in new issue
Block a user