Prometheus, Immich and Paperless-ngx integrations
Three read-only integrations, each with a monitoring page, alerts, maintenance silencing and held-when-unreadable handling. Prometheus: scrape targets that stop answering (5 minutes, one alert per job) and alerts that Prometheus's own rules fire (critical when labelled so). Immich: disk under the library filling, failed background jobs, counts. Paperless-ngx: worker/database/Redis in error, documents that failed to import, index and sanity check, disk. Immich and Paperless also in /metrics. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aebe98bf15
commit
251a4a9d73
47 files changed
+24148
-7
No files matched your search
+48
-2
@@ -23,8 +23,8 @@ what the app actually creates.
|
||||
|---|---|
|
||||
| **File** | `DATABASE_PATH`, default `../data/homelab-manager.sqlite` (relative to `server/`; `/app/data/...` in Docker). The folder is created if missing. |
|
||||
| **Foreign keys** | Switched on for every connection (`PRAGMA foreign_keys = ON`), so the `ON DELETE` rules below are enforced. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0058`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 71 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0061`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 74 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
|
||||
**Not in the database, but beside it in the data folder:** the backups of the database itself (`backups/homelab-manager-….sqlite`, taken daily and on request; see [BACKUP.md](BACKUP.md)), and, only while a restore is waiting or has just happened, `restore-pending.sqlite` / `restore-pending.json` and `restore-result.json`.
|
||||
|
||||
@@ -70,6 +70,9 @@ erDiagram
|
||||
integrations ||--o{ ups_readings : "cascade"
|
||||
integrations ||--o| jellyfin_state : "cascade"
|
||||
integrations ||--o| authentik_state : "cascade"
|
||||
integrations ||--o| prometheus_state : "cascade"
|
||||
integrations ||--o| immich_state : "cascade"
|
||||
integrations ||--o| paperless_state : "cascade"
|
||||
integrations ||--o{ jellyfin_readings : "cascade"
|
||||
users ||--o{ todos : "assignee (set null)"
|
||||
servers ||--o{ network_server_links : "cascade"
|
||||
@@ -848,6 +851,49 @@ A UPS at a moment, for the charts: one every five minutes, and every minute whil
|
||||
| `runtime_seconds` | integer | |
|
||||
| `on_battery` | bool NOT NULL, default 0 | |
|
||||
|
||||
#### `immich_state`
|
||||
|
||||
How an Immich (an integration of type `immich`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history table.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `integration_id` | integer PK | |
|
||||
| `version`, `latest_version` | text | |
|
||||
| `update_available` | bool NOT NULL, default 0 | |
|
||||
| `disk_size`, `disk_used` | integer | Bytes, of the disk under the library. |
|
||||
| `disk_percent` | real | |
|
||||
| `photos`, `videos`, `usage_bytes` | integer | Null when the statistics could not be asked (they need an administrator's key). |
|
||||
| `queues` | text | JSON: name, active, waiting, failed, paused. **Null** when the queues could not be asked (not the same as `[]`). |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
#### `paperless_state`
|
||||
|
||||
How a Paperless-ngx (an integration of type `paperless`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history table.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `integration_id` | integer PK | |
|
||||
| `version`, `latest_version` | text | |
|
||||
| `update_available` | bool NOT NULL, default 0 | |
|
||||
| `storage_total`, `storage_available` | integer | Bytes, of the disk the documents are on. |
|
||||
| `components` | text | JSON: name, status (`OK`, `WARNING`, `ERROR`), error — database, redis, celery, index, classifier, sanity_check. **Null** when the status could not be asked (it needs a superuser). |
|
||||
| `documents`, `inbox` | integer | |
|
||||
| `failed` | text | JSON: file, error, at — imports that failed in the last week and were not dismissed. Null when the tasks could not be asked. |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
#### `prometheus_state`
|
||||
|
||||
How a Prometheus (an integration of type `prometheus`) is right now, one row each, replaced at every read (every two minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history table.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `integration_id` | integer PK | |
|
||||
| `version` | text | |
|
||||
| `jobs` | text | JSON: job, up, down. **Null** when the targets could not be asked (not the same as `[]`). |
|
||||
| `down` | text | JSON: job, instance, error, since — `since` is when it was first seen down, carried over from read to read. Null with `jobs`. |
|
||||
| `alerts` | text | JSON: name, severity, state, summary, instance, activeAt. Null when they could not be asked. |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
#### `authentik_state`
|
||||
|
||||
How an Authentik (an integration of type `authentik`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history table.
|
||||
|
||||
Reference in new issue
Block a user