From 6d9122eeff57fa579a8b5a5da0b147a937fff06e Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Tue, 17 Nov 2026 10:08:40 +0400 Subject: [PATCH] main: the current setup only Both servers run NixOS. The Ansible code and the move itself leave main for their own branches: `ansible` is the Debian/Ansible setup as it was before the migration, `migration` keeps the plan and record, the data scripts and everything else the move needed. README and RESTORE describe the setup as it is now: NixOS, Podman, sops, OpenTofu, the backup paths and hooks of the new layout. The README carries the TODO list that MIGRATION.md had. The Forgejo sanitising script stays, under hosts/rehearsal, with the rules for rehearsing on restored production data in the NixOS README. Renovate no longer looks at Ansible files. Assisted-by: Claude:opus-5-5 --- MIGRATION.md | 438 - README.md | 199 +- RESTORE.md | 131 +- ansible/.gitignore | 15 - ansible/README.md | 132 - ansible/ansible.cfg | 21 - ansible/inventory/ci.yaml | 29 - .../inventory/group_vars/all/monitoring.yaml | 39 - ansible/inventory/group_vars/all/network.yaml | 24 - ansible/inventory/group_vars/all/paths.yaml | 5 - ansible/inventory/group_vars/all/s3.yaml | 33 - ansible/inventory/group_vars/all/vault.yaml | 175 - .../group_vars/all/vault.yaml.template | 56 - .../inventory/group_vars/all/wireguard.yaml | 53 - .../inventory/group_vars/all/xmpp_cert.yaml | 13 - .../group_vars/ops_servers/forgejo.yaml | 26 - .../group_vars/ops_servers/traefik.yaml | 8 - .../services_servers/forgejo_runner.yaml | 22 - .../forgejo_runner_interop.yaml | 7 - .../group_vars/services_servers/xmpp.yaml | 14 - .../group_vars/services_servers/xray.yaml | 5 - ansible/inventory/host_vars/asxpio-ops.yaml | 45 - .../inventory/host_vars/asxpio-services.yaml | 56 - ansible/inventory/hosts.yaml | 25 - ansible/known_hosts | 2 - ansible/playbooks/01-wireguard-setup.yaml | 191 - ansible/playbooks/02-ssh-hardening.yaml | 15 - ansible/playbooks/03-setup-s3fs.yaml | 82 - ansible/playbooks/04-add-user-zerrtika.yaml | 43 - ansible/playbooks/05-swap.yaml | 12 - .../playbooks/wireguard-configs/.gitignore | 2 - ansible/roles/acme_forward/tasks/main.yaml | 14 - .../templates/docker-compose.yml.j2 | 11 - .../acme_forward/templates/nginx.conf.j2 | 16 - ansible/roles/base/defaults/main.yaml | 4 - ansible/roles/base/files/20auto-upgrades | 2 - ansible/roles/base/files/daemon.json | 7 - ansible/roles/base/handlers/main.yaml | 12 - ansible/roles/base/tasks/main.yaml | 61 - .../roles/crawler_alert/defaults/main.yaml | 8 - .../crawler_alert/files/crawler-alert.py | 878 - .../crawler_alert/files/crawler-alert.service | 8 - .../crawler_alert/files/crawler-alert.timer | 9 - .../files/crawler-metrics.service | 12 - .../crawler_alert/files/crawler-metrics.timer | 9 - .../files/crawler-weekly.service | 8 - .../crawler_alert/files/crawler-weekly.timer | 9 - .../roles/crawler_alert/handlers/main.yaml | 4 - ansible/roles/crawler_alert/tasks/main.yaml | 42 - .../templates/crawler-alert.env.j2 | 10 - .../roles/docker_service/defaults/main.yaml | 28 - ansible/roles/docker_service/tasks/main.yaml | 148 - ansible/roles/forgejo/handlers/main.yaml | 10 - ansible/roles/forgejo/tasks/main.yaml | 26 - .../roles/forgejo/tasks/ssh-passthrough.yaml | 32 - ansible/roles/forgejo/tasks/validate.yaml | 41 - ansible/roles/forgejo/templates/app.ini.j2 | 106 - .../forgejo/templates/docker-compose.yml.j2 | 30 - .../roles/forgejo/templates/forgejo-shell.j2 | 4 - .../forgejo/templates/sshd-forgejo.conf.j2 | 6 - .../roles/forgejo_runner/handlers/main.yaml | 5 - ansible/roles/forgejo_runner/tasks/main.yaml | 74 - .../roles/forgejo_runner/tasks/validate.yaml | 26 - .../forgejo_runner/templates/config.yaml.j2 | 48 - .../templates/docker-compose.yml.j2 | 16 - .../forgejo_runner_interop/tasks/main.yaml | 13 - .../templates/config.yaml.j2 | 40 - .../templates/docker-compose.yml.j2 | 12 - .../roles/minecraft/files/docker-compose.yml | 15 - ansible/roles/minecraft/tasks/main.yaml | 15 - ansible/roles/monitoring/defaults/main.yaml | 27 - .../dashboards/Infrastructure/containers.json | 781 - .../dashboards/Infrastructure/hosts.json | 15517 ---------------- .../files/dashboards/Logs/logs.json | 248 - .../files/dashboards/Security/security.json | 2168 --- .../files/dashboards/Services/crawlers.json | 1148 -- .../files/dashboards/Services/postgres.json | 3131 ---- .../files/dashboards/Services/probes.json | 1071 -- .../files/dashboards/Services/traefik.json | 1527 -- .../monitoring/files/dashboards/overview.json | 2077 --- ansible/roles/monitoring/tasks/main.yaml | 38 - .../monitoring/templates/alert-rules.yaml.j2 | 546 - .../monitoring/templates/alerting.yaml.j2 | 17 - .../monitoring/templates/blackbox.yml.j2 | 35 - .../monitoring/templates/dashboards.yaml.j2 | 9 - .../monitoring/templates/datasources.yaml.j2 | 14 - .../templates/docker-compose.yml.j2 | 89 - .../roles/monitoring/templates/grafana.env.j2 | 17 - .../roles/monitoring/templates/loki.env.j2 | 3 - .../roles/monitoring/templates/loki.yml.j2 | 53 - .../monitoring/templates/prometheus.yml.j2 | 109 - .../roles/monitoring_agent/defaults/main.yaml | 53 - .../files/security-metrics.py | 395 - .../files/security-metrics.service | 9 - .../files/security-metrics.timer | 10 - .../roles/monitoring_agent/handlers/main.yaml | 4 - .../roles/monitoring_agent/tasks/main.yaml | 55 - .../templates/config.alloy.j2 | 86 - .../templates/docker-compose.yml.j2 | 72 - .../templates/security-metrics.json.j2 | 16 - .../roles/restic_backup/defaults/main.yaml | 36 - .../roles/restic_backup/files/restic-alert | 20 - .../restic_backup/files/restic-alert@.service | 6 - .../roles/restic_backup/handlers/main.yaml | 4 - ansible/roles/restic_backup/tasks/main.yaml | 88 - ansible/roles/restic_backup/templates/env.j2 | 8 - .../restic_backup/templates/restic-backup.j2 | 77 - .../templates/restic-backup.service.j2 | 12 - .../templates/restic-backup.timer.j2 | 10 - ansible/roles/s3_replicate/defaults/main.yaml | 16 - ansible/roles/s3_replicate/handlers/main.yaml | 4 - ansible/roles/s3_replicate/tasks/main.yaml | 38 - ansible/roles/s3_replicate/templates/env.j2 | 13 - .../s3_replicate/templates/s3-replicate.j2 | 23 - .../templates/s3-replicate.service.j2 | 11 - .../templates/s3-replicate.timer.j2 | 10 - ansible/roles/s3fs/defaults/main.yaml | 56 - ansible/roles/s3fs/tasks/main.yaml | 120 - ansible/roles/s3fs/templates/passwd-s3fs.j2 | 1 - .../sillytavern/files/docker-compose.yml | 11 - ansible/roles/sillytavern/tasks/main.yaml | 16 - .../roles/ssh_hardening/defaults/main.yaml | 62 - .../roles/ssh_hardening/handlers/main.yaml | 6 - ansible/roles/ssh_hardening/tasks/main.yaml | 104 - .../templates/99-ssh-hardening.conf.j2 | 34 - ansible/roles/swap/defaults/main.yaml | 6 - ansible/roles/swap/tasks/main.yaml | 49 - ansible/roles/traefik/handlers/main.yaml | 5 - ansible/roles/traefik/tasks/main.yaml | 32 - ansible/roles/traefik/tasks/validate.yaml | 23 - .../traefik/templates/docker-compose.yml.j2 | 44 - .../roles/traefik/templates/dynamic.yml.j2 | 38 - ansible/roles/traefik/templates/env.j2 | 8 - .../roles/traefik/templates/traefik.yml.j2 | 61 - ansible/roles/wireguard/defaults/main.yaml | 39 - ansible/roles/wireguard/handlers/main.yaml | 21 - ansible/roles/wireguard/tasks/main.yaml | 222 - ansible/roles/wireguard/tasks/validate.yaml | 19 - .../roles/wireguard/templates/client.conf.j2 | 21 - ansible/roles/wireguard/templates/wg0.conf.j2 | 39 - ansible/roles/xmpp/tasks/main.yaml | 21 - .../xmpp/templates/docker-compose.yml.j2 | 54 - ansible/roles/xmpp/templates/settings.env.j2 | 6 - .../xmpp_cert_sync/files/xmpp-cert-install | 33 - .../xmpp_cert_sync/files/xmpp-cert-sync.path | 8 - .../files/xmpp-cert-sync.service | 7 - .../xmpp_cert_sync/files/xmpp-cert-sync.timer | 9 - .../roles/xmpp_cert_sync/handlers/main.yaml | 4 - ansible/roles/xmpp_cert_sync/tasks/main.yaml | 63 - .../templates/xmpp-cert-sync.j2 | 70 - ansible/roles/xray/tasks/main.yaml | 11 - ansible/roles/xray/templates/config.json.j2 | 1 - .../xray/templates/docker-compose.yml.j2 | 16 - ansible/site.yaml | 74 - nixos/README.md | 27 +- .../rehearsal/sanitize-forgejo.sh} | 0 nixos/migration/ops-data.sh | 124 - nixos/migration/services-data.sh | 60 - renovate.json | 19 +- 159 files changed, 131 insertions(+), 34951 deletions(-) delete mode 100644 MIGRATION.md delete mode 100644 ansible/.gitignore delete mode 100644 ansible/README.md delete mode 100644 ansible/ansible.cfg delete mode 100644 ansible/inventory/ci.yaml delete mode 100644 ansible/inventory/group_vars/all/monitoring.yaml delete mode 100644 ansible/inventory/group_vars/all/network.yaml delete mode 100644 ansible/inventory/group_vars/all/paths.yaml delete mode 100644 ansible/inventory/group_vars/all/s3.yaml delete mode 100644 ansible/inventory/group_vars/all/vault.yaml delete mode 100644 ansible/inventory/group_vars/all/vault.yaml.template delete mode 100644 ansible/inventory/group_vars/all/wireguard.yaml delete mode 100644 ansible/inventory/group_vars/all/xmpp_cert.yaml delete mode 100644 ansible/inventory/group_vars/ops_servers/forgejo.yaml delete mode 100644 ansible/inventory/group_vars/ops_servers/traefik.yaml delete mode 100644 ansible/inventory/group_vars/services_servers/forgejo_runner.yaml delete mode 100644 ansible/inventory/group_vars/services_servers/forgejo_runner_interop.yaml delete mode 100644 ansible/inventory/group_vars/services_servers/xmpp.yaml delete mode 100644 ansible/inventory/group_vars/services_servers/xray.yaml delete mode 100644 ansible/inventory/host_vars/asxpio-ops.yaml delete mode 100644 ansible/inventory/host_vars/asxpio-services.yaml delete mode 100644 ansible/inventory/hosts.yaml delete mode 100644 ansible/known_hosts delete mode 100644 ansible/playbooks/01-wireguard-setup.yaml delete mode 100644 ansible/playbooks/02-ssh-hardening.yaml delete mode 100644 ansible/playbooks/03-setup-s3fs.yaml delete mode 100644 ansible/playbooks/04-add-user-zerrtika.yaml delete mode 100644 ansible/playbooks/05-swap.yaml delete mode 100644 ansible/playbooks/wireguard-configs/.gitignore delete mode 100644 ansible/roles/acme_forward/tasks/main.yaml delete mode 100644 ansible/roles/acme_forward/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/acme_forward/templates/nginx.conf.j2 delete mode 100644 ansible/roles/base/defaults/main.yaml delete mode 100644 ansible/roles/base/files/20auto-upgrades delete mode 100644 ansible/roles/base/files/daemon.json delete mode 100644 ansible/roles/base/handlers/main.yaml delete mode 100644 ansible/roles/base/tasks/main.yaml delete mode 100644 ansible/roles/crawler_alert/defaults/main.yaml delete mode 100644 ansible/roles/crawler_alert/files/crawler-alert.py delete mode 100644 ansible/roles/crawler_alert/files/crawler-alert.service delete mode 100644 ansible/roles/crawler_alert/files/crawler-alert.timer delete mode 100644 ansible/roles/crawler_alert/files/crawler-metrics.service delete mode 100644 ansible/roles/crawler_alert/files/crawler-metrics.timer delete mode 100644 ansible/roles/crawler_alert/files/crawler-weekly.service delete mode 100644 ansible/roles/crawler_alert/files/crawler-weekly.timer delete mode 100644 ansible/roles/crawler_alert/handlers/main.yaml delete mode 100644 ansible/roles/crawler_alert/tasks/main.yaml delete mode 100644 ansible/roles/crawler_alert/templates/crawler-alert.env.j2 delete mode 100644 ansible/roles/docker_service/defaults/main.yaml delete mode 100644 ansible/roles/docker_service/tasks/main.yaml delete mode 100644 ansible/roles/forgejo/handlers/main.yaml delete mode 100644 ansible/roles/forgejo/tasks/main.yaml delete mode 100644 ansible/roles/forgejo/tasks/ssh-passthrough.yaml delete mode 100644 ansible/roles/forgejo/tasks/validate.yaml delete mode 100644 ansible/roles/forgejo/templates/app.ini.j2 delete mode 100644 ansible/roles/forgejo/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/forgejo/templates/forgejo-shell.j2 delete mode 100644 ansible/roles/forgejo/templates/sshd-forgejo.conf.j2 delete mode 100644 ansible/roles/forgejo_runner/handlers/main.yaml delete mode 100644 ansible/roles/forgejo_runner/tasks/main.yaml delete mode 100644 ansible/roles/forgejo_runner/tasks/validate.yaml delete mode 100644 ansible/roles/forgejo_runner/templates/config.yaml.j2 delete mode 100644 ansible/roles/forgejo_runner/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/forgejo_runner_interop/tasks/main.yaml delete mode 100644 ansible/roles/forgejo_runner_interop/templates/config.yaml.j2 delete mode 100644 ansible/roles/forgejo_runner_interop/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/minecraft/files/docker-compose.yml delete mode 100644 ansible/roles/minecraft/tasks/main.yaml delete mode 100644 ansible/roles/monitoring/defaults/main.yaml delete mode 100644 ansible/roles/monitoring/files/dashboards/Infrastructure/containers.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Infrastructure/hosts.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Logs/logs.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Security/security.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Services/crawlers.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Services/postgres.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Services/probes.json delete mode 100644 ansible/roles/monitoring/files/dashboards/Services/traefik.json delete mode 100644 ansible/roles/monitoring/files/dashboards/overview.json delete mode 100644 ansible/roles/monitoring/tasks/main.yaml delete mode 100644 ansible/roles/monitoring/templates/alert-rules.yaml.j2 delete mode 100644 ansible/roles/monitoring/templates/alerting.yaml.j2 delete mode 100644 ansible/roles/monitoring/templates/blackbox.yml.j2 delete mode 100644 ansible/roles/monitoring/templates/dashboards.yaml.j2 delete mode 100644 ansible/roles/monitoring/templates/datasources.yaml.j2 delete mode 100644 ansible/roles/monitoring/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/monitoring/templates/grafana.env.j2 delete mode 100644 ansible/roles/monitoring/templates/loki.env.j2 delete mode 100644 ansible/roles/monitoring/templates/loki.yml.j2 delete mode 100644 ansible/roles/monitoring/templates/prometheus.yml.j2 delete mode 100644 ansible/roles/monitoring_agent/defaults/main.yaml delete mode 100755 ansible/roles/monitoring_agent/files/security-metrics.py delete mode 100644 ansible/roles/monitoring_agent/files/security-metrics.service delete mode 100644 ansible/roles/monitoring_agent/files/security-metrics.timer delete mode 100644 ansible/roles/monitoring_agent/handlers/main.yaml delete mode 100644 ansible/roles/monitoring_agent/tasks/main.yaml delete mode 100644 ansible/roles/monitoring_agent/templates/config.alloy.j2 delete mode 100644 ansible/roles/monitoring_agent/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/monitoring_agent/templates/security-metrics.json.j2 delete mode 100644 ansible/roles/restic_backup/defaults/main.yaml delete mode 100644 ansible/roles/restic_backup/files/restic-alert delete mode 100644 ansible/roles/restic_backup/files/restic-alert@.service delete mode 100644 ansible/roles/restic_backup/handlers/main.yaml delete mode 100644 ansible/roles/restic_backup/tasks/main.yaml delete mode 100644 ansible/roles/restic_backup/templates/env.j2 delete mode 100644 ansible/roles/restic_backup/templates/restic-backup.j2 delete mode 100644 ansible/roles/restic_backup/templates/restic-backup.service.j2 delete mode 100644 ansible/roles/restic_backup/templates/restic-backup.timer.j2 delete mode 100644 ansible/roles/s3_replicate/defaults/main.yaml delete mode 100644 ansible/roles/s3_replicate/handlers/main.yaml delete mode 100644 ansible/roles/s3_replicate/tasks/main.yaml delete mode 100644 ansible/roles/s3_replicate/templates/env.j2 delete mode 100644 ansible/roles/s3_replicate/templates/s3-replicate.j2 delete mode 100644 ansible/roles/s3_replicate/templates/s3-replicate.service.j2 delete mode 100644 ansible/roles/s3_replicate/templates/s3-replicate.timer.j2 delete mode 100644 ansible/roles/s3fs/defaults/main.yaml delete mode 100644 ansible/roles/s3fs/tasks/main.yaml delete mode 100644 ansible/roles/s3fs/templates/passwd-s3fs.j2 delete mode 100644 ansible/roles/sillytavern/files/docker-compose.yml delete mode 100644 ansible/roles/sillytavern/tasks/main.yaml delete mode 100644 ansible/roles/ssh_hardening/defaults/main.yaml delete mode 100644 ansible/roles/ssh_hardening/handlers/main.yaml delete mode 100644 ansible/roles/ssh_hardening/tasks/main.yaml delete mode 100644 ansible/roles/ssh_hardening/templates/99-ssh-hardening.conf.j2 delete mode 100644 ansible/roles/swap/defaults/main.yaml delete mode 100644 ansible/roles/swap/tasks/main.yaml delete mode 100644 ansible/roles/traefik/handlers/main.yaml delete mode 100644 ansible/roles/traefik/tasks/main.yaml delete mode 100644 ansible/roles/traefik/tasks/validate.yaml delete mode 100644 ansible/roles/traefik/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/traefik/templates/dynamic.yml.j2 delete mode 100644 ansible/roles/traefik/templates/env.j2 delete mode 100644 ansible/roles/traefik/templates/traefik.yml.j2 delete mode 100644 ansible/roles/wireguard/defaults/main.yaml delete mode 100644 ansible/roles/wireguard/handlers/main.yaml delete mode 100644 ansible/roles/wireguard/tasks/main.yaml delete mode 100644 ansible/roles/wireguard/tasks/validate.yaml delete mode 100644 ansible/roles/wireguard/templates/client.conf.j2 delete mode 100644 ansible/roles/wireguard/templates/wg0.conf.j2 delete mode 100644 ansible/roles/xmpp/tasks/main.yaml delete mode 100644 ansible/roles/xmpp/templates/docker-compose.yml.j2 delete mode 100644 ansible/roles/xmpp/templates/settings.env.j2 delete mode 100644 ansible/roles/xmpp_cert_sync/files/xmpp-cert-install delete mode 100644 ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.path delete mode 100644 ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.service delete mode 100644 ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.timer delete mode 100644 ansible/roles/xmpp_cert_sync/handlers/main.yaml delete mode 100644 ansible/roles/xmpp_cert_sync/tasks/main.yaml delete mode 100644 ansible/roles/xmpp_cert_sync/templates/xmpp-cert-sync.j2 delete mode 100644 ansible/roles/xray/tasks/main.yaml delete mode 100644 ansible/roles/xray/templates/config.json.j2 delete mode 100644 ansible/roles/xray/templates/docker-compose.yml.j2 delete mode 100644 ansible/site.yaml rename nixos/{migration/rehearsal-sanitize-forgejo.sh => hosts/rehearsal/sanitize-forgejo.sh} (100%) delete mode 100755 nixos/migration/ops-data.sh delete mode 100755 nixos/migration/services-data.sh diff --git a/MIGRATION.md b/MIGRATION.md deleted file mode 100644 index 230bffa..0000000 --- a/MIGRATION.md +++ /dev/null @@ -1,438 +0,0 @@ -# Moving production from Ansible and Terraform to NixOS and OpenTofu - -The plan and the runbook. Delete this file when the last step is done. - -**End state:** both servers run NixOS built from `nixos/`, deployed by -`.forgejo/workflows/nixos.yaml`; services are native NixOS services -where nixpkgs has a module and Podman containers otherwise; no Docker -daemon, no Ansible; infrastructure in `tofu/` is applied with -OpenTofu. The servers themselves stay: they are billed below today's -list price, so each one is converted **in place** and never recreated. - -**Nothing in production changes without the owner's go-ahead for that -step.** Every step below that touches a server says so. - -## TODO - -- [ ] **2026-11-24 or later**, if services has run without surprises: - `rm -rf /old-root` on asxpio-services (about 47 GB of Debian and its - Docker data), then delete its snapshot `pre-nixos-2026-11-17` in the - Hetzner console. -- [ ] Delete the two offline runners (ids 1 and 2) in Forgejo → Site - administration → Runners. -- [x] Phase 2 (asxpio-ops), 2026-11-17. -- [ ] Merge asxpio's `podman-healthcheck` branch: until then its CI - deploy times out waiting for "healthy" (the app itself runs). -- [ ] **2026-11-24 or later:** `rm -rf /old-root` on asxpio-ops (the old - image layers are already gone; what is left are the Postgres 17/18 - rollback volumes and Debian itself), then delete its snapshot - `asxpio-ops-pre-nixos-2026-11-17`. -- [ ] Delete `claude-test-nixos-a` and the rehearsal network and firewall - (they hold restored production data). -- [ ] Phase 3. - -## Where things stand (2026-11-17) - -**Both servers run NixOS** since 2026-11-17 (Phases 1 and 2 below, done) -and are deployed by `.forgejo/workflows/nixos.yaml` from `main`, ops -first. Ansible's deploy is gone; its code stays until Phase 3. Snapshots -`pre-nixos-2026-11-17` (services) and `asxpio-ops-pre-nixos-2026-11-17` -are kept until each host's `/old-root` is deleted. - -Phase 2 took 18.5 minutes of downtime (04:52–05:10 UTC) plus a minute -for the reboot. WireGuard was down from 04:52 to 05:04 and came back with -the first `test` activation; the dead-man reboot was not needed. Found on -the day: nixos-infect's bootstrap system only accepts the keys Debian's -root had (the RSA key from `tofu/keys.tofu`); on the new system root -takes the `me@asxp.io` key. The disk reached 90% with the old Docker -store under `/old-root`; deleting its image layers brought it to 71%. - -Phase 1 took 34 minutes of downtime (02:29–03:03 UTC, plus a few seconds -for XMPP at 03:31), most of it the first build. What it taught, and is -now in the config or the runbook: - -- **Xray on services carries the admin's uplink** (all traffic, WireGuard - included, because of DPI). It was moved to a temporary server - (`claude-test-xray`, same config from sops) and the admin's client - switched before anything stopped. Phase 2 does not stop it. -- **Build on the server, not from the workstation.** `nixos-rebuild - --build-host` sent every derivation through the admin's slow uplink; - copying the repo (`git archive HEAD | ssh … tar -x`) and running - `nixos-rebuild switch` on the host took four minutes. -- **Podman DNS** was open on podman0 only: CI jobs (own networks) could - not resolve names. Fixed in `modules/podman.nix`. -- **IPv6 for published ports:** Podman's default network forwards IPv4 - only, Docker on Debian did both; XMPP was unreachable over IPv6 for - half an hour. XMPP has its own IPv6 network now; anything else that - publishes ports and has an AAAA record needs the same. -- The rehearsal ran nothing that downloads inside a CI job, and never - tested IPv6 from outside. Both are now part of the checks below. - -Everything else ran first on the rehearsal pair (two cx23 in the -personal project), most of it on a restored copy of production data: - -| Area | Rehearsed | Notes | -|---|---|---| -| First boot (cloud-init + nixos-infect) | yes | 3–4 min to a bare NixOS | -| In-place conversion with Docker data | yes | data kept under `/old-root` | -| Base, SSH, firewall, WireGuard, sops | yes | same host keys, same peers | -| Postgres 18.7, Garage 2.5, Forgejo 17 | yes, prod data | roles, buckets, keys from sops | -| Traefik, label routing via Podman | yes | certificates: staging CA only | -| asxpio, datacenterbingo on Podman | yes, prod data | mail and IndexNow disabled | -| Minecraft, SillyTavern, Xray, ACME forward | yes, prod data | Discord plugin kept off | -| XMPP (ejabberd, apushd, tackygram) | dummy data only | never started on prod data on purpose | -| CI runner + jobs | yes | against the rehearsal Forgejo | -| Backup, restore, bucket replica | yes | replica: config only, no run | -| Monitoring, logs, alerts, security baseline | yes | 28 targets up, 0 unknown items | -| CI deploy job | evaluate only | deploys nothing until a host is NixOS | - -What each service became, and why: - -| Was (Ansible role, container) | Now | -|---|---| -| `base`, `ssh_hardening`, `swap` | `modules/base.nix`, `hetzner.nix` | -| `wireguard` | `modules/wireguard.nix`, keys in sops | -| `traefik` | native `services.traefik`; native services' routes in Nix, apps keep labels | -| `forgejo` | native `services.forgejo` as user `git`; no SSH passthrough needed | -| storage repo: Postgres, Garage | native `services.postgresql`, `services.garage` (2.x pinned) | -| `monitoring`, `monitoring_agent` | native Prometheus, Loki, Grafana, Alloy, exporters, cAdvisor (Podman) | -| `restic_backup`, `s3_replicate`, `crawler_alert`, `xmpp_cert_sync` | systemd units from Nix, same scripts and schedules | -| `forgejo_runner`, `forgejo_runner_interop` | native runner module; interop as its own unit | -| `sillytavern`, `minecraft`, `xray`, `acme_forward` | native modules | -| `xmpp` | Podman containers (a custom build, not nixpkgs' ejabberd) | -| App stacks (asxpio, datacenterbingo, blog, czsk, vhpbot) | unchanged compose stacks on Podman, deployed by their own CI | - -## Phase 0: preparation (no downtime) - -Everything here can be done while Ansible still runs production. - -1. **Push `nix`** and let CI evaluate it. It does not deploy: the job - skips any host without `/etc/NIXOS`, and branches never deploy. - -2. **OpenTofu.** Once, from a workstation: - - ```sh - cd tofu - tofu init -reconfigure - tofu plan # expected: only the new user_data output - tofu apply # writes the output; changes no resource - ``` - - The state is the one Terraform wrote; the servers ignore - `user_data`, `image` and `ssh_keys`, so nothing can be replaced. - -3. **App repositories: healthcheck in the compose file.** Podman ignores - the `HEALTHCHECK` of OCI-format images, which is what the app CI - builds, so the deploy's wait for "healthy" would time out on NixOS. - Copy each image's healthcheck into its compose file (asxpio, - datacenterbingo, blog; czsk has none). Under Docker the result is the - same, so this ships now, through the normal deploy. The exact block - for asxpio: - - ```yaml - healthcheck: - test: ["CMD-SHELL","ruby -rnet/http -e 'port = ENV.fetch(\"PUMA_PORT\", \"3000\"); exit(Net::HTTP.get_response(URI(\"http://127.0.0.1:#{port}/healthz\")).code == \"200\" ? 0 : 1)'"] - interval: 30s - timeout: 5s - start_period: 20s - retries: 3 - ``` - - Read the others with `skopeo inspect --raw --config docker://`. - -4. **Storage repo: stop its deploys.** Its CI starts Postgres and Garage - containers in `/opt/storage`; after the ops conversion those would - fight the native services for their ports. Disable the deploy - workflow (or archive the repo) before Phase 2. Its secrets - (`ASXPIO_*`, `BINGO_*`, `PUBLIC_*`) stay: the app repos use the same - values. - -5. **Secrets.** `nixos/secrets/asxpio-*.yaml` were filled on 2026-11-16 - and 17 from the Ansible vault, `/opt/storage/.env` and the Garage RPC - secret. If any of those changed since, update the sops file - (`sops nixos/secrets/asxpio-ops.yaml`). Keys: WireGuard, Xray config, - restic password, S3, alert SMTP, Forgejo (secret key, internal token, - JWT secrets, SMTP, metrics token), Postgres roles, Garage keys and RPC - secret, Traefik ACME email, runner tokens, Grafana admin password, - Hetzner read-only token. The vault and sops must agree until Ansible - is gone. - -6. **Freeze.** On conversion day: no pushes to the app repos, to `iac`, - or Renovate merges, from the start of a phase until its checks pass. - -7. **Rehearse once more against the latest backups** (both hosts), on a - fresh rehearsal pair, following `nixos/README.md` → Rehearsal and the - rules at the end of this file. It costs about €0.02 an hour and is the - only way to know that the night's data still fits the config. - -**Phase 1 is done** (2026-11-17); the steps stay as the record and for a -reinstall. **Go/no-go for Phase 1:** steps 1–7 done, last night's restic backup of -both hosts green, a Hetzner snapshot of the host just taken. - -## Phase 1: asxpio-services (owner's go-ahead required) - -Downtime about 15–20 minutes for Minecraft, SillyTavern, XMPP, Xray and -CI. asxpio-ops and everything on it stays up. Services first: it has -less data and nothing on ops depends on it. - -From a workstation on WireGuard, in the repo: - -1. **Snapshot** (the rollback): - - ```sh - hcloud server create-image --type snapshot --description pre-nixos asxpio-services - ``` - -2. **Stop what writes, then Docker:** - - ```sh - ssh root@10.20.0.20 'docker stop -t 120 minecraft; cd /opt/xmpp && docker compose stop; \ - docker stop forgejo-runner forgejo-runner-interop sillytavern xray acme-forward; \ - systemctl stop docker.socket docker containerd' - ``` - -3. **Convert** (the same lines cloud-init runs; `tofu output -json - user_data | jq -r '."asxpio-services"'` shows them filled in). Write - `/etc/nixos/bootstrap.nix` with the content from there, then: - - ```sh - ssh root@10.20.0.20 'umount -l /tmp; curl -fsSL -o /root/nixos-infect \ - https://raw.githubusercontent.com/elitak/nixos-infect/40f62a680bb0e8f2f607d79abfaaecd99d59401c/nixos-infect \ - && echo "4354bd68773b41da65c0e815202c43c8549713b3ed3ff6381c71fbc0b0a840ab /root/nixos-infect" | sha256sum -c \ - && PROVIDER=hetznercloud NIX_CHANNEL=nixos-26.05 NIXOS_IMPORT=./bootstrap.nix \ - setsid bash /root/nixos-infect > /var/log/nixos-infect.log 2>&1 < /dev/null &' - ``` - - It reboots into a bare NixOS after about four minutes. WireGuard is - down until step 4; reach it through ops over the private network: - `ssh -J root@10.20.0.10 root@10.10.0.20`. - -4. **Switch to the flake** (through ops, as above): - - ```sh - cd nixos - NIX_SSHOPTS="-J root@10.20.0.10" nixos-rebuild switch --flake .#asxpio-services \ - --target-host root@10.10.0.20 --build-host root@10.10.0.20 - ``` - - Services that own data stay stopped: the marker file is missing. - -5. **Move the data and start everything:** - - ```sh - ssh root@10.20.0.20 'bash -s /old-root' < migration/services-data.sh - ssh root@10.20.0.20 reboot - ``` - -6. **Check:** - - `wg show` on ops: the services peer has a fresh handshake. - - `systemctl --failed` empty; Grafana's security panel shows nothing - unknown for asxpio-services. - - Minecraft log reaches `Done`; join once (Java and Bedrock). - - SillyTavern on `http://10.20.0.20:8000`. - - An XMPP client logs in; a message to a contact goes through. - - Forgejo → Site administration → Runners: the new runner idle (it - registered itself again); delete the old, offline entry. Push an - empty commit to an app repo and watch a full CI run. - - `systemctl start restic-backup` succeeds (it continues the same - repositories). - -**Rollback:** until step 3, start Docker and the containers again. -After it: `hcloud server disable-protection asxpio-services rebuild`, -rebuild from the snapshot, `tofu apply`. Debian comes back as it was at -the snapshot. - -After a week without surprises: `rm -rf /old-root`, delete the snapshot. - -## Phase 2: asxpio-ops (owner's go-ahead required) - -Harder than Phase 1 for one reason: **ops is the WireGuard hub.** Every -admin connection (and asxpio-services' only admin path) goes through -`wg0` on ops. While ops is converted, WireGuard is down for everyone -(laptop, aleks, zerrtika, sanya, and services' spoke). - -The admin's internet keeps working throughout: it leaves through Xray on -services, which this phase does not touch. Its exit address is services' -public IPv4, **46.62.228.216**, and that is the address ops sees for -anything the admin sends it outside WireGuard. - -### How ops is reached at each point - -| Point | Path | Why it works | -|---|---|---| -| Debian, before the stop | WireGuard, as now | — | -| nixos-infect's bootstrap system | `ssh root@135.181.27.77` | Hetzner allows 22 from anywhere (Forgejo's git SSH); the bootstrap sshd has no `AllowUsers`; same host key | -| `nixos-rebuild test` (new system, not yet the boot default) | WireGuard again (same keys); **break-glass:** `ssh root@135.181.27.77` from 46.62.228.216 | the flake allows root from that one address during this phase only | -| locked out anyway | wait: a dead-man timer reboots into the bootstrap system after 15 min | `test` does not change the boot default | -| after `switch` | WireGuard; break-glass until removed | — | - -services during the window: unreachable from outside (its SSH is -WireGuard/private only); reach it through ops once ops answers: -`ssh -J root@135.181.27.77 root@10.10.0.20`. It keeps running; only its -log shipping to Loki and the runner's link to Forgejo pause. - -### Before the window (no downtime) - -1. **App healthchecks in the compose files** (Phase 0 step 3): asxpio, - datacenterbingo, blog. Deployed on Debian through their normal CI, so - the first deploy on NixOS can reach "healthy". -2. **Storage repo:** disable its deploy workflow (Phase 0 step 4). -3. **Secrets:** compare every ops secret in sops with the vault, - `/opt/storage/.env` and the live values, as was done for services. -4. **Final rehearsal on `claude-test-nixos-a`** — **done 2026-11-17** with - that night's ops backup (7.8 GiB): fresh Debian → cloud-init conversion - (4 min) → build and switch on the host (7 min on this cx23, the same - size as ops) → restore → `ops-data.sh` (10 s) → apps pulled and started - (31 s) and healthy with the compose healthchecks → reboot, everything - back by itself (1.5 min). It found four bugs, all fixed: the apps did - not come back after a reboot (podman-restart was not enabled), no - `/opt` on a fresh system, the repositories moved one level too deep, - and a Forgejo command that no longer exists. -5. **Break-glass in the flake:** root SSH from 46.62.228.216 for ops only - (`asxpio.sshFrom` override in `hosts/asxpio-ops`), merged before the - window, removed after it. -6. **Announce** to the WireGuard users: their tunnel drops for about 30 - minutes; to everyone: sites, Forgejo and the registry are down for - about 30 minutes. Freeze pushes (Phase 0 step 6). -7. **Snapshot** of ops in the Hetzner console (the prod token is - read-only), `pre-nixos-`. - -### The window (about 20–25 minutes of downtime, by the rehearsal) - -From a workstation on WireGuard, in the repo. Every step is a separate -go-ahead. - -1. **Ansible off:** merge a commit to `main` that removes - `.forgejo/workflows/deploy.yaml`; check no run is left. Ansible would - otherwise apply the Debian roles to the converted ops on the next push. -2. **Fresh backup, dumps, stop** (WireGuard still up): - - ```sh - ssh root@10.20.0.10 'restic-backup run; set -e; d=/var/backups/restic-stage; install -d -m 700 $d; \ - docker stop asxpio asxpio-monitor datacenterbingo blog czsk vhpbot vhpbot-dev || true; \ - docker exec storage-postgres pg_dumpall -U postgres > $d/pg_dumpall.sql; \ - sqlite3 /opt/forgejo/data/gitea/gitea.db ".backup $d/forgejo-gitea.db"; \ - docker exec storage-garage /garage meta snapshot --all; \ - docker image prune -af; docker ps -q | xargs -r docker stop -t 60; \ - systemctl stop docker.socket docker containerd' - ``` - - **Downtime starts.** Undo: `systemctl start docker`. - -3. **Convert:** write `/etc/nixos/bootstrap.nix` (from `tofu output -json - user_data | jq -r '."asxpio-ops"'`), then run nixos-infect as in Phase - 1 step 3. Its existing 2 GB swapfile carries the build. **WireGuard goes - down here.** Wait for `ssh root@135.181.27.77 'test -d /old-root'`. -4. **Build and test, not switch**, on the host (Phase 1 lesson): - - ```sh - git archive HEAD | ssh root@135.181.27.77 'rm -rf /root/iac; mkdir /root/iac; tar -x -C /root/iac' - ssh root@135.181.27.77 'systemd-run --unit=deadman --on-active=15min systemctl reboot; \ - cd /root/iac/nixos && NIX_CONFIG="experimental-features = nix-command flakes" \ - nixos-rebuild test --flake .#asxpio-ops' - ``` - - Then from the laptop: WireGuard handshake, `ssh root@10.20.0.10`, - `ssh root@10.20.0.20`. Only then: `systemctl stop deadman.timer`. If - anything fails, do nothing: in 15 minutes ops reboots into the - bootstrap system, reachable on 135.181.27.77, and the cause can be - fixed there. -5. **Make it the boot default:** `nixos-rebuild switch --flake .#asxpio-ops` - (same build, instant). -6. **Data, start, images:** `ssh root@10.20.0.10 'bash -s /old-root' < - nixos/migration/ops-data.sh`, then reboot once. -7. **Check** (all from outside where possible): - - WireGuard: all five peers handshake again (`wg show` on ops). - - Every site over IPv4 **and IPv6** (Grafana → Probes, plus `curl -6` - from services); certificates are the old ones from `acme.json`. - - Forgejo: web, `git clone` and push over SSH and HTTPS, the registry - serves a pull; CI on services reaches Forgejo again. - - asxpio: admin login, render an invoice. datacenterbingo: photos, - `/data.json`. `garage status`; an anonymous read of the public bucket. - - An app deploy from CI reaches "healthy". - - Grafana: targets up, logs from both hosts, security panel clean; - the first alert evaluation after the move sends nothing unexpected. - - `systemctl start restic-backup xmpp-cert-sync` succeed (the push now - uses the new key). - - `systemctl --failed` empty; the login summary is clean. - -### After - -- Remove the break-glass from the flake, and the Debian ops key from - `xmppCertSyncKeysExtra` (`hosts/asxpio-services/xmpp-cert-install.nix`). -- Delete `/old-root/var/lib/docker` once the apps run (frees the old - images on the small disk); the rest of `/old-root` after a week (TODO). -- Phase 3. - -**Rollback:** before step 3, `systemctl start docker`. After it, rebuild -from the snapshot in the Hetzner console. services keeps working against -a Debian ops: nothing on it depends on how ops is built. - -## Phase 3: clean-up - -1. Merge `nix` into `main`: `deploy.yaml` (Ansible) then finds no change - to apply, `nixos.yaml` deploys both hosts from now on. -2. Delete `ansible/`, `.forgejo/workflows/deploy.yaml`, the - `ANSIBLE_VAULT_PASSWORD` secret, `ansible/known_hosts` (the root copy - `known_hosts` stays), the Ansible parts of `renovate.json`. -3. Retire the storage repo (archive). Optional, later: drop the - `storage` network from the app compose files and point their - `DATABASE_URL`/`S3_ENDPOINT` at the host, then remove `apps.nix`'s - compatibility entries. -4. On both hosts after a week: `rm -rf /old-root`; delete the snapshots; - on ops remove the old Postgres 17 volume data, which went with - `/old-root`. -5. Delete the rehearsal servers, network and firewall (`managed-by=claude` - in the personal project), and `claude-test-xray` once the admin's - client points at the production Xray again. -6. Rotate what sat in the old history and the vault for a year - (`INTERNAL_TOKEN`, the JWT secrets, runner tokens), now in sops; and - give Grafana its own `secret_key` (production keeps the default for - now because its database was written with it; Grafana documents the - rotation). -7. Update the workspace `CLAUDE.md` (servers, deploys, gotchas). -8. Branches, last, because until then `main` is what deploys: - - ```sh - git push origin main:retired/ansible # keep the Ansible line - # Forgejo → Settings → Branches: default branch nix; unprotect main - git push origin --delete main - git push origin nix:main - # Forgejo: default branch main again; then - git push origin --delete nix - git branch -m main retired/ansible && git branch -m nix main - ``` - -## Rules for the rehearsal pair - -Restored data carries production credentials inside it. Anything that -would use them outward is kept from starting in `hosts/rehearsal/`, and -the following must hold every time: - -- **Before a runner meets restored Forgejo data,** run - `migration/rehearsal-sanitize-forgejo.sh` on the rehearsal ops. A - restored database still has production's queued jobs, schedules and - Actions secrets; on 2026-11-16 the test runner picked up a queued - production job and was stopped only by the different secret key. -- XMPP and the Telegram gateway, Forgejo's mail, mirrors and webhooks, - Grafana mail, the crawler mail, the bucket replica and the interop - runner do not start there. The Minecraft plugins that talk outward - (DiscordSRV, ServerBackup, AutoUpdateGeyser) are set aside before - every start: on 2026-11-16 DiscordSRV was missed on the first start - and logged the production bot in from the test server for 15 seconds. -- Apps run with mail pointed at nothing and `INDEXNOW_KEY` empty; the - asxpio monitor worker (external probes) stays off. -- SSH is limited by a Hetzner firewall to the admin; backup credentials - are on the servers only in `/run`, only during a restore. -- Delete the servers when testing ends: they hold production data. - -## Risks - -| Risk | Mitigation | -|---|---| -| Lock-out after the switch | Phase steps say how each host is reached at each point; services through ops and the other way round; Hetzner console last | -| nixos-infect breaks with a later NixOS | pinned by commit and checksum; `nix_channel` pinned to 26.05; nixos-anywhere as the fallback (`nixos/README.md`) | -| ops disk (38 GB) | 18 GB free today; the Nix store adds 3–5 GB, `/old-root` holds the old images until deleted; delete `/old-root/var/lib/docker` once the apps run | -| Data of newer versions than 26.05 ships | Prometheus, Grafana, Xray, SillyTavern from nixos-unstable; Garage 2.x pinned; checked on the rehearsal pair with prod data | -| Something only production does | XMPP on real data and Let's Encrypt issuance were not rehearsed; both have a snapshot rollback and are checked first in their phase | -| A deploy during the window | freeze (Phase 0 step 6); the storage repo's deploy is off (step 4) | diff --git a/README.md b/README.md index 0cd8cfa..c6b459e 100644 --- a/README.md +++ b/README.md @@ -1,162 +1,93 @@ # asxp.io infrastructure -Two Hetzner Cloud servers, described by OpenTofu. They are moving from -Debian configured by Ansible to NixOS (`MIGRATION.md`); until a host has -moved, pushing to `main` still applies `ansible/site.yaml` to it. +Two Hetzner Cloud servers running NixOS, described by OpenTofu. -- Build the servers from nothing: `nixos/README.md` -- Restore data from backups: `RESTORE.md` +- `tofu/`: servers, network, firewalls, DNS, Object Storage buckets + (OpenTofu, applied by hand; `tofu/README.md`) +- `nixos/`: the whole system of each server (one flake; `nixos/README.md`) +- `RESTORE.md`: restoring data from the backups + +Branches: `main` is what runs. `ansible` is the Debian/Ansible setup as +it was before the move to NixOS (2026-11-16), `migration` the move +itself: its plan and record, the data scripts and the rehearsal rules. ## Servers | Server | Size | Runs | |--------|------|------| -| asxpio-ops | 2 vCPU, 4 GB | Traefik, Forgejo, monitoring, crawler stats; app stacks deployed from their own repos | -| asxpio-services | 8 vCPU, 16 GB | Forgejo Actions runners, Minecraft (Paper), SillyTavern, XMPP (asxp.io), Xray | +| asxpio-ops | CX23: 2 vCPU, 4 GB | WireGuard hub, Traefik, Forgejo (+ registry), Postgres, Garage, monitoring; app stacks deployed from their own repos | +| asxpio-services | CX43: 8 vCPU, 16 GB | Forgejo Actions runners, Minecraft (Paper), SillyTavern, XMPP (asxp.io), Xray | -Both are reachable for administration only over WireGuard -(10.20.0.0/24) or the private network (10.10.0.0/20). - -## Layout - -- `tofu/`: servers, network, firewalls, DNS, object storage buckets (OpenTofu). - Applied by hand; see `tofu/README.md`. -- `ansible/site.yaml`: everything the pipeline manages (see below). -- `ansible/playbooks/`: host bootstrap, run by hand. -- `.forgejo/workflows/deploy.yaml`: the pipeline. - -## What the pipeline manages - -| Role | Host | What | -|------|------|------| -| `base` | both | unattended upgrades, fail2ban, journal size cap, Docker daemon config, weekly image prune | -| `monitoring_agent` | both | node_exporter, cAdvisor and Alloy on the VPC address | -| `traefik` | ops | reverse proxy, TLS, dashboard on WireGuard | -| `xmpp_cert_sync` | ops | pushes Traefik's XMPP certificates to ejabberd (see below) | -| `crawler_alert` | ops | crawler reports (daily, weekly) and metrics every 5 min | -| `monitoring` | ops | Prometheus, Loki, Grafana, blackbox and Postgres exporters, alerts | -| `forgejo` | ops | Forgejo at git.asxp.io (git.czsk.it is an alias), SSH passthrough | -| `forgejo_runner` | services | Actions runner and its job labels | -| `forgejo_runner_interop` | services | runner for another-im/interop on dev.another.im | -| `sillytavern` | services | SillyTavern on the WireGuard address | -| `minecraft` | services | Paper server | -| `xmpp` | services | ejabberd, apushd and tackygram for asxp.io; secrets stay in `/opt/xmpp/state` | -| `acme_forward` | services | port 80: ACME challenges to Traefik on ops, 404 otherwise | -| `xray` | services | Xray VLESS Reality on :443, config in the vault | -| `monitoring_agent` | both | node_exporter, cAdvisor, Alloy (logs to Loki); `security-metrics` timer | -| `monitoring` | ops | Prometheus, Loki, Grafana at gf.asxp.io (WireGuard only), dashboards and alert rules | -| `restic_backup` | both | nightly restic backup to object storage, hel1 and fsn1 | -| `s3_replicate` | services | daily copy of the hel1 buckets into their fsn1 twins | - -Not managed here: the app stacks on asxpio-ops (asxpio, datacenterbingo, -blog, czsk, vhpbot, storage). Each deploys from its own repository into -`/opt/`. +Administration only over WireGuard (10.20.0.0/24) or the private network +(10.10.0.0/20). Both servers are billed below today's list price: never +delete or recreate them, reinstall in place (`nixos/README.md`). ## Changing something -1. Edit the role or variable, for example an image tag in - `ansible/inventory/group_vars/` or a compose file under - `ansible/roles//files/`. Versions are pinned exactly; Renovate - opens a PR per bump. -2. Push a branch. The pipeline does a dry run against production. -3. Merge to `main`. The pipeline dry-runs again, then applies. +Edit `nixos/`, push a branch (CI evaluates every host), merge to `main`: +`.forgejo/workflows/nixos.yaml` builds each host on itself and switches +to it, ops first. Only units whose definition changed restart. Undo +with `nixos-rebuild switch --rollback` on the host. -A run with nothing to change touches nothing and restarts nothing. +Versions are pinned (`flake.lock`, image tags); Renovate opens a PR per +bump and updates `flake.lock` weekly. Things to know: -- **Game servers** are saved and stopped with a 120 s timeout before a - compose change recreates them. -- **The runner** executes the pipeline. A change to it recreates the - container mid-job: the change lands, that job is reported as failed, - and the next run confirms it. -- **Forgejo** restarts on a config change; the job log may pause for a - few seconds. -- **New systemd units** don't exist yet during the dry run, so tasks that - enable them use `ignore_errors: "{{ ansible_check_mode }}"`. - -To run it yourself, over WireGuard: - -```sh -cd ansible -ansible-playbook site.yaml --check --diff # dry run -ansible-playbook site.yaml --tags traefik # one service -``` +- The runner executes the deploy. A change to it restarts it mid-job: + the change lands, the job shows as cancelled, the next run confirms. +- App stacks (asxpio, datacenterbingo, blog, czsk, vhpbot) are Podman + containers that their own repositories deploy with `docker compose` + as user `deploy`. `docker` and `podman` talk to the system Podman for + every admin. +- Your workstation's uplink may run through Xray on services: never stop + it without another path. ## Monitoring -Grafana is at https://gf.asxp.io, reachable over WireGuard and the VPC -only. Dashboards are provisioned from -`ansible/roles/monitoring/files/dashboards/` and can't be saved from the -UI: change the JSON and deploy. The overview is the home dashboard. +Grafana at https://gf.asxp.io (WireGuard only). Dashboards and the 33 +alert rules are provisioned from `nixos/hosts/asxpio-ops/monitoring/`; +change them there, not in the UI. Alerts mail `asxpio.alertEmail`. -- **Metrics:** Prometheus scrapes both hosts over the VPC and keeps 90 - days. Scripts add metrics through node_exporter's textfile directory - (`monitoring_textfile_dir`). -- **Logs:** Alloy ships the journal and container logs to Loki, kept 2 - years. From 2026-11-14 chunks go to bucket `asxpio-loki-main` (hel1); - older ones stay on disk until they expire. -- **Probes:** blackbox_exporter checks the sites and the TCP/TLS services - from outside (`monitoring_probes`). -- **Alerts** mail `monitoring_alert_email`. Rules are in - `templates/alert-rules.yaml.j2`. - -Settings: `ansible/inventory/group_vars/all/monitoring.yaml`. - -## XMPP certificates - -Traefik issues them; ejabberd on services only loads files. - -1. The router `xmpp-cert` in Traefik's dynamic config requests - xmpp.asxp.io + conference.asxp.io. The HTTP challenge reaches services - (where those names point), and `acme_forward` passes it to ops. - asxp.io itself is the site's certificate: Traefik never requests a - name it already holds. -2. `xmpp-cert-sync.path` on ops fires when `acme.json` changes (and a - timer daily). It pushes both certificates over SSH with a key that - only runs `xmpp-cert-install`, from ops' VPC address. -3. `xmpp-cert-install` checks name, expiry and key, writes - `/opt/xmpp/state/certs/.pem` and reloads ejabberd, which picks - a file per domain. - -Alerts: sync not successful for 2 days; served certificate older than -Traefik's for 6 hours; expiry under 14 days. Names: `xmpp_cert.yaml`. +- **Metrics:** Prometheus on ops scrapes both hosts, 90 days. +- **Logs:** Alloy ships the journal, container logs and Traefik's access + log to Loki (bucket `asxpio-loki-main`), 2 years. +- **Probes:** blackbox checks every site and TCP/TLS service from ops. +- **Security baseline:** every host reports its WireGuard peers, devices + on the private network, accounts, listening ports and privileged + containers; anything not declared in the config alerts. Each service + declares what it expects (`asxpio.security`). SSH logins show the same + summary. ## Backups -Hetzner's server backups are off. Each host runs `restic-backup.timer` -nightly (ops 03:30, services 04:15 UTC) into two independent -repositories, `restic/` in `asxpio-backups-main` (hel1) and -`asxpio-backups-repl` (fsn1). Databases go in as dumps or online -copies; see `restic_pre_hooks` in `ansible/inventory/host_vars/`. -A failed run mails its journal. - -```sh -restic-backup hel1 snapshots -restic-backup fsn1 restore latest --target /tmp/restore --include /opt/xmpp -``` - -The password is `vault_restic_password` in the vault. Keep a copy -outside the servers and this repo's CI: without it nothing can be read. - -`s3_replicate` copies `asxpio-backups-main` (minus `restic/`), -`asxpio-tofu-main`, `asxpio-loki-main` and `k8s-asxpio-main` to their fsn1 twins daily -around 06:10 UTC. A run that would delete over 1000 objects stops and -mails instead. +Nightly restic on each host (ops 03:30, services 04:15 UTC) into +`restic/` in `asxpio-backups-main` (hel1) and `asxpio-backups-repl` +(fsn1); a failed run mails. A daily replica (services, ~06:00) copies +`asxpio-backups-main` (minus `restic/`), `asxpio-tofu-main`, +`asxpio-loki-main` and `k8s-asxpio-main` to their fsn1 twins. Details +and restores: `RESTORE.md`. ## Secrets -Nothing secret is stored in the clear. Service secrets live in -`ansible/inventory/group_vars/all/vault.yaml`, encrypted with Ansible -Vault. The pipeline needs two repository secrets: +Service secrets are in `nixos/secrets/.yaml`, encrypted with sops +for the admin's age key and each host's SSH host key; the hosts decrypt +them at boot. CI holds only `SSH_DEPLOY_KEY`. Keep a copy of the admin +age key (`~/.config/sops/age/keys.txt`) outside this machine. -- `ANSIBLE_VAULT_PASSWORD`: decrypts the vault. -- `SSH_DEPLOY_KEY`: private key of user `deploy` on both servers. +## TODO -Locally, put the vault password in `ansible/.vault_pass` (ignored by git). - -## Bootstrap (by hand) - -`ansible/playbooks/` holds what is done once per host or can lock you -out: WireGuard, SSH hardening, s3fs mounts, swap, user creation. -See `ansible/README.md`. +- [ ] **From 2026-11-24**, if nothing came up: `rm -rf /old-root` on both + hosts (Debian and its leftovers: Postgres 17/18 rollback volumes on + ops), then delete the snapshots `pre-nixos-2026-11-17` and + `asxpio-ops-pre-nixos-2026-11-17` in the Hetzner console. +- [ ] Remove the repository secret `ANSIBLE_VAULT_PASSWORD` (Forgejo → + iac → Settings → Actions → Secrets). +- [ ] Empty and remove the old state buckets `asxpio-terraform-main/-repl` + (`legacy_state_*` in `tofu/s3.tofu`) once the new state has been in + use for a few weeks. +- [ ] Rotate the secrets that sat in the old repository history: + Forgejo's `INTERNAL_TOKEN` and JWT secrets, the runner token; give + Grafana its own `secret_key`. +- [ ] Move the app stacks to their own flakes on asxpio-services, one at + a time (blog → czsk → datacenterbingo → asxpio → vhpbot). diff --git a/RESTORE.md b/RESTORE.md index 9be32a7..589e665 100644 --- a/RESTORE.md +++ b/RESTORE.md @@ -8,120 +8,81 @@ UTC) into two independent repositories: | `hel1` | `s3:https://hel1.your-objectstorage.com/asxpio-backups-main/restic/` | | `fsn1` | `s3:https://fsn1.your-objectstorage.com/asxpio-backups-repl/restic/` | -A snapshot holds `/etc`, `/opt`, the listed container volumes and -`/var/backups/restic-stage`, where hooks put consistent copies of the -databases just before the run: +What a snapshot holds is declared next to each service (`asxpio.backup` +in `nixos/`): paths, and hooks that put consistent copies of databases +into `/var/backups/restic-stage` just before the run. -| Host | In `/var/backups/restic-stage` | Volumes | -|------|--------------------------------|---------| -| asxpio-ops | `pg_dumpall.sql`, `asxpio.dump` (`pg_dump -Fc`), `forgejo-gitea.db` | `storage_garage_meta`, `storage_garage_data` (with a fresh Garage metadata snapshot) | -| asxpio-services | `ejabberd.sqlite`; ejabberd's Mnesia as `nightly.backup` inside `xmpp_database` | `xmpp_database`, `xmpp_tackygram` | +| Host | Paths | In `/var/backups/restic-stage` | +|------|-------|--------------------------------| +| asxpio-ops | `/etc/ssh`, `/opt` (app stacks), `/var/lib/forgejo`, `/var/lib/garage` (after a metadata snapshot), `/var/lib/traefik`, `/var/lib/grafana` | `pg_dumpall.sql`, `asxpio.dump` (`pg_dump -Fc`), `forgejo.db` | +| asxpio-services | `/etc/ssh`, `/opt` (XMPP state), `/var/lib/minecraft`, `/var/lib/SillyTavern`, the Podman volumes `xmpp_database` and `xmpp_tackygram` | `ejabberd.sqlite`; Mnesia as `nightly.backup` inside `xmpp_database` | Not in the backup: Postgres' data directory (restore from the dump), -`/opt/containerd`, and what Minecraft downloads again (`cache`, -`libraries`, `versions`). The exact lists are `restic_paths`, -`restic_excludes` and `restic_pre_hooks` in -`ansible/inventory/host_vars/`. +Prometheus and Loki's local data, and what Minecraft downloads again. -Three secrets are needed, and none of them may exist only on the -servers: the Object Storage access key and secret key, and the restic -password (`vault_restic_password` in the Ansible vault). **Without the -password nothing can be read.** +Three secrets are needed: the Object Storage keys (`s3/access_key`, +`s3/secret_key`) and the restic password (`restic/password`), all in +`nixos/secrets/.yaml`. **Without the password nothing can be read.** ## One file or one service, on a running host ```sh restic-backup hel1 snapshots -restic-backup hel1 ls latest /opt/xmpp +restic-backup hel1 ls latest /var/lib/minecraft/world restic-backup fsn1 restore latest --target /tmp/r --include /opt/xmpp ``` Restore beside the live data, compare, then stop the service and move the files into place. -## A whole host, onto a fresh system +## A whole host -On a host built by `nixos/README.md` (or any Linux with restic): +Build a fresh host first (`nixos/README.md`). Services that own data do +not start until `/var/lib/.data-in-place` exists, so nothing creates +empty state where the restore lands. ```sh -export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... -export RESTIC_PASSWORD=... +export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... RESTIC_PASSWORD=... export RESTIC_REPOSITORY=s3:https://hel1.your-objectstorage.com/asxpio-backups-main/restic/asxpio-ops -restic snapshots --host asxpio-ops # pick one; "latest" below +restic snapshots --host asxpio-ops +restic restore latest --host asxpio-ops --target / ``` -Keep every service stopped until its data is back, so nothing starts on -an empty directory and creates fresh state where the restore will land. +Then, on ops: -1. **Files.** `/etc` is restored aside, for reference only: the system's - configuration comes from the flake. +1. `touch /var/lib/.data-in-place; systemctl start postgresql` +2. `runuser -u postgres -- psql -q postgres < /var/backups/restic-stage/pg_dumpall.sql` + (one error, `role "postgres" already exists`, is expected), then + `systemctl restart postgres-roles` to set the passwords from sops. +3. Replace Forgejo's database with the staged copy: + `cp /var/backups/restic-stage/forgejo.db /var/lib/forgejo/data/forgejo.db`, + `chown git:git` it, then `forgejo-admin regenerate keys`. +4. Reboot. Everything starts, the app containers through podman-restart. - ```sh - restic restore latest --target / --include /opt --include /var/backups/restic-stage - restic restore latest --target /root/restored-etc --include /etc - ``` +On services: the XMPP volumes come back with the restore; replace +`ejabberd.sqlite` in `xmpp_database` with the staged copy, and if Mnesia +does not come up clean, `podman exec xmpp-ejabberd ejabberdctl restore +/opt/ejabberd/database/nightly.backup`. Then `touch +/var/lib/.data-in-place` and reboot. -2. **Volumes** (while services still run in containers): create each - volume, then restore into it. +Check: the sites answer (Grafana → Probes), a git clone over SSH, an XMPP +login, the Minecraft world, the next nightly backup. - ```sh - docker volume create storage_garage_meta # one per volume in the table - restic restore latest --target / --include /var/lib/docker/volumes/storage_garage_meta - ``` +## Backups from the Debian era - Under Podman the volume lives in - `/var/lib/containers/storage/volumes/`: restore to a temporary - target and move `_data` there. - -3. **Databases**, from the staged copies rather than the live files: - - - **Postgres** (ops): start Postgres alone on its empty data - directory, then load everything, roles included: - - ```sh - psql -U postgres -f /var/backups/restic-stage/pg_dumpall.sql - ``` - - `asxpio.dump` is the same database in `pg_restore` format, for - restoring only that one. - - **Forgejo** (ops): `cp /var/backups/restic-stage/forgejo-gitea.db - /opt/forgejo/data/gitea/gitea.db`, owner as the file it replaces. - - **Garage** (ops): if it does not start on the restored metadata, use - the snapshot inside the metadata volume (`snapshots/`), as described - in Garage's [recovery documentation](https://garagehq.deuxfleurs.fr/documentation/operations/recovering/). - - **ejabberd** (services): replace `ejabberd.sqlite` in `xmpp_database` - with the staged copy; if Mnesia does not come up clean, - `ejabberdctl restore /opt/ejabberd/database/nightly.backup`. - -4. **Start the services**, then check: the sites answer, a `git clone` - from Forgejo works, an XMPP client logs in, the Minecraft world is the - expected one, and the next nightly backup succeeds. - -The app stacks on ops (asxpio, datacenterbingo, blog, czsk, vhpbot, -storage) come back with `/opt/` (compose file and `.env`); their -images are pulled from the registry in Forgejo, so Forgejo and storage -come first. If the registry copy is gone, re-run each app's CI. - -## Onto a NixOS host - -The backup made by a NixOS host holds the new layout (`/var/lib/forgejo`, -`/var/lib/garage`, `/var/lib/minecraft`, ...): restore to `/`, load the -Postgres dump, `touch /var/lib/.data-in-place`, start the services. - -A backup made while the host was still Debian holds the layout described -above. Restore it to a side directory and let the migration script move -it into place; this is what was rehearsed on 2026-11-16: +Snapshots taken before 2026-11-17 hold the Debian/Docker layout +(`/opt/forgejo`, Docker volumes). Restore one to a side directory and +let the migration scripts on branch `migration` move it into place: ```sh -restic restore latest --host asxpio-ops --target /restore -bash nixos/migration/ops-data.sh /restore # or services-data.sh +git show migration:nixos/migration/ops-data.sh > /tmp/ops-data.sh # or services-data.sh +restic restore --target /restore +bash /tmp/ops-data.sh /restore ``` ## Keeping this true -A restore that was never tried is a hope. After any change to what is -backed up, and at least twice a year, restore the latest snapshot of -each host onto a rehearsal server (`nixos/README.md`) and walk through -this page. Last walk-through: 2026-11-16, both hosts, onto the NixOS -rehearsal pair (Traefik, monitoring, the app stacks and XMPP not yet -part of it). +After a change to what is backed up, and at least twice a year, restore +the latest snapshot of each host onto a rehearsal server (`nixos/README.md`) +and walk through this page. Last walk-through: 2026-11-17, both hosts +(the ops runbook on a fresh server with that night's backup). diff --git a/ansible/.gitignore b/ansible/.gitignore deleted file mode 100644 index 8d51cab..0000000 --- a/ansible/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Ansible-specific -*.retry -*.log -.ansible/ - -# Vault -vault.yaml -.vault_pass -.vault_password -*vault_password* -vault-password.txt -*_vault.yaml.decrypted -vault.yaml.decrypted -*.vault.dec -*.decrypted diff --git a/ansible/README.md b/ansible/README.md deleted file mode 100644 index 4e06fb7..0000000 --- a/ansible/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# Ansible - -`site.yaml` is the desired state of both servers and is applied by the -deploy pipeline on every push to `main`. The playbooks under -`playbooks/` are host bootstrap and are run by hand. - -## Running - -```sh -echo '' > .vault_pass && chmod 600 .vault_pass - -ansible-playbook site.yaml --check --diff # dry run, over WireGuard -ansible-playbook site.yaml # apply -ansible-playbook site.yaml --tags forgejo # one role -``` - -On NixOS: `nix shell nixpkgs#ansible -c ansible-playbook …`. - -Templates that carry secrets are never shown in `--diff` output. - -## Inventories - -- `inventory/hosts.yaml`: default. Connects as root to the WireGuard - addresses. -- `inventory/ci.yaml`: used by the pipeline. Connects as `deploy` over - the private network, reaching asxpio-services through asxpio-ops. - -`known_hosts` pins both servers' SSH host keys for the pipeline. - -## Variables - -``` -inventory/ -├── group_vars/all/ -│ ├── network.yaml # VPC and WireGuard addresses -│ ├── paths.yaml # /opt -│ ├── s3.yaml # object storage buckets and s3fs mounts -│ ├── wireguard.yaml # WireGuard peers -│ └── vault.yaml # encrypted secrets -├── group_vars/ops_servers/ -│ ├── traefik.yaml # traefik_version -│ └── forgejo.yaml # forgejo_version, domain and aliases -├── group_vars/services_servers/ -│ ├── forgejo_runner.yaml # runner version, labels' nix image -│ └── minecraft.yaml -└── host_vars/ # per-host addresses, SSH and s3fs settings -``` - -Compose files without variables are plain files under -`roles//files/`; edit the image tag there. - -## Roles in site.yaml - -`base`, `traefik`, `crawler_alert`, `forgejo`, `forgejo_runner`, -`sillytavern`, `minecraft`, `xmpp`, `xray`, `restic_backup`. Service roles go -through `docker_service`, which writes the files, runs -`docker compose up -d`, restarts on a config change and waits for the -service to answer. - -`crawler_alert` installs a copy of -[traefik-crawlers-statistics](https://git.asxp.io/asxpi/traefik-crawlers-statistics); -update `roles/crawler_alert/files/` from there. - -## Security monitoring - -`security-metrics` (role `monitoring_agent`, every minute on both hosts) -exports WireGuard peers, devices answering on the VPC, login accounts, -sudo/docker members, listening ports and containers with host access, each -with `known="true|false"` against a baseline, plus fingerprints of the -account, sudoers, sshd, WireGuard and `authorized_keys` files. Grafana -(dashboard Security, alert group `security`) mails on anything unknown, a -changed file, an SSH login from outside WireGuard, failed-login bursts -(SSH, Forgejo, Grafana, asxp.io admin), new Forgejo users, keys or -runners, and logs or the collector going quiet. - -A deliberate change needs its baseline updated in the same commit, or it -alerts until it is: - -| Change | Variable | -|---|---| -| WireGuard client | `wireguard_clients` (`group_vars/all/wireguard.yaml`) | -| Server on the VPC | `security_vpc_hosts` | -| Server in the Hetzner project | `monitoring_hcloud_servers` (`group_vars/all/monitoring.yaml`) | -| Account, sudo or docker member | `security_login_users`, `security_sudo_users`, `security_docker_users` | -| Published or listening port | `security_ports_extra` (host_vars) | -| Privileged container, host network, Docker socket | `security_containers_extra` (host_vars) | - -Defaults are in `roles/monitoring_agent/defaults/main.yaml`. The VPC check -is a ping sweep: a device that drops ICMP is not seen. -Prometheus therefore also lists the project's servers from the Hetzner -API (`vault_hcloud_ro_token`, a read-only token) and alerts on an unknown -one, or when the list stops updating. - -## Bootstrap playbooks - -| Playbook | Purpose | -|----------|---------| -| `01-wireguard-setup.yaml` | WireGuard hub on asxpio-ops, peer on asxpio-services, client configs | -| `02-ssh-hardening.yaml` | restrict SSH to WireGuard and the private network | -| `03-setup-s3fs.yaml` | s3fs mounts on asxpio-services (off on asxpio-ops) | -| `04-add-user-zerrtika.yaml` | add a user to running servers | -| `05-swap.yaml` | 2 GB swapfile on asxpio-ops | - -Always dry-run these first with `--check --diff`. - -- `03-setup-s3fs.yaml` rewrites `/etc/s3fs/.passwd-s3fs`, which the - backup script on asxpio-ops also reads. -- On asxpio-services the WireGuard interface is named - `asxpio-services`, not `wg0`. Check `01-wireguard-setup.yaml` against - the host before re-running it there. - -## Runner notes - -The `nix-latest` label runs `nixos/nix:` -with a `nix-store-` volume over `/nix`. To bump it: change the -variable, let the pipeline apply it, then remove the old volume. - -## Runner and nix image upgrades - -`forgejo_runner_version` and `forgejo_runner_nix_version` are bumped by -Renovate PRs. Applying either one recreates the runner while it runs -the very job that applies it: - -- that run ends as *failed* (runner 13; *cancelled* on older runners) - after everything else has been applied, its log stopping in the - forgejo_runner role, - and its job container stays behind on asxpio-services - (`docker ps | grep FORGEJO-ACTIONS-TASK`); remove it; -- the next run confirms the result. The workflow only triggers on - changes under `ansible/` (or `workflow_dispatch` in the web UI), so an - empty commit starts nothing; -- after a nix bump, remove the old `nix-store-` volume. diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg deleted file mode 100644 index c5f542a..0000000 --- a/ansible/ansible.cfg +++ /dev/null @@ -1,21 +0,0 @@ -[defaults] -interpreter_python = auto_silent -gathering = smart -pipelining = True -retry_files_enabled = False -inventory = inventory/hosts.yaml -roles_path = roles -host_key_checking = False -module_name = shell -display_skipped_hosts = no -timeout = 30 -remote_user = root -vault_password_file = .vault_pass - -[connection] -pipelining=True - -[ssh_connection] -pipelining=True -control_path = /tmp/%%r@%%h:%%p -ssh_args = -o ControlPersist=10m -o PreferredAuthentications=publickey -o ControlMaster=no -o ForwardAgent=yes diff --git a/ansible/inventory/ci.yaml b/ansible/inventory/ci.yaml deleted file mode 100644 index c8e3b47..0000000 --- a/ansible/inventory/ci.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# Inventory for the Forgejo Actions runner. Jobs run in containers on -# asxpio-services, so asxpio-ops is reached over the VPC. The services -# host itself is reached through asxpio-ops: a container talking to its -# own host arrives from a Docker bridge address, which sshd and the -# firewall both refuse. - -all: - vars: - ansible_user: deploy - ansible_python_interpreter: /usr/bin/python3 - - children: - asxpio: - children: - ops_servers: - hosts: - asxpio-ops: - ansible_host: "{{ vpc_ip }}" - # Empty: asxpio-services runs NixOS (nixos/ on branch nix) and is - # no longer managed here - services_servers: {} - # Outside every play; listed only so that ops's roles can still read - # its variables (addresses, public IP) - nixos: - hosts: - asxpio-services: - ansible_host: "{{ vpc_ip }}" - ansible_ssh_common_args: "-o ProxyJump=deploy@{{ asxpio_ops_vpc_ip }}" diff --git a/ansible/inventory/group_vars/all/monitoring.yaml b/ansible/inventory/group_vars/all/monitoring.yaml deleted file mode 100644 index b937852..0000000 --- a/ansible/inventory/group_vars/all/monitoring.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# Monitoring: Prometheus, Loki and Grafana on asxpio-ops; node_exporter, -# cAdvisor and Alloy on both hosts. Scrapes and log shipping use the VPC. - -# renovate: datasource=docker depName=prom/prometheus -monitoring_prometheus_version: "v3.16.0" -# renovate: datasource=docker depName=grafana/grafana -monitoring_grafana_version: "13.3.1" -# renovate: datasource=docker depName=grafana/loki -monitoring_loki_version: "3.7.10" -# renovate: datasource=docker depName=grafana/alloy -monitoring_alloy_version: "v1.22.0" -# renovate: datasource=docker depName=prom/node-exporter -monitoring_node_exporter_version: "v1.12.1" -# renovate: datasource=docker depName=ghcr.io/google/cadvisor -monitoring_cadvisor_version: "v0.60.6" -# renovate: datasource=docker depName=prom/blackbox-exporter -monitoring_blackbox_version: "v0.29.1" -# renovate: datasource=docker depName=quay.io/prometheuscommunity/postgres-exporter -monitoring_postgres_exporter_version: "v0.20.1" - -monitoring_metrics_retention: 90d -monitoring_logs_retention: 17520h # 2 years, chunks in S3 (asxpio-loki-main) -monitoring_alert_email: me@asxp.io - -# Agents listen on the host's VPC address only -monitoring_node_exporter_port: 9100 -monitoring_cadvisor_port: 9180 -monitoring_loki_port: 3100 -monitoring_textfile_dir: /var/lib/node_exporter/textfile - -monitoring_grafana_host: gf.asxp.io -monitoring_grafana_admin_password: "{{ vault_grafana_admin_password }}" -monitoring_forgejo_metrics_token: "{{ vault_forgejo_metrics_token }}" - -# Read-only Hetzner Cloud token: Prometheus lists the project's servers -# and alerts on one that is not named here. -monitoring_hcloud_token: "{{ vault_hcloud_ro_token }}" -monitoring_hcloud_servers: [asxpio-ops, asxpio-services] diff --git a/ansible/inventory/group_vars/all/network.yaml b/ansible/inventory/group_vars/all/network.yaml deleted file mode 100644 index 205f534..0000000 --- a/ansible/inventory/group_vars/all/network.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -# Network configuration for all hosts -# Centralized network definitions to avoid hardcoding IPs across the codebase - -# VPC Network (Hetzner private network) -vpc_network: "10.10.0.0/20" -vpc_network_cidr: "10.10.0.0/20" - -# WireGuard VPN Network -wireguard_network: "10.20.0.0/24" -wireguard_network_cidr: "10.20.0.0/24" - -# Host IP Addresses -# These are used for service communication and should match inventory -asxpio_ops_vpc_ip: "10.10.0.10" -asxpio_ops_wireguard_ip: "10.20.0.10" - -asxpio_services_vpc_ip: "10.10.0.20" -asxpio_services_wireguard_ip: "10.20.0.20" - -# Trusted Networks for SSH Access -ssh_trusted_networks: - - "{{ wireguard_network }}" - - "{{ vpc_network }}" diff --git a/ansible/inventory/group_vars/all/paths.yaml b/ansible/inventory/group_vars/all/paths.yaml deleted file mode 100644 index 9410d1a..0000000 --- a/ansible/inventory/group_vars/all/paths.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# Base paths for all services - -# Base directory for all service installations -services_base_path: "/opt" diff --git a/ansible/inventory/group_vars/all/s3.yaml b/ansible/inventory/group_vars/all/s3.yaml deleted file mode 100644 index 2ebea3b..0000000 --- a/ansible/inventory/group_vars/all/s3.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# S3 Object Storage Configuration -# These should be overridden in vault or environment-specific vars - -# S3 Endpoint Configuration -s3_region: hel1 -s3_endpoint: "https://{{ s3_region }}.your-objectstorage.com" - -# S3 Credentials -# WARNING: Store these in ansible-vault encrypted file! -# Override these in group_vars/all/vault.yaml (encrypted) -s3_access_key: "{{ vault_s3_access_key | default('') }}" -s3_secret_key: "{{ vault_s3_secret_key | default('') }}" - -# S3 Bucket names -s3_bucket_terraform_main: asxpio-terraform-main -s3_bucket_terraform_repl: asxpio-terraform-repl -s3_bucket_backups_main: asxpio-backups-main -s3_bucket_backups_repl: asxpio-backups-repl -s3_bucket_loki: asxpio-loki-main - -# S3 Buckets to mount on servers (non-replication only) -s3_buckets: - - name: "{{ s3_bucket_terraform_main }}" - mount_point: /mnt/s3/terraform - owner: root - group: root - mode: "0755" - - name: "{{ s3_bucket_backups_main }}" - mount_point: /mnt/s3/backups - owner: root - group: root - mode: "0755" diff --git a/ansible/inventory/group_vars/all/vault.yaml b/ansible/inventory/group_vars/all/vault.yaml deleted file mode 100644 index 2049a74..0000000 --- a/ansible/inventory/group_vars/all/vault.yaml +++ /dev/null @@ -1,175 +0,0 @@ -$ANSIBLE_VAULT;1.1;AES256 -31303531666133303130366364333335633834613435396332383835646361393965326264313761 -3130333462393633626164343139326463333730663730660a356337376432306236386433663136 -31303461383964663635306232663831333232646163336639393231316633613465616532623032 -3462313231346132370a623139626336646164356436356366653737316635643733616332333265 -30623737623135313333346531386431663139373863666661323330393263343361303565653861 -61363338336666363765663432663233656136316436656636366265616362646130303437326466 -33333336626531396232346663356636643265633238346638623766643639653035306633383237 -61653135663039333736633861636434393866303432643530656139333338383661613464616663 -32646135323661326431373731383339666533326464663636383732356239396430343634393233 -61633231393039336665616239323466383838396538343264303038323437653239313039373666 -38656166386366333836666565343864376361653033356439343365646239333462346336333034 -37316637323839633032313363316431623232313830303764396666643963643663316433653638 -30636365613637663064316138336563393238396364653431383233303064383037386334613230 -32383064363033623661646131636438303664363732663963313438666162646365316365386333 -66373435653065306634653962376366653566363034393832663161636163393032343164616163 -61626162346466333431303134393038646431613335373862323831303461626332376664393633 -65353932643064633132316465626639346365633137653661303031383031373738643965663965 -63646337646638373565363030656134623361653161623830303166623739323736383438656434 -32383936636336386361353734613538663831326666666233323231653238353233333937626266 -36663130653336646165373438353039623061386364643666616365636434306330316664326134 -39396364393531396233626235386331313862663765666564313565663230633536316430366264 -34303439636338643334356134363835356639356365343566346131383065646533633133303135 -38633265633037386566663264646161393165316261653330646631656631613330336639623862 -66383164376232396135373165386663643165323039303066376234636565653534613965303734 -61383964396338326162303633336465323538363365623864303034386238336363653263626664 -38333839303763326466303565386366623337613963383363393638613930353665636135346165 -34623539633239653563326165326636383734663635393030383063666138356564326132343661 -30303161303336396461313962323962336162366336663066663630656438643834653963353264 -61646666613834616439346233663338666137386134323130626336663565356561376464353635 -36333430636461333130353762363835373631346362366637306135656564656639393337383863 -65303763386263363661353337666166396334393034353364383336393261356562333733353861 -64393531653961326335363663663137346239393436633137376163616537633864643364356362 -39376662633039316632336630373432643235326336313433376639663966353233643335333061 -66333335356232643566613963303930656135326230666562333365383338656334366135396135 -31316634313663653939353134383735303438306361386433333862383261353037316439323135 -30323963303064663665346632393532343739373530633536653133346437343763656665613131 -37623162386434353433376533653036373332636265613737386465333036623263376361376134 -34623230376666646538303936373837613766613563346238353663616435643930613130316439 -38346331346630323234653762313763666364663433343938636562306261333566313863353261 -64326338373636353231643665343039313962343039613635633137666230336231323631343339 -66643362326266626565306439646632623231343137323838316330343432383538303237623232 -64636334653161343363373938393864333437373430393533366263363761306562376561393137 -39353166363230626139333566663161386138343835616436366664336537623661623930666463 -34323235613334363964346431333563656631663239663563356161383430616262643730366136 -64663031326639386634306361643536373635316266383263633264383237326664373865646230 -30343739626463636135343639363230643037613166393130626539303037616264373134393763 -37346466376438323234643162333739353831383137386238633132613434353730663430623035 -65343639663365336631303236356361363533376564613335666534393535646637636361323435 -62373039623338306166646465623963656334363563666134336630613531353365326662623064 -39373330333164643561653133613731396466323335346362663338333937343034386533333965 -61343532346232386263623533613432343231383838636130613137323061383465356131326461 -31383534663663626433316331396139333365643630336135376536356564383131653836373238 -36363334643239656331323533626266363130663237636463366364333634366134666135666363 -31363965323335346263333532373966386336653730663334356437636438323132303263393463 -33363562306433326331346235626234353064633334373861363962396162393134623235343535 -39633137323632346533353366633263356534323132333035343035663631306235633433343030 -35643565393263613562333637306362376430616236366361343466353163666461333839393561 -39326538656662663836633933393739366633323164383838633961626638616337383531306131 -33623734353836636235343663616665323039343637323132386464613763313862306531353736 -35303261393331333665626234373036336132366364393837326561313039656430653137346361 -63643364366565303566373931343063623338393432333039666531633537343033663661616534 -34333766653431366639306433306136316461363562306535616132616339663563323061316536 -35356338336363633435663538663832613238306139316163663262616339306633353363633763 -62643731306535303763323439333133346362623234376634623666663734636232323032306139 -39386464306338393339353831623037353034633134656465386332316334636162623639643634 -64633165643238623466353262663863373562613363363131373934623833663865633862373939 -37313131343562383530303933663033336463666133623739633266373339313634396634393665 -32396165316339616436396633343161333537666235343834633861393139343433396437383130 -37373961646166633631303238306463663536663663333661343239376565353030343437663730 -31396239306236356632646464346465373635383466623631373265643734383834356437656361 -34323838323964303563653133646333646133666164386464396362363566333139316566343835 -63626661333538343430346231376362393063333736653933356539623434613462663461373563 -64363062613037393930383562616230346631303966623466663130346230303537333964323238 -63316264306439313564656464633037376639363839393262613236393564626134353034633235 -64343837393464373631636561333636653735623832393236353135396231643632353233386536 -31656637366337633530623831383737626431363763346139393136636361663135326439366135 -33326337373661633861613466633165383437633830336364356666623738333135646536383438 -66336630663937326534306336386137356464663764326634646438356530623035626430663335 -35323338636232393330623066336162353566386432363737613239623731613038646438376339 -33353565656638636233316632626436646261323963396534323430303433663466646163643330 -63353666356263356539393833306231396335323837633262666434616165393038313164636339 -35346134306538313133376133373535373335656364623734333131316334386633346338303464 -38346337333631373663353732626163386638383437656539303264343563303561663363393463 -37653838666530336433356561316337313166613333353731626632613937633262663331633332 -63323761383533646238616662376138363132653030346162613164393231386663646130343265 -34633134613638356139333764666362636461313030366637326661623834303436653430353365 -65663766383438386538626233363430663230346633363563633130613736326631333239366334 -31646630663338316162333232353761646238643166656134323361313432353433653837326134 -63366265343936653864353433366530326633393366383061333836323332333133623866646534 -37616663633932306136336238353864326364643331373234353666656561336631313662326563 -32623334316335383161376334356331383936636137316137616465373838323964366565646561 -63633133646464303232623530333666323664386537356164346436396635396464303034313761 -66366234343436643930643039353262623866303830626530343664663462356339346233396239 -33613236303737383237623735386137383432386465636635626464313331666162653263356361 -31623639376437366530346534323939363739656563393563306532383064373566393333383730 -33666561663566383835316438383762643932316232363536383866383863366666663437623264 -39623262303938613637656266633632653462336138643130626366316336636331623464373338 -31363336343335646435316532333064633765306430666230376465613462346435623734393030 -34323836383061333736633933666532626636363034356232366335326263646335626635646433 -65373934343731663036633238373838616437656134393665663136363634323061383032323936 -66663133356561306535626131623730306266663565386663636364613064623963383838353533 -31383962626236373964363561386331376230386332333233366136396166666230636230383737 -32633530633264623864303430326561653563366164646436653061633839386165613765396433 -65653435363766386466656332653764393966613832396462356331396464336239373533633438 -62363431666533323639663434306165663966376538373535326562393331373137643530623435 -33393064346439376333666663396262653439646363643035396634383533666432313638306431 -34376531666334396634356139343534393231313032393232373866643365626461636165303934 -62333338326431383262363466306264343466346366643231616238323537636139393663386538 -31396465353633383134333432353332356330333138636533356335303165393834393832393636 -39336262613763323332616638396530663835666234613634303931616532303433366262353332 -36653735303165613263633738623839376566336437353137316264623439343031323637636538 -37383763303930383138636663363535616230666535613362366533663931353033623532306633 -38333961373335613030616333393139316235363662636137333635623063663765326165303363 -62373064356563353236376337656438663266666639323861323065643537626366653634393638 -63353265616165336237303934323033656561663131656362663463613762323032356431663739 -66363861393864386138643166316133613635393833386364666137623437303062626130646139 -37633135626363626436333365393762643866643863383765323962663534386564353264303834 -66353661343037646535623763386666393562666335373661326435353330393736613933663639 -64363065373563663337373163643730366538653766353431363630633163613035666163633837 -63643835356265616663663833333039663436333966386436643733366336353431643937323763 -31626363363733316663623433303733653930343662343364363631386138393063393033346338 -37383039613739613439366339663366363038396466343666616163386461613731343639663334 -63373864633662356261656265386232613438383733353632323030336535623765353965653330 -65373938643935613662653036646337636461373530663430383963363136613736373839643362 -31313665623537356262336432353966303634363039363965656435323139323330613735623965 -35373965346132333735336366666137383862653239623363656131343831373061373064613230 -35353564396233313337343063656366343162356633366630663261313238643266333061326265 -65353637613361613933386530363132386165333063303330396231393866313864343564363636 -35633832343636663861346230316262623361656337323065613663303765633237383565643131 -63323632353131353338653533623266663232343561626234313439663532373239633366653936 -32396233366639303839316265313738366337373061353737343733663165623538633361303961 -38336366653132656562643231313933633362623061396665356130643339336466326363643162 -30343836303364616266373464653135333261346234313863623336333666306666613739656362 -31396633626535373838656161643565386139313230393365643534633264633131323563653931 -34306632383466653435663837646538373762653837653539633039633766613435616134303234 -30366137643039373739666235343662653962366231656336353939373837666131353330636231 -33613436653835303431323437333362313363633834313337666634366463643933383934636565 -32303635396162313366653234663562366235613531613362343631396236336237393235323766 -34393066626634373163396232623131346231633562316431633331346264353963353430623134 -37636438343338666365373166373563316665373338623630613335303831393435323036663965 -31643036383738393863326631663632393366643763383539303336626330636435333833666633 -34636533613566303864643636303539363264663031643032333361663934353062323034623664 -33393664616432343733393861633431343732396238636530303135393830633265306337306337 -62376635326532333736326366383639633163626163363066303530353238373662323338633432 -63663337323535613838616236373561646262636563376632643962353466383763353337343037 -35626464346561343565396463386266616562646130623266646635386461303365643136363566 -39663737656165323730303164343431353932313638343033356262636435343061366166656638 -32376165346330353334613565643265376266353664366235666462396164353265393934633635 -63376633623066396464396464346666383765346530663638656436333730383737333433613465 -66623934346135643266356136316662366239336139366631393663323835396462386335613536 -34366638393164306561656663306263656534316130333064333963313836613163386263363538 -61383262306139346136383834333365353934313865346336346530613732636463333935366538 -32373461393039616561663933383835316539613061643863663762323130303662386363336336 -61313131623437303864373739303330363438616137323739313962623163363531656638363436 -36623564373831653037343933363166636661303736343933373239626530323862633561643365 -37336463333036363266653138393263623365616336306331623361373831616138323630623933 -61386662656163363165643439653864653765646262666332666636656464313834303634323736 -38306537643733316139383664326532653531663036616634306332336462623130616364616434 -35653239653466303031653533313338343162363665383361353766396335376237376334303435 -61323434653066363361306566653036363731393935373236303061626163323432633237633364 -37346532346162333762376439326466316233376265653632333431316339313230643834613431 -32383534653762373063323536623436633839623937386465313937383665363931306132343461 -34333933393936393537303633656662633263393635633035383261393563653432363634333861 -37336364326431653430363063633063306332386161313632323361323231396638386336363965 -64646437653266613065373662353130373134383236313064616630343934643038353161306133 -35393232303661363431633937366639303965636434646361366634363130303034336463383834 -30653865343766363563306331356664383431383932616362326234333032316439343665326439 -65336561616134336133363366363466633639353539383633386537373761623434363338643163 -30316465323436306636656135396563306538656634646330326666663237633737353233383562 -33336533383537396631333465343737633336353638636462333534343330356639343763656534 -62383163396135306630353839613631396235383061363639313135346333383265383561396132 -30376535303033353661303838663664623364306564383834306462386661343331636130373533 -65333933356264653361303434376433653866653562313630623733616630336531613637376232 -3265376534643634616634653437663435303533343630346433 diff --git a/ansible/inventory/group_vars/all/vault.yaml.template b/ansible/inventory/group_vars/all/vault.yaml.template deleted file mode 100644 index 9f3eec9..0000000 --- a/ansible/inventory/group_vars/all/vault.yaml.template +++ /dev/null @@ -1,56 +0,0 @@ ---- -# Ansible Vault Template -# Copy this file to vault.yaml and encrypt it with: -# ansible-vault encrypt vault.yaml -# -# Or create encrypted vault directly: -# ansible-vault create vault.yaml -# -# This file contains all sensitive secrets used across the infrastructure - -# ============================================================================ -# S3 Object Storage Credentials -# ============================================================================ -vault_s3_access_key: "YOUR_S3_ACCESS_KEY_HERE" -vault_s3_secret_key: "YOUR_S3_SECRET_KEY_HERE" - -# Optional: Alternative S3 endpoint if not using default -# vault_s3_endpoint: "https://hel1.your-objectstorage.com" - -# ============================================================================ -# Forgejo Secrets -# ============================================================================ -# Generate with: openssl rand -hex 32 -vault_forgejo_secret_key: "GENERATE_64_CHAR_HEX_STRING_HERE" - -# Generate with Forgejo or use existing JWT token -vault_forgejo_internal_token: "eyJhbGc..." - -# Generate with: openssl rand -base64 32 -vault_forgejo_jwt_secret: "GENERATE_BASE64_STRING_HERE" -vault_forgejo_lfs_jwt_secret: "GENERATE_BASE64_STRING_HERE" - -# ============================================================================ -# Forgejo Runner -# ============================================================================ -# Generate from Forgejo UI: Site Admin → Actions → Runners → Create Runner -vault_forgejo_runner_token: "GENERATE_FROM_FORGEJO_UI" - -# ============================================================================ -# SSL/TLS Certificates -# ============================================================================ -# Email for Let's Encrypt certificate notifications -vault_letsencrypt_email: "admin@example.com" - -# ============================================================================ -# Database Credentials (if needed for future services) -# ============================================================================ -# vault_postgres_password: "GENERATE_SECURE_PASSWORD" -# vault_mysql_root_password: "GENERATE_SECURE_PASSWORD" -# vault_redis_password: "GENERATE_SECURE_PASSWORD" - -# ============================================================================ -# API Keys and Tokens (if needed for future services) -# ============================================================================ -# vault_grafana_admin_password: "GENERATE_SECURE_PASSWORD" -# vault_immich_db_password: "GENERATE_SECURE_PASSWORD" diff --git a/ansible/inventory/group_vars/all/wireguard.yaml b/ansible/inventory/group_vars/all/wireguard.yaml deleted file mode 100644 index 204c290..0000000 --- a/ansible/inventory/group_vars/all/wireguard.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -# WireGuard VPN configuration -# Centralized configuration for all WireGuard settings - -# WireGuard network interface and port -wireguard_port: 60101 -wireguard_interface: "wg0" - -# WireGuard server configuration (asxpio-ops) -wireguard_ipv4: 10.20.0.10 -wireguard_ipv6: fd69:69:69::1 -wireguard_ipv4_network: 10.20.0.0/24 -wireguard_ipv6_network: fd69:69:69::/64 - -# Enable UFW firewall rules (set to false to use iptables PostUp/PostDown) -wireguard_enable_ufw: false - -# WireGuard clients -wireguard_clients: - - name: asxpio-services - ipv4: 10.20.0.20 - ipv6: fd69:69:69::20 - preshared_key: true - persistent_keepalive: 25 - - name: laptop - ipv4: 10.20.0.2 - ipv6: fd69:69:69::2 - preshared_key: true - persistent_keepalive: 25 - - name: aleks - ipv4: 10.20.0.3 - ipv6: fd69:69:69::3 - preshared_key: true - persistent_keepalive: 25 - - name: zerrtika - ipv4: 10.20.0.4 - ipv6: fd69:69:69::4 - preshared_key: true - persistent_keepalive: 25 - - name: sanya - ipv4: 10.20.0.5 - ipv6: fd69:69:69::5 - preshared_key: true - persistent_keepalive: 25 - -# DNS servers for VPN clients -wireguard_dns_servers: - - 1.1.1.1 - - 1.0.0.1 - -# Optional: Additional routes for split tunneling -# wireguard_additional_routes: -# - 192.168.1.0/24 diff --git a/ansible/inventory/group_vars/all/xmpp_cert.yaml b/ansible/inventory/group_vars/all/xmpp_cert.yaml deleted file mode 100644 index 57c643d..0000000 --- a/ansible/inventory/group_vars/all/xmpp_cert.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# The XMPP certificate is issued by Traefik on asxpio-ops (HTTP challenge; -# services forwards its challenges there, role acme_forward) and pushed to -# ejabberd on asxpio-services on every renewal (role xmpp_cert_sync). -xmpp_cert_main: xmpp.asxp.io -xmpp_cert_sans: [conference.asxp.io] -# Certificates pushed to ejabberd, by their main domain in acme.json; it -# picks the matching file per domain. asxp.io is the site's own -# certificate: Traefik never requests a name it already holds a -# certificate for, so asxp.io can't be part of the one above. -xmpp_cert_push: [asxp.io, xmpp.asxp.io] -# renovate: datasource=docker depName=nginx -acme_forward_nginx_version: "1.31.8-alpine-slim" diff --git a/ansible/inventory/group_vars/ops_servers/forgejo.yaml b/ansible/inventory/group_vars/ops_servers/forgejo.yaml deleted file mode 100644 index 37890a3..0000000 --- a/ansible/inventory/group_vars/ops_servers/forgejo.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# renovate: datasource=docker depName=codeberg.org/forgejo/forgejo -forgejo_version: "17.0.1" - -# The instance answers on every name below. forgejo_domain is the -# canonical one (ROOT_URL, clone URLs, mail links); the rest are aliases. -forgejo_domain: git.asxp.io -forgejo_alias_domains: - - git.czsk.it - -forgejo_base_path: "{{ services_base_path }}/forgejo" -forgejo_http_port: 3000 - -# app.ini is owned by the container's git user -forgejo_uid: 1000 -forgejo_gid: 1000 - -traefik_network: traefik - -forgejo_secret_key: "{{ vault_forgejo_secret_key }}" -forgejo_internal_token: "{{ vault_forgejo_internal_token }}" -forgejo_jwt_secret: "{{ vault_forgejo_jwt_secret }}" -forgejo_lfs_jwt_secret: "{{ vault_forgejo_lfs_jwt_secret }}" -forgejo_server_lfs_jwt_secret: "{{ vault_forgejo_server_lfs_jwt_secret }}" -forgejo_smtp_user: "{{ vault_forgejo_smtp_user }}" -forgejo_smtp_password: "{{ vault_forgejo_smtp_password }}" diff --git a/ansible/inventory/group_vars/ops_servers/traefik.yaml b/ansible/inventory/group_vars/ops_servers/traefik.yaml deleted file mode 100644 index 286710f..0000000 --- a/ansible/inventory/group_vars/ops_servers/traefik.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# renovate: datasource=docker depName=traefik -traefik_version: "v3.7.19" -traefik_base_path: "{{ services_base_path }}/traefik" -traefik_dashboard_port: 8080 -traefik_network: traefik - -letsencrypt_email: "{{ vault_letsencrypt_email }}" diff --git a/ansible/inventory/group_vars/services_servers/forgejo_runner.yaml b/ansible/inventory/group_vars/services_servers/forgejo_runner.yaml deleted file mode 100644 index af07fae..0000000 --- a/ansible/inventory/group_vars/services_servers/forgejo_runner.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -# Forgejo Runner (CI/CD) configuration - -# Runner version and settings -# renovate: datasource=docker depName=code.forgejo.org/forgejo/runner -forgejo_runner_version: "13.2.1" -forgejo_runner_capacity: 4 -forgejo_runner_timeout: 3h - -# Image behind the nix-latest label. Jobs mount a nix-store volume over -# /nix, seeded from this image on first use; the image's /bin/sh and -# /etc/nix/nix.conf link into that store, so a volume from another -# version breaks them. Bumping this also switches to a fresh volume. -# renovate: datasource=docker depName=nixos/nix -forgejo_runner_nix_version: "2.35.6" -forgejo_runner_token: "{{ vault_forgejo_runner_token }}" - -# Runner installation path -forgejo_runner_base_path: "{{ services_base_path }}/forgejo-runner" - -# The runner talks to Forgejo over the VPC, not through Traefik -forgejo_http_port: 3000 diff --git a/ansible/inventory/group_vars/services_servers/forgejo_runner_interop.yaml b/ansible/inventory/group_vars/services_servers/forgejo_runner_interop.yaml deleted file mode 100644 index 3d01ae7..0000000 --- a/ansible/inventory/group_vars/services_servers/forgejo_runner_interop.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Runner for another-im/interop on dev.another.im, moved here from its own -# cx23 (claude-test-interop-runner). Registered in Forgejo as a UUID + -# token pair; the UUID is not secret (interop's infra/runner.json). -interop_runner_uuid: "dc326085-8420-4c33-8b88-a9ef46b3359b" -interop_runner_token: "{{ vault_interop_runner_token }}" -interop_runner_capacity: 3 diff --git a/ansible/inventory/group_vars/services_servers/xmpp.yaml b/ansible/inventory/group_vars/services_servers/xmpp.yaml deleted file mode 100644 index f86e942..0000000 --- a/ansible/inventory/group_vars/services_servers/xmpp.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# another.im XMPP server for asxp.io: ejabberd, apushd (push), tackygram -# (Telegram gateway). Upstream: https://dev.another.im/another-im/anotherim-server -xmpp_domain: asxp.io - -# renovate: datasource=docker depName=dev.another.im/another-im/anotherim-server -xmpp_ejabberd_version: "2026.11.07" -# renovate: datasource=docker depName=dev.another.im/another-im/apushd -xmpp_apushd_version: "0.2" -# renovate: datasource=docker depName=dev.another.im/another-im/tackygram -xmpp_tackygram_version: "0.4.3" - -xmpp_upload_url: https://hel1.your-objectstorage.com/asxpio-xmpp-public/ -xmpp_tackygram_call_ports: "50000-50099" diff --git a/ansible/inventory/group_vars/services_servers/xray.yaml b/ansible/inventory/group_vars/services_servers/xray.yaml deleted file mode 100644 index 3655d34..0000000 --- a/ansible/inventory/group_vars/services_servers/xray.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# Xray VLESS Reality proxy on :443 (host network) -# renovate: datasource=docker depName=ghcr.io/xtls/xray-core -xray_version: "26.11.9" -xray_config: "{{ vault_xray_config }}" diff --git a/ansible/inventory/host_vars/asxpio-ops.yaml b/ansible/inventory/host_vars/asxpio-ops.yaml deleted file mode 100644 index be25574..0000000 --- a/ansible/inventory/host_vars/asxpio-ops.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -public_ip: 135.181.27.77 -vpc_ip: "{{ asxpio_ops_vpc_ip }}" -wireguard_ip: "{{ asxpio_ops_wireguard_ip }}" - -# SSH: the git user may connect from anywhere (Forgejo passthrough) -ssh_allow_public_git: true -ssh_git_user: git - -# s3fs is off here: its ensure_diskfree reserve never fit the 38 GB disk -s3fs_enabled: false -s3fs_ensure_diskfree: 20000 - -# restic: Postgres as a dump, Garage with a fresh metadata snapshot, -# Forgejo's SQLite through the online backup API -restic_paths: - - /etc - - /opt - - /root/backups/rclone-hetzner.sh - - /var/lib/docker/volumes/storage_garage_meta - - /var/lib/docker/volumes/storage_garage_data -restic_excludes: - - /opt/backups - - /opt/containerd -restic_pre_hooks: - - docker exec storage-postgres pg_dumpall -U postgres > "$STAGE/pg_dumpall.sql" - - docker exec storage-postgres pg_dump -U postgres -Fc asxpio > "$STAGE/asxpio.dump" - - docker exec storage-garage /garage meta snapshot --all - - sqlite3 /opt/forgejo/data/gitea/gitea.db ".backup '$STAGE/forgejo-gitea.db'" -restic_schedule: "*-*-* 03:30:00" - -# Security baseline (role monitoring_agent) -security_login_users_extra: [git] -security_docker_users_extra: [git] -security_wg_peer_names: "{{ wireguard_clients | map(attribute='name') | list }}" -security_forgejo_db: "{{ services_base_path }}/forgejo/data/gitea/gitea.db" -security_ports_extra: - - tcp/80/docker-proxy - - tcp/443/docker-proxy - - tcp/3000/docker-proxy # Forgejo, for the runners over the VPC - - "tcp/{{ monitoring_loki_port }}/docker-proxy" - - tcp/8080/docker-proxy # Traefik dashboard, WireGuard address - - "udp/{{ wireguard_port }}/" -security_containers_extra: - traefik: [docker-sock] diff --git a/ansible/inventory/host_vars/asxpio-services.yaml b/ansible/inventory/host_vars/asxpio-services.yaml deleted file mode 100644 index f15fbd4..0000000 --- a/ansible/inventory/host_vars/asxpio-services.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -public_ip: 46.62.228.216 -vpc_ip: "{{ asxpio_services_vpc_ip }}" -wireguard_ip: "{{ asxpio_services_wireguard_ip }}" - -ssh_allow_public_git: false - -# s3fs is off: its cache took ~10 GB and nothing reads the mounts any more; -# restic and s3_replicate talk to object storage directly -s3fs_enabled: false - -# restic: ejabberd's Mnesia through its own backup command, its SQLite -# through the online backup API. The Paper world is copied live (RCON is -# off, so there is no save-off); its autosave keeps that close enough. -restic_paths: - - /etc - - /opt - - /var/lib/docker/volumes/xmpp_database - - /var/lib/docker/volumes/xmpp_tackygram -restic_excludes: - - /opt/containerd - - /opt/minecraft/cache - - /opt/minecraft/libraries - - /opt/minecraft/versions -restic_pre_hooks: - - docker exec xmpp-ejabberd-1 ejabberdctl backup /opt/ejabberd/database/nightly.backup - - sqlite3 /var/lib/docker/volumes/xmpp_database/_data/ejabberd.sqlite ".backup '$STAGE/ejabberd.sqlite'" -restic_schedule: "*-*-* 04:15:00" - -# Security baseline (role monitoring_agent) -security_wg_peer_keys: - "0gRrNiV4FjP6ipczZCRD3dsnK7k7rl6IyjG84fPaJB4=": asxpio-ops -security_ports_extra: - - tcp/80/docker-proxy # ACME challenges, forwarded to ops - - tcp/443/xray - - udp/*/xray # outbound relay sockets - - tcp/*/forgejo-runner # cache server, random ports - - tcp/8000/docker-proxy # SillyTavern, WireGuard address - - tcp/25565/docker-proxy # Minecraft - - udp/19132/docker-proxy - - tcp/5222/docker-proxy # XMPP - - tcp/5223/docker-proxy - - tcp/5269/docker-proxy - - tcp/5443/docker-proxy - - tcp/7777/docker-proxy # SOCKS5 bytestreams - - tcp/8448/docker-proxy # Matrix federation - - tcp/3478/docker-proxy # TURN and its relay ranges - - udp/3478/docker-proxy - - udp/49160-49199/docker-proxy - - udp/50000-50099/docker-proxy - - udp/52820/ # WireGuard -security_containers_extra: - forgejo-runner: [host-net, docker-sock] - forgejo-runner-interop: [docker-sock] - "FORGEJO-ACTIONS-TASK-.*": [docker-sock] # docker_host: automount - xray: [host-net] diff --git a/ansible/inventory/hosts.yaml b/ansible/inventory/hosts.yaml deleted file mode 100644 index fca4091..0000000 --- a/ansible/inventory/hosts.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# Default inventory: run from a workstation over WireGuard, as root. -# CI uses inventory/ci.yaml instead (VPC addresses, user deploy). - -all: - vars: - ansible_user: root - ansible_python_interpreter: /usr/bin/python3 - - children: - asxpio: - children: - ops_servers: - hosts: - asxpio-ops: - ansible_host: "{{ wireguard_ip }}" - # Empty: asxpio-services runs NixOS (nixos/ on branch nix) and is - # no longer managed here - services_servers: {} - # Outside every play; listed only so that ops's roles can still read - # its variables (addresses, public IP) - nixos: - hosts: - asxpio-services: - ansible_host: "{{ wireguard_ip }}" diff --git a/ansible/known_hosts b/ansible/known_hosts deleted file mode 100644 index ed9c64c..0000000 --- a/ansible/known_hosts +++ /dev/null @@ -1,2 +0,0 @@ -10.10.0.10,10.20.0.10 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzuhnXIFERF+slCGpjnQFhaO5iTVqVn9OMbt7jeFOUf -10.10.0.20,10.20.0.20 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDArwdI8bHpQhNnMqz7vOIGJvb5eYE7GahtkbxrNgtvp diff --git a/ansible/playbooks/01-wireguard-setup.yaml b/ansible/playbooks/01-wireguard-setup.yaml deleted file mode 100644 index a410c00..0000000 --- a/ansible/playbooks/01-wireguard-setup.yaml +++ /dev/null @@ -1,191 +0,0 @@ ---- -# Stage 1: WireGuard VPN Setup -# -# This playbook must be run FIRST to establish the WireGuard VPN network. -# After this playbook completes: -# 1. WireGuard will be running on all hosts -# 2. Client configs will be generated in playbooks/wireguard-configs/ -# 3. You MUST manually update inventory/hosts.yaml to use WireGuard IPs (10.20.0.x) -# 4. Then you can run playbook 02-full-deployment.yaml -# -# Usage: -# ansible-playbook playbooks/01-wireguard-setup.yaml -# - -- name: Deploy WireGuard VPN Server - hosts: ops_servers - become: true - gather_facts: true - - pre_tasks: - - name: Validate required variables - ansible.builtin.assert: - that: - - wireguard_network is defined - - vpc_network is defined - - ansible_host is defined - fail_msg: "Required network variables are missing. Check group_vars/all/" - success_msg: "Network variables validated successfully" - - - name: Display pre-deployment information - ansible.builtin.debug: - msg: | - ======================================== - WireGuard VPN Server Deployment - ======================================== - Target: {{ inventory_hostname }} (VPN Hub) - WireGuard network: {{ wireguard_network }} - VPC network: {{ vpc_network }} - - This will deploy WireGuard VPN server and generate client configs. - ======================================== - - roles: - - role: wireguard - -- name: Deploy WireGuard VPN Client - hosts: services_servers - become: true - gather_facts: true - - vars: - # Map each server to its client config name - wireguard_client_configs: - asxpio-services: asxpio-services - - tasks: - - name: Display client deployment information - ansible.builtin.debug: - msg: | - ======================================== - WireGuard VPN Client Deployment - ======================================== - Target: {{ inventory_hostname }} (VPN Client) - Will connect to: {{ asxpio_ops_wireguard_ip }} (asxpio-ops) - ======================================== - - - name: Get client config name for this host - ansible.builtin.set_fact: - client_config_name: "{{ wireguard_client_configs[inventory_hostname] }}" - when: inventory_hostname in wireguard_client_configs - - - name: Install WireGuard - ansible.builtin.apt: - name: - - wireguard - - wireguard-tools - state: present - update_cache: true - - - name: Create WireGuard config directory - ansible.builtin.file: - path: /etc/wireguard - state: directory - mode: '0700' - owner: root - group: root - - - name: Copy WireGuard client configuration - ansible.builtin.copy: - src: "{{ playbook_dir }}/wireguard-configs/asxpio-ops/{{ client_config_name }}.conf" - dest: "/etc/wireguard/{{ client_config_name }}.conf" - mode: '0600' - owner: root - group: root - when: client_config_name is defined - - - name: Enable and start WireGuard interface - ansible.builtin.systemd: - name: "wg-quick@{{ client_config_name }}" - enabled: true - state: started - when: client_config_name is defined - register: wg_client_start - - - name: Display client status - ansible.builtin.debug: - msg: | - ✅ WireGuard client configured on {{ inventory_hostname }} - Interface: wg-quick@{{ client_config_name }} - Status: {{ 'Started' if wg_client_start.changed else 'Already running' }} - when: client_config_name is defined - -- name: Post-deployment verification - hosts: localhost - gather_facts: false - tasks: - - name: Display post-deployment instructions - ansible.builtin.debug: - msg: | - ======================================== - WireGuard VPN Deployment Complete! - ======================================== - - Infrastructure deployed: - ✅ asxpio-ops: WireGuard VPN Server (hub) - ✅ asxpio-services: WireGuard VPN Client (connected to ops) - - Server-to-server connectivity: - - asxpio-ops ↔ asxpio-services via WireGuard (10.20.0.0/24) - - IMPORTANT NEXT STEPS FOR YOUR WORKSTATION: - - 1. Client configurations for your machine are in: - playbooks/wireguard-configs/asxpio-ops/ - - 2. Import a client config to connect your workstation: - - Linux/Mac: sudo wg-quick up ./playbooks/wireguard-configs/asxpio-ops/.conf - - Windows: Import the .conf file in WireGuard GUI - - 3. Test connectivity from your workstation: - ping {{ asxpio_ops_wireguard_ip }} - ping {{ asxpio_services_wireguard_ip }} - - 4. After connecting to WireGuard, run Stage 2: - ansible-playbook playbooks/02-full-deployment.yaml - - NOTE: Stage 2 automatically uses WireGuard IPs. - No manual configuration changes needed! - - ======================================== - - - name: Test WireGuard connectivity from controller - ansible.builtin.wait_for: - host: "{{ asxpio_ops_wireguard_ip }}" - port: 22 - timeout: 5 - state: started - register: wg_connectivity_test - failed_when: false - - - name: Display connectivity test results - ansible.builtin.debug: - msg: | - ======================================== - WireGuard Connectivity Test - ======================================== - - {% if wg_connectivity_test.failed %} - ❌ Cannot reach servers via WireGuard from your workstation yet - - This is NORMAL if you haven't connected your workstation to WireGuard. - - To connect: - 1. Import client config: playbooks/wireguard-configs/asxpio-ops/.conf - 2. Start WireGuard connection on your workstation - 3. Verify with: ping {{ asxpio_ops_wireguard_ip }} - 4. Run Stage 2: ansible-playbook playbooks/02-full-deployment.yaml - - {% else %} - ✅ WireGuard is reachable from your workstation! - - Server-to-server VPN: Connected - Workstation-to-server VPN: Connected - - You can now run Stage 2: - ansible-playbook playbooks/02-full-deployment.yaml - - Stage 2 automatically uses WireGuard IPs - no manual configuration needed! - {% endif %} - - ======================================== diff --git a/ansible/playbooks/02-ssh-hardening.yaml b/ansible/playbooks/02-ssh-hardening.yaml deleted file mode 100644 index ddfecb4..0000000 --- a/ansible/playbooks/02-ssh-hardening.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# Restricts SSH to the WireGuard and VPC networks (plus the public git -# user on asxpio-ops). Run by hand over WireGuard: a mistake here locks -# everyone out, so it is deliberately not part of site.yaml. -# -# ansible-playbook playbooks/02-ssh-hardening.yaml --check --diff - -- name: Harden SSH configuration - hosts: asxpio - become: true - gather_facts: true - vars: - ansible_host: "{{ wireguard_ip }}" - roles: - - role: ssh_hardening diff --git a/ansible/playbooks/03-setup-s3fs.yaml b/ansible/playbooks/03-setup-s3fs.yaml deleted file mode 100644 index 999fa07..0000000 --- a/ansible/playbooks/03-setup-s3fs.yaml +++ /dev/null @@ -1,82 +0,0 @@ ---- -# Stage 3: Setup S3FS on all servers -# -# This playbook sets up s3fs to mount S3 buckets as local filesystems. -# Must be run after Stage 2 (full deployment) to ensure Docker is installed. -# -# Mounts the following buckets: -# - asxpio-terraform-main -> /mnt/s3/terraform -# - asxpio-backups-main -> /mnt/s3/backups -# - asxpio-immich-main -> /mnt/s3/immich -# -# Cache sizes (per-host): -# - asxpio-ops (40GB disk): 10GB cache max -# - asxpio-services (160GB disk): 80GB cache max -# -# Usage: -# ansible-playbook playbooks/03-setup-s3fs.yaml -# -# IMPORTANT: Ensure S3 credentials are set in group_vars/all/vault.yaml: -# vault_s3_access_key: "your-access-key" -# vault_s3_secret_key: "your-secret-key" -# - -- name: Setup S3FS on all servers - hosts: ops_servers,services_servers - become: true - gather_facts: true - - pre_tasks: - - name: Validate S3 credentials are set - ansible.builtin.assert: - that: - - s3_access_key is defined - - s3_access_key != "" - - s3_secret_key is defined - - s3_secret_key != "" - fail_msg: | - S3 credentials not set! - Please set vault_s3_access_key and vault_s3_secret_key in: - - group_vars/all/vault.yaml (encrypted with ansible-vault) - OR - - Pass via command line: -e "s3_access_key=xxx s3_secret_key=yyy" - success_msg: "S3 credentials validated" - - - name: Display S3 configuration - ansible.builtin.debug: - msg: | - ======================================== - S3FS Setup on {{ inventory_hostname }} - ======================================== - Target: {{ inventory_hostname }} - S3 Region: {{ s3_region }} - S3 Endpoint: {{ s3_endpoint }} - - Buckets to mount: - {% for bucket in s3_buckets %} - - {{ bucket.name }} -> {{ bucket.mount_point }} - {% endfor %} - ======================================== - - roles: - - role: s3fs - - post_tasks: - - name: Display mounted filesystems - ansible.builtin.command: - cmd: df -h - register: df_output - changed_when: false - - - name: Show S3 mounts - ansible.builtin.debug: - msg: "{{ df_output.stdout_lines | select('search', 's3fs') | list }}" - - - name: Display post-setup information - ansible.builtin.debug: - msg: >- - {% if s3fs_enabled | default(true) | bool %}s3fs mounts on {{ inventory_hostname }}: - {{ s3_buckets | map(attribute='mount_point') | join(', ') }}, cache in - /var/cache/s3fs ({{ (s3fs_ensure_diskfree / 1024) | int }} GB kept free) - {% else %}s3fs is disabled on {{ inventory_hostname }}: mounts and - fstab lines removed{% endif %} diff --git a/ansible/playbooks/04-add-user-zerrtika.yaml b/ansible/playbooks/04-add-user-zerrtika.yaml deleted file mode 100644 index 3df339c..0000000 --- a/ansible/playbooks/04-add-user-zerrtika.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -# Add zerrtika user with same rights as asxpi (sudo + docker, key-only) -# and re-apply ssh_hardening so AllowUsers includes the new user. -# Cloud-init only creates users at first boot; this covers live servers. - -- name: Create zerrtika user - hosts: asxpio - become: true - vars: - ansible_host: "{{ wireguard_ip }}" - - tasks: - - name: Create user - ansible.builtin.user: - name: zerrtika - groups: - - sudo - - docker - append: true - shell: /bin/bash - password_lock: true - - - name: Authorize SSH key - ansible.posix.authorized_key: - user: zerrtika - key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIELE7hTD4sC5raqjSxy2fXyM+q1CwwVuy9KLFgDR6SFl zerrtika@zerrtika-mac - - - name: Grant passwordless sudo - ansible.builtin.copy: - dest: /etc/sudoers.d/zerrtika - content: "zerrtika ALL=(ALL) NOPASSWD:ALL\n" - owner: root - group: root - mode: '0440' - validate: visudo -cf %s - -- name: Re-apply SSH hardening (AllowUsers) - hosts: asxpio - become: true - vars: - ansible_host: "{{ wireguard_ip }}" - roles: - - ssh_hardening diff --git a/ansible/playbooks/05-swap.yaml b/ansible/playbooks/05-swap.yaml deleted file mode 100644 index cb514e2..0000000 --- a/ansible/playbooks/05-swap.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# Swapfile on the ops server (3.7 GB RAM, no swap): Forgejo, MinIO and the -# apps fit, but a spike would OOM-kill one of them instead of paging out. -# -# Usage: -# ansible-playbook playbooks/05-swap.yaml - -- name: Configure swap - hosts: ops_servers - become: true - roles: - - swap diff --git a/ansible/playbooks/wireguard-configs/.gitignore b/ansible/playbooks/wireguard-configs/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/ansible/playbooks/wireguard-configs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/ansible/roles/acme_forward/tasks/main.yaml b/ansible/roles/acme_forward/tasks/main.yaml deleted file mode 100644 index a740abc..0000000 --- a/ansible/roles/acme_forward/tasks/main.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# Port 80 on asxpio-services exists only for Let's Encrypt: HTTP challenges -# for names pointing here (xmpp., conference.) go to Traefik on ops, which -# holds the certificates. Anything else gets a 404. -- name: Deploy the ACME challenge forwarder - ansible.builtin.include_role: - name: docker_service - vars: - service_name: acme-forward - service_base_path: "{{ services_base_path }}/acme-forward" - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: nginx.conf.j2, dest: nginx.conf } - health_check_port: 80 diff --git a/ansible/roles/acme_forward/templates/docker-compose.yml.j2 b/ansible/roles/acme_forward/templates/docker-compose.yml.j2 deleted file mode 100644 index 9f1a070..0000000 --- a/ansible/roles/acme_forward/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,11 +0,0 @@ -# Managed by Ansible (role acme_forward). -services: - acme-forward: - image: nginx:{{ acme_forward_nginx_version }} - container_name: acme-forward - ports: - - "80:80" - volumes: - - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro - restart: unless-stopped - mem_limit: 32m diff --git a/ansible/roles/acme_forward/templates/nginx.conf.j2 b/ansible/roles/acme_forward/templates/nginx.conf.j2 deleted file mode 100644 index dfc79be..0000000 --- a/ansible/roles/acme_forward/templates/nginx.conf.j2 +++ /dev/null @@ -1,16 +0,0 @@ -# Managed by Ansible (role acme_forward). -server { - listen 80 default_server; - listen [::]:80 default_server; - server_tokens off; - access_log off; - - location /.well-known/acme-challenge/ { - proxy_pass http://{{ asxpio_ops_vpc_ip }}; - proxy_set_header Host $host; - } - - location / { - return 404; - } -} diff --git a/ansible/roles/base/defaults/main.yaml b/ansible/roles/base/defaults/main.yaml deleted file mode 100644 index 1ff96d5..0000000 --- a/ansible/roles/base/defaults/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -journald_max_use: 500M -# Weekly cleanup of images no container uses; every deploy leaves one behind -docker_prune_schedule: "0 3 * * 1" diff --git a/ansible/roles/base/files/20auto-upgrades b/ansible/roles/base/files/20auto-upgrades deleted file mode 100644 index 8d6d7c8..0000000 --- a/ansible/roles/base/files/20auto-upgrades +++ /dev/null @@ -1,2 +0,0 @@ -APT::Periodic::Update-Package-Lists "1"; -APT::Periodic::Unattended-Upgrade "1"; diff --git a/ansible/roles/base/files/daemon.json b/ansible/roles/base/files/daemon.json deleted file mode 100644 index a611855..0000000 --- a/ansible/roles/base/files/daemon.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "live-restore": true, - "storage-driver": "overlay2", - "log-opts": { - "max-size": "20m" - } -} diff --git a/ansible/roles/base/handlers/main.yaml b/ansible/roles/base/handlers/main.yaml deleted file mode 100644 index 5700f82..0000000 --- a/ansible/roles/base/handlers/main.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Restart journald - ansible.builtin.systemd: - name: systemd-journald - state: restarted - -# live-restore is on, so containers keep running across this restart -- name: Restart docker - ansible.builtin.systemd: - name: docker - state: restarted - daemon_reload: true diff --git a/ansible/roles/base/tasks/main.yaml b/ansible/roles/base/tasks/main.yaml deleted file mode 100644 index f00be75..0000000 --- a/ansible/roles/base/tasks/main.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Host baseline shared by both servers. Users, Docker itself and the -# first-boot packages come from terraform/cloud-init; SSH and WireGuard -# have their own bootstrap playbooks. - -- name: Install baseline packages - ansible.builtin.apt: - name: - - unattended-upgrades - - fail2ban - state: present - -- name: Enable unattended security upgrades - ansible.builtin.copy: - src: 20auto-upgrades - dest: /etc/apt/apt.conf.d/20auto-upgrades - mode: "0644" - -- name: Keep fail2ban running (sshd jail from the Debian defaults) - ansible.builtin.systemd: - name: fail2ban - enabled: true - state: started - -- name: Create journald drop-in directory - ansible.builtin.file: - path: /etc/systemd/journald.conf.d - state: directory - mode: "0755" - -- name: Cap the journal size - ansible.builtin.copy: - dest: /etc/systemd/journald.conf.d/size.conf - content: | - [Journal] - SystemMaxUse={{ journald_max_use }} - mode: "0644" - notify: Restart journald - -- name: Configure the Docker daemon - ansible.builtin.copy: - src: daemon.json - dest: /etc/docker/daemon.json - mode: "0644" - notify: Restart docker - -# dockerd must only listen on its unix socket. A drop-in once added -# -H tcp://:2375, which gave every container on the private -# network unauthenticated root on this host. -- name: Remove any Docker systemd override - ansible.builtin.file: - path: /etc/systemd/system/docker.service.d/override.conf - state: absent - notify: Restart docker - -- name: Prune unused Docker images weekly - ansible.builtin.copy: - dest: /etc/cron.d/docker-image-prune - content: | - {{ docker_prune_schedule }} root docker image prune -af > /var/log/docker-prune.log 2>&1 - mode: "0644" diff --git a/ansible/roles/crawler_alert/defaults/main.yaml b/ansible/roles/crawler_alert/defaults/main.yaml deleted file mode 100644 index 72040b6..0000000 --- a/ansible/roles/crawler_alert/defaults/main.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Daily/weekly AI-crawler report for the Forgejo router, mailed through -# Forgejo's own SMTP settings. Source and docs: -# https://git.asxp.io/asxpi/traefik-crawlers-statistics -crawler_recipient: "{{ vault_crawler_recipient }}" -crawler_site: git.asxp.io -crawler_threshold: 100000 -crawler_robots_url: https://git.czsk.it/robots.txt diff --git a/ansible/roles/crawler_alert/files/crawler-alert.py b/ansible/roles/crawler_alert/files/crawler-alert.py deleted file mode 100644 index 5bca6a8..0000000 --- a/ansible/roles/crawler_alert/files/crawler-alert.py +++ /dev/null @@ -1,878 +0,0 @@ -#!/usr/bin/env python3 -"""Crawler watch for a Traefik-fronted Forgejo (or any Traefik site). - -Separates real AI crawlers from traffic that only claims to be, by -checking the source IP against each vendor's published range list. - -Modes: - (default) daily threshold alert: mail only if yesterday exceeded - CRAWLER_THRESHOLD requests - --weekly summary: always mail stats for the past 7 days - --dry-run print instead of mailing (combinable with --weekly) - -Configuration is by environment variable; see README.md. The only -value with no sensible default is CRAWLER_RECIPIENT. -""" -import configparser, glob, gzip, ipaddress, json, os, re, smtplib, socket, subprocess, sys, urllib.request -from collections import Counter -from datetime import date, timedelta -from email.mime.text import MIMEText - -# --- configuration ------------------------------------------------------ -THRESHOLD = int(os.environ.get("CRAWLER_THRESHOLD", "100000")) -RECIPIENT = os.environ.get("CRAWLER_RECIPIENT", "") -SITE = os.environ.get("CRAWLER_SITE", "this site") -LOG_GLOB = os.environ.get("CRAWLER_LOG", "/var/log/traefik/access.log*") -# Traefik router name to filter on, e.g. "forgejo@docker". Empty = all -# traffic reaching Traefik, which is what you want for a single-site host. -ROUTER = os.environ.get("CRAWLER_ROUTER", "") -# Container to read SMTP settings from (Forgejo/Gitea app.ini [mailer]). -# Set CRAWLER_SMTP_* instead to configure SMTP directly. -MAIL_CONTAINER = os.environ.get("CRAWLER_MAIL_CONTAINER", "forgejo") -MAIL_INI = os.environ.get("CRAWLER_MAIL_INI", "/data/gitea/conf/app.ini") - -WEEKLY = "--weekly" in sys.argv -DRY = "--dry-run" in sys.argv - -if not RECIPIENT and not DRY: - sys.exit("CRAWLER_RECIPIENT is not set (no --dry-run either); refusing " - "to run. See README.md.") - -# --- verified-crawler support ------------------------------------------- -# Vendors publishing machine-readable IP ranges. A UA token alone proves -# nothing: on the instance this was written for, ~83% of AI-bot-labelled -# traffic came from hosts outside these ranges. Only IP-verified hits count. -RANGE_SOURCES = { - "openai": ["https://openai.com/chatgpt-user.json", - "https://openai.com/gptbot.json", - "https://openai.com/searchbot.json"], - "anthropic": ["https://claude.com/crawling/bots.json"], - "perplexity":["https://www.perplexity.ai/perplexitybot.json"], - "apple": ["https://search.developer.apple.com/applebot.json"], - "google": ["https://developers.google.com/static/crawling/ipranges/special-crawlers.json", - "https://developers.google.com/static/crawling/ipranges/common-crawlers.json", - "https://developers.google.com/static/crawling/ipranges/user-triggered-fetchers.json", - "https://developers.google.com/static/crawling/ipranges/user-triggered-fetchers-google.json"], -} -# UA token -> vendor whose ranges must contain the source IP -BOT_VENDOR = { - "ChatGPT-User": "openai", "GPTBot": "openai", "OAI-SearchBot": "openai", - "ClaudeBot": "anthropic", "Claude-User": "anthropic", "Claude-SearchBot": "anthropic", - "PerplexityBot": "perplexity", "Perplexity-User": "perplexity", - "Applebot-Extended": "apple", "Applebot": "apple", - "Googlebot": "google", "Google-Extended": "google", "GoogleOther": "google", -} - -# --- reverse-DNS verification ------------------------------------------- -# For vendors that publish no IP ranges. The check is forward-confirmed -# (FCrDNS): PTR of the address must end in one of the vendor's domains, -# AND that hostname must resolve back to the same address. The forward -# step is what makes it meaningful - a PTR record alone is set by -# whoever controls the address block, so it proves nothing on its own. -BOT_RDNS = { - "Amazonbot": (".crawl.amazonbot.amazon",), - "meta-externalagent": (".facebook.com", ".fbsv.net"), - "meta-externalfetcher": (".facebook.com", ".fbsv.net"), - "FacebookBot": (".facebook.com", ".fbsv.net"), - "YouBot": (".search.you.com",), - "Bytespider": (".bytedance.com", ".byteoversea.com"), - "PetalBot": (".petalsearch.com", ".aspiegel.com"), - "DuckAssistBot": (".duckduckgo.com",), - # Apple and Google publish ranges, but also answer rDNS; listed so a - # range miss can still be resolved when the published file is stale. - "Applebot": (".applebot.apple.com",), - "Googlebot": (".googlebot.com", ".google.com"), -} -# rDNS is slow (two lookups per address), so only unique IPs are probed -# and results are memoised for the run. -RDNS_MAX = int(os.environ.get("CRAWLER_RDNS_MAX", "400")) -RDNS_ENABLE = os.environ.get("CRAWLER_RDNS", "1") != "0" - -# --- ASN verification, for single-tenant networks only ------------------- -# An ASN match usually proves nothing: genuine YouBot and genuine -# Amazonbot both live in AS14618, which is also every EC2 instance a -# spoofer could rent. It is only evidence when the ASN belongs to the -# vendor exclusively and sells no compute in it. Meta qualifies - -# AS32934 is Meta's own network and cannot be rented - and Meta -# publishes no IP range file (their docs say to email webmasters@meta.com), -# so without this there is nothing to check them against at all. -BOT_ASN = { - "meta-externalagent": {"32934"}, - "meta-externalfetcher": {"32934"}, - "FacebookBot": {"32934"}, - "facebookexternalhit": {"32934"}, -} -ASN_ENABLE = os.environ.get("CRAWLER_ASN", "1") != "0" -# Team Cymru's DNS interface: .origin[6].asn.cymru.com TXT -CYMRU4 = "origin.asn.cymru.com" -CYMRU6 = "origin6.asn.cymru.com" -# robots.txt to audit verified crawlers against. Fetched once per run; -# empty or unreachable simply skips the compliance check. -ROBOTS_URL = os.environ.get("CRAWLER_ROBOTS", "") -CACHE = os.environ.get("CRAWLER_CACHE", "/var/cache/crawler-alert/ranges.json") -CF_URL = "https://www.cloudflare.com/ips-v4" -# claude.com and cloudflare.com sit behind Cloudflare, which 403s the -# default Python-urllib UA. Send a real one. -UA = "Mozilla/5.0 (compatible; crawler-alert/1.0; +https://codeberg.org/)" - - -def fetch(url, timeout=20): - req = urllib.request.Request(url, headers={"User-Agent": UA}) - with urllib.request.urlopen(req, timeout=timeout) as r: - return r.read() - - -def load_ranges(): - """Fetch vendor prefixes; fall back to cache so a vendor outage - degrades the report instead of breaking the mail.""" - out, stale = {}, [] - for vendor, urls in RANGE_SOURCES.items(): - nets = [] - for u in urls: - try: - for p in json.loads(fetch(u)).get("prefixes", []): - for k, v in p.items(): - if k.startswith("ipv"): - nets.append(v) - except Exception: - stale.append(vendor) - if nets: - out[vendor] = nets - cf = [] - try: - cf = [l.strip() for l in fetch(CF_URL).decode().splitlines() if l.strip()] - except Exception: - stale.append("cloudflare") - try: - cached = json.load(open(CACHE)) - except Exception: - cached = {} - for vendor in RANGE_SOURCES: - if vendor not in out and vendor in cached.get("vendors", {}): - out[vendor] = cached["vendors"][vendor] - if not cf: - cf = cached.get("cloudflare", []) - if out: - try: - os.makedirs(os.path.dirname(CACHE), exist_ok=True) - json.dump({"vendors": out, "cloudflare": cf}, open(CACHE, "w")) - except Exception: - pass - # bucket by first octet so lookups stay cheap over ~1425 prefixes - idx = {} - for vendor, nets in out.items(): - b = {} - for s in nets: - n = ipaddress.ip_network(s) - b.setdefault(int(n.network_address) >> 24 if n.version == 4 else -1, []).append(n) - idx[vendor] = b - cfnets = [ipaddress.ip_network(s) for s in cf] - return idx, cfnets, sorted(set(stale)) - - -def in_index(idx_v, addr): - if idx_v is None: - return False - key = int(addr) >> 24 if addr.version == 4 else -1 - return any(addr in n for n in idx_v.get(key, [])) - - -def load_robots(): - """Disallow patterns from robots.txt, as (prefix, contains) pairs. - - Only the `User-agent: *` group is read: the point is to audit what - well-behaved crawlers were asked not to fetch, not to model every - per-agent rule. Returns [] when unset or unreachable, which disables - the compliance check rather than reporting false violations. - """ - if not ROBOTS_URL: - return [] - try: - txt = fetch(ROBOTS_URL, timeout=15).decode("utf-8", "replace") - except Exception: - return [] - rules, in_star = [], False - for line in txt.splitlines(): - line = line.split("#")[0].strip() - if not line: - continue - k, _, v = line.partition(":") - k, v = k.strip().lower(), v.strip() - if k == "user-agent": - in_star = (v == "*") - elif k == "disallow" and in_star and v: - # Forgejo-style /*/*/thing/ means "contains /thing/". - if v.startswith("/*"): - rules.append(("", v.lstrip("/*"))) - else: - rules.append((v.rstrip("*"), "")) - return rules - - -def robots_blocked(path, rules): - for prefix, contains in rules: - if prefix and path.startswith(prefix): - return True - if contains and contains in path: - return True - return False - - -_asn_cache = {} - - -def asn_of(ip): - """Origin ASN for an address via Team Cymru's DNS interface. - - Returns the ASN as a string, or "" if it cannot be determined. - Needs `dig`; absence degrades to no ASN evidence, never an error. - """ - if ip in _asn_cache: - return _asn_cache[ip] - asn = "" - try: - a = ipaddress.ip_address(ip) - if a.version == 4: - q = ".".join(reversed(ip.split("."))) + "." + CYMRU4 - else: - nibbles = a.exploded.replace(":", "") - q = ".".join(reversed(nibbles)) + "." + CYMRU6 - out = subprocess.run(["dig", "+short", "+time=3", "+tries=1", q, "TXT"], - capture_output=True, text=True, timeout=12).stdout - # "32934 | 2a03:2880:f814::/48 | IE | ripencc | 2011-08-22" - first = out.strip().strip('"').split("|")[0].strip() - if first.split(" ")[0].isdigit(): - asn = first.split(" ")[0] - except (OSError, ValueError, subprocess.SubprocessError): - pass - _asn_cache[ip] = asn - return asn - - -_rdns_cache = {} - - -def fcrdns(ip, suffixes): - """Forward-confirmed reverse DNS. - - PTR must end in one of `suffixes`, and the name it gives must resolve - back to `ip`. Returns (ok, hostname). Without the forward step this - would only prove the address owner can write their own PTR record. - """ - key = (ip, suffixes) - if key in _rdns_cache: - return _rdns_cache[key] - result = (False, "", "mismatch") - try: - host = socket.gethostbyaddr(ip)[0].rstrip(".").lower() - if any(host.endswith(s) or host == s.lstrip(".") for s in suffixes): - _, _, addrs = socket.gethostbyname_ex(host) - try: - v6 = socket.getaddrinfo(host, None, socket.AF_INET6) - addrs = addrs + [a[4][0] for a in v6] - except OSError: - pass - if ip in addrs: - result = (True, host, "ok") - else: - result = (False, host, "mismatch") - else: - result = (False, host, "mismatch") - except OSError: - # No PTR at all. This is absence of evidence, not evidence of - # forgery: Meta's IPv6 crawler space, for one, publishes no PTR - # records. Kept distinct so a real mismatch stays visible. - result = (False, "", "no-ptr") - _rdns_cache[key] = result - return result - -# --- --metrics: Prometheus counters for Grafana -------------------------- -# Run every few minutes from a timer. Reads only what the live log gained -# since the last run (byte offset + inode in a state file, so rotation and -# truncation restart at 0), classifies each request the same way as the -# weekly report, and writes cumulative counters to node_exporter's -# textfile directory. Verdicts per (bot, IP) are cached for a week, so DNS -# is only asked about addresses it hasn't seen. -METRICS = "--metrics" in sys.argv -TEXTFILE = os.environ.get("CRAWLER_TEXTFILE", "/var/lib/node_exporter/textfile/crawler.prom") -STATE = os.environ.get("CRAWLER_STATE", "/var/cache/crawler-alert/metrics.json") -LIVE_LOG = os.environ.get("CRAWLER_LIVE_LOG", sorted(glob.glob(LOG_GLOB) or [""])[0]) -ALL_BOTS = sorted(set(BOT_VENDOR) | set(BOT_RDNS) | set(BOT_ASN), key=len, reverse=True) -GENERIC_BOT = re.compile(r"bot|crawler|spider|scrapy|externalagent", re.I) -UA_RE = re.compile(r"\"[^\"]*\" \"([^\"]*)\" \d+ \"") -# The mail reports watch one router (Forgejo); the dashboard wants them all. -METRICS_ROUTER = os.environ.get("CRAWLER_METRICS_ROUTER", ROUTER) - - -def vendor_of(bot): - if bot in BOT_VENDOR: - return BOT_VENDOR[bot] - if bot in BOT_ASN: - return "meta" - return bot.lower() - - -def index_ranges(vendors, cf): - idx = {} - for vendor, nets in vendors.items(): - b = {} - for s in nets: - n = ipaddress.ip_network(s) - b.setdefault(int(n.network_address) >> 24 if n.version == 4 else -1, []).append(n) - idx[vendor] = b - return idx, [ipaddress.ip_network(s) for s in cf] - - -def cached_ranges(max_age=86400): - """Range files change rarely: refetch once a day, not every run.""" - import time - try: - if time.time() - os.path.getmtime(CACHE) < max_age: - c = json.load(open(CACHE)) - return index_ranges(c["vendors"], c.get("cloudflare", [])) - except Exception: - pass - idx, cf, _stale = load_ranges() - return idx, cf - - -def judge(bot, ip, ranges, cfnets, cache, budget): - """verified | spoofed | proxied | private | unknown, like the report: - IP ranges first, then forward-confirmed rDNS, then single-tenant ASN.""" - try: - addr = ipaddress.ip_address(ip) - except ValueError: - return "unknown" - if addr.is_private: - return "private" - if any(addr in n for n in cfnets): - return "proxied" - if bot in BOT_VENDOR and in_index(ranges.get(BOT_VENDOR[bot]), addr): - return "verified" - if bot not in BOT_RDNS and bot not in BOT_ASN: - return "spoofed" # range-only vendor, address outside ranges - key = f"{bot}|{ip}" - if key in cache: - return cache[key][0] - if budget[0] <= 0: - return "unknown" # over this run's DNS budget; retried next run - budget[0] -= 1 - v = "unknown" - ok, why = False, "no-ptr" - if bot in BOT_RDNS: - ok, _host, why = fcrdns(ip, BOT_RDNS[bot]) - if ok: - v = "verified" - elif why == "no-ptr": - if ASN_ENABLE and bot in BOT_ASN and asn_of(ip) in BOT_ASN[bot]: - v = "verified" - else: - v = "spoofed" # a PTR exists and points elsewhere - cache[key] = [v, int(date.today().toordinal())] - return v - - -def run_metrics(): - try: - st = json.load(open(STATE)) - except Exception: - st = {} - counts = Counter(st.get("counts", {})) - cache = {k: v for k, v in st.get("verdicts", {}).items() - if v[1] > date.today().toordinal() - 7} - try: - fs = os.stat(LIVE_LOG) - except OSError: - sys.exit(f"cannot read {LIVE_LOG}") - if "inode" not in st: - offset = fs.st_size # first run: start at the end, not the backlog - elif st["inode"] != fs.st_ino or fs.st_size < st.get("offset", 0): - offset = 0 # rotated or truncated - else: - offset = st["offset"] - ranges, cfnets = cached_ranges() - socket.setdefaulttimeout(3) - budget = [RDNS_MAX] - with open(LIVE_LOG, "rb") as f: - f.seek(offset) - for raw in f: - if not raw.endswith(b"\n"): - break # half-written line: take it next run - offset += len(raw) - line = raw.decode("utf-8", "replace") - if METRICS_ROUTER and METRICS_ROUTER not in line: - continue - parts = line.split() - counts["requests"] += 1 - m = UA_RE.search(line) - u = m.group(1) if m else "-" - bot = next((b for b in ALL_BOTS if b in u), None) - if bot: - v = judge(bot, parts[0], ranges, cfnets, cache, budget) - counts[f"ai|{vendor_of(bot)}|{bot}|{v}"] += 1 - if v == "verified" and len(parts) > 9 and parts[9].isdigit(): - counts[f"bytes|{vendor_of(bot)}"] += int(parts[9]) - elif u == "-": - counts["class|none"] += 1 - elif GENERIC_BOT.search(u): - counts["class|other-bot"] += 1 - else: - counts["class|browser-like"] += 1 - if len(cache) > 50000: # keep the newest verdicts only - cache = dict(sorted(cache.items(), key=lambda kv: kv[1][1])[-50000:]) - os.makedirs(os.path.dirname(STATE), exist_ok=True) - json.dump({"inode": fs.st_ino, "offset": offset, "counts": counts, - "verdicts": cache}, open(STATE + ".tmp", "w")) - os.replace(STATE + ".tmp", STATE) - - out = ["# HELP crawler_requests_total Requests seen in the Traefik access log.", - "# TYPE crawler_requests_total counter", - f"crawler_requests_total {counts['requests']}", - "# HELP crawler_class_requests_total Requests without an AI-bot user agent, by user-agent class.", - "# TYPE crawler_class_requests_total counter"] - for k, c in sorted(counts.items()): - if k.startswith("class|"): - out.append(f'crawler_class_requests_total{{class="{k[6:]}"}} {c}') - out += ["# HELP crawler_ai_requests_total Requests claiming an AI-bot user agent, by verification verdict.", - "# TYPE crawler_ai_requests_total counter"] - for k, c in sorted(counts.items()): - if k.startswith("ai|"): - _, vendor, bot, v = k.split("|") - out.append(f'crawler_ai_requests_total{{vendor="{vendor}",bot="{bot}",verdict="{v}"}} {c}') - out += ["# HELP crawler_ai_verified_bytes_total Bytes served to verified AI crawlers.", - "# TYPE crawler_ai_verified_bytes_total counter"] - for k, c in sorted(counts.items()): - if k.startswith("bytes|"): - out.append(f'crawler_ai_verified_bytes_total{{vendor="{k[6:]}"}} {c}') - import time - out += ["# HELP crawler_metrics_last_run_timestamp_seconds Last successful --metrics run.", - "# TYPE crawler_metrics_last_run_timestamp_seconds gauge", - f"crawler_metrics_last_run_timestamp_seconds {int(time.time())}"] - with open(TEXTFILE + ".tmp", "w") as f: - f.write("\n".join(out) + "\n") - os.replace(TEXTFILE + ".tmp", TEXTFILE) - - -if METRICS: - run_metrics() - sys.exit(0) - -days = [date.today() - timedelta(days=i) for i in range(7 if WEEKLY else 1, 0, -1)] -stamps = [d.strftime("%d/%b/%Y") for d in days] - -RANGES, CFNETS, STALE = (load_ranges() if WEEKLY else ({}, [], [])) - -per_day = {s: [0, set()] for s in stamps} -repos = Counter() -uas = Counter() -verified = Counter() # bot -> IP-verified hits -spoofed = Counter() # bot -> UA claimed, IP outside vendor ranges -proxied = Counter() # bot -> arrived via Cloudflare, unverifiable -ver_paths = Counter() # paths fetched by verified bots -ver_ips = {} # bot -> set of verified source IPs -# What the verified crawlers actually did, once confirmed: status mix, -# bytes served, and any path robots.txt asked them not to fetch. -ver_status = Counter() -ver_bytes = [0] -ver_violations = Counter() # path -> hits, robots.txt disallowed -ver_bot_bytes = Counter() # bot -> bytes served -# Repository *content* fetched by verified crawlers, as opposed to -# policy files and chrome. This is the question a permissive robots.txt -# is asking: now that they may read the code, do they? Counting top -# paths cannot answer it - robots.txt and sitemap.xml drown everything. -ver_content = Counter() # bot -> content hits -ver_content_paths = Counter() -CONTENT_RE = re.compile(r"/(src|raw|commit|commits|media|blame|archive|compare)/") -# Which repositories each vendor is actually interested in. -ver_repos = {} # bot -> Counter(owner/repo) -ver_pkgs = Counter() # "type/name" -> hits, registry artifacts -ver_pkg_index = Counter() # owner -> hits on the bare package index -# Forge paths are /owner/repo/...; these first segments are not owners, -# and a two-segment path like /pix/photo.jpg on another vhost is a file, -# not a repository - hence the extension check. -NOT_OWNER = {"assets", "fonts", "explore", "user", "api", "avatars", - "repo-avatars", "swagger.v1.json", "attachments", "notifications", - "issues", "pulls", "milestones", "admin", "org", "repo", "login", - "-", "favicon.ico", "robots.txt", "sitemap.xml", "pix", "static"} - - -# Container/package registry: /{owner}/-/packages/{type}/{name}[/{version}] -# Worth counting separately from repositories - it says which published -# artifacts crawlers are indexing, not which source they are reading. -PKG_RE = re.compile(r"^/([^/]+)/-/packages(?:/([^/?]+)/([^/?]+))?") - - -def package_of(path): - """(owner, 'type/name') for a registry path, else None. Bare - /owner/-/packages (the index) returns name None.""" - m = PKG_RE.match(path.split("?")[0]) - if not m: - return None - owner, ptype, name = m.group(1), m.group(2), m.group(3) - return (owner, f"{ptype}/{name}" if ptype and name else None) - - -def repo_of(path): - """owner/repo for a forge path, else None.""" - seg = path.lstrip("/").split("?")[0].split("/") - if len(seg) < 2 or not seg[0] or not seg[1]: - return None - if seg[0].lower() in NOT_OWNER or seg[1].lower() in NOT_OWNER: - return None - if "." in seg[1] and len(seg) == 2: # /pix/photo.jpg -> a file - return None - return f"{seg[0]}/{seg[1]}" -# rDNS-verified vendors: {bot: {ip: hits}}, resolved after the log pass -rdns_hits = {b: Counter() for b in BOT_RDNS} -rdns_proxied = Counter() -# {bot: {ip: Counter(path)}} - kept so that once an address is confirmed -# by DNS/ASN its paths can join the verified-path breakdown, which -# otherwise only ever showed IP-range-verified vendors. -rdns_paths = {b: {} for b in BOT_RDNS} -ROBOTS_RULES = load_robots() if WEEKLY else [] - - -def record_verified(bot, path, status, nbytes): - """Log what a confirmed crawler did. Called only after verification, - so these counters describe legitimate traffic and nothing else.""" - ver_paths[path] += 1 - ver_status[status] += 1 - ver_bytes[0] += nbytes - ver_bot_bytes[bot] += nbytes - if CONTENT_RE.search(path): - ver_content[bot] += 1 - ver_content_paths[path] += 1 - pkg = package_of(path) - if pkg: - owner, name = pkg - if name: - ver_pkgs[f"{owner}/{name}"] += 1 - else: - ver_pkg_index[owner] += 1 - r = repo_of(path) - if r: - ver_repos.setdefault(bot, Counter())[r] += 1 - if ROBOTS_RULES and robots_blocked(path, ROBOTS_RULES): - ver_violations[path] += 1 - - -for path in sorted(glob.glob(LOG_GLOB)): - opener = gzip.open if path.endswith(".gz") else open - with opener(path, "rt", errors="replace") as f: - for line in f: - if ROUTER and ROUTER not in line: - continue - for s in stamps: - if s in line: - per_day[s][0] += 1 - per_day[s][1].add(line.split(" ", 1)[0]) - parts = line.split() - if len(parts) > 6 and parts[6].count("/") >= 2: - repos["/".join(parts[6].split("/")[1:3])] += 1 - # Traefik CLF: ... "" "" "" ... - # Anchor on the request counter so this works whatever - # the router is called. - ua = re.search(r"\"[^\"]*\" \"([^\"]*)\" \d+ \"", line) - if ua: - u = ua.group(1) - m = re.search(r"(bot|crawler|spider|scrapy|externalagent|gpt|claude|perplexity)[\w./-]*", u, re.I) - uas[m.group(0) if m else ("(none)" if u == "-" else "(browser-like)")] += 1 - if WEEKLY: - # longest token first so Applebot-Extended wins over Applebot - bot = next((b for b in sorted(BOT_VENDOR, key=len, reverse=True) if b in u), None) - if bot: - try: - addr = ipaddress.ip_address(parts[0]) - except ValueError: - addr = None - if addr is None: - pass - elif any(addr in n for n in CFNETS): - proxied[bot] += 1 - elif in_index(RANGES.get(BOT_VENDOR[bot]), addr): - verified[bot] += 1 - ver_ips.setdefault(bot, set()).add(parts[0]) - if len(parts) > 9: - record_verified( - bot, parts[6][:60], parts[8], - int(parts[9]) if parts[9].isdigit() else 0) - else: - spoofed[bot] += 1 - if WEEKLY and RDNS_ENABLE: - rb = next((b for b in sorted(BOT_RDNS, key=len, reverse=True) - if b in u), None) - # skip if already counted by IP-range check - if rb and not (rb in BOT_VENDOR and rb == bot): - try: - a2 = ipaddress.ip_address(parts[0]) - except ValueError: - a2 = None - if a2 is None: - pass - elif any(a2 in n for n in CFNETS): - rdns_proxied[rb] += 1 - else: - rdns_hits[rb][parts[0]] += 1 - if len(parts) > 9 and not a2.is_private: - rdns_paths[rb].setdefault(parts[0], []).append( - (parts[6][:60], parts[8], - int(parts[9]) if parts[9].isdigit() else 0)) - break - -total = sum(v[0] for v in per_day.values()) -all_ips = set().union(*(v[1] for v in per_day.values())) - -# --- resolve rDNS candidates --------------------------------------------- -# One pass over unique addresses, busiest first, capped by RDNS_MAX so a -# flood of distinct forgeries cannot stall the report on DNS timeouts. -rdns_ok = Counter() # bot -> forward-confirmed by PTR -rdns_mismatch = Counter() # bot -> PTR exists but points elsewhere: forgery -rdns_noptr = Counter() # bot -> no PTR at all: cannot be judged by DNS -rdns_asn = Counter() # bot -> no PTR, but origin ASN is the vendor's -rdns_skipped = Counter() # bot -> hits left unresolved by the cap -rdns_private = Counter() # bot -> hits from RFC1918/loopback (see below) -rdns_ok_ips = {} -if WEEKLY and RDNS_ENABLE: - socket.setdefaulttimeout(3) - for bot, counter in rdns_hits.items(): - budget = RDNS_MAX - for ip, hits in counter.most_common(): - # A private source address means the real client IP never - # reached the log: something in front (Docker's bridge - # gateway, a local proxy) is rewriting it. Neither verified - # nor spoofed - the evidence simply is not there. - if ipaddress.ip_address(ip).is_private: - rdns_private[bot] += hits - continue - if budget <= 0: - rdns_skipped[bot] += hits - continue - budget -= 1 - ok, _host, why = fcrdns(ip, BOT_RDNS[bot]) - confirmed = False - if ok: - rdns_ok[bot] += hits - rdns_ok_ips.setdefault(bot, set()).add(ip) - confirmed = True - elif why == "no-ptr": - # Fall back to ASN, but only for vendors whose network is - # single-tenant (see BOT_ASN). Otherwise leave it unknown. - if ASN_ENABLE and bot in BOT_ASN and asn_of(ip) in BOT_ASN[bot]: - rdns_asn[bot] += hits - rdns_ok_ips.setdefault(bot, set()).add(ip) - confirmed = True - else: - rdns_noptr[bot] += hits - else: - rdns_mismatch[bot] += hits - if confirmed: - for p, st, nb in rdns_paths.get(bot, {}).get(ip, ()): - record_verified(bot, p, st, nb) - socket.setdefaulttimeout(None) - -if not WEEKLY: - s0 = stamps[0] - count, ips = per_day[s0][0], len(per_day[s0][1]) - print(f"{s0}: {count} requests, {ips} unique IPs (threshold {THRESHOLD})") - if DRY or count <= THRESHOLD: - sys.exit(0) - subject = f"{SITE}: {count} requests on {s0} (over {THRESHOLD}/day threshold)" - body = (f"Forgejo served {count} requests from {ips} unique IPs on {s0} - " - f"above the {THRESHOLD}/day watch threshold.\n\n" - "Time to consider Anubis (PoW challenge) in front of Forgejo.\n") -else: - lines = [f"{SITE} weekly crawler report ({stamps[0]} - {stamps[-1]})", ""] - lines.append(f"Total: {total} requests, {len(all_ips)} unique IPs") - lines.append(f"Daily threshold alert fires above {THRESHOLD} req/day (none = quiet week)") - lines.append("") - lines.append("Per day:") - for s in stamps: - lines.append(f" {s}: {per_day[s][0]:>7} requests, {len(per_day[s][1]):>6} unique IPs") - lines.append("") - lines.append("Top repos:") - for r, c in repos.most_common(5): - lines.append(f" {c:>7} {r}") - lines.append("") - lines.append("User-agent classes (browser-like = mostly the spoofing swarm):") - for u, c in uas.most_common(8): - lines.append(f" {c:>7} {u}") - lines.append("") - - # --- legitimate (IP-verified) crawlers ------------------------------- - lines.append("=" * 62) - lines.append("LEGITIMATE CRAWLERS (source IP inside vendor's published ranges)") - lines.append("=" * 62) - if STALE: - lines.append(f"NOTE: range fetch failed for {', '.join(STALE)} - used cache") - tv, ts, tp = sum(verified.values()), sum(spoofed.values()), sum(proxied.values()) - claimed = tv + ts + tp - if not claimed: - lines.append(" No AI-bot user-agents seen this week.") - else: - lines.append(f" {'bot':<20}{'verified':>9}{'spoofed':>9}{'via CF':>8} {'IPs':>4}") - for bot in sorted(set(verified) | set(spoofed) | set(proxied), - key=lambda b: -(verified[b] + spoofed[b] + proxied[b])): - lines.append(f" {bot:<20}{verified[bot]:>9}{spoofed[bot]:>9}" - f"{proxied[bot]:>8} {len(ver_ips.get(bot, ())):>4}") - pct = tv / claimed * 100 - lines.append("") - lines.append(f" {claimed} requests claimed an AI-bot identity; {tv} verified ({pct:.1f}%).") - lines.append(f" {ts} failed IP verification (spoofed). {tp} arrived via Cloudflare") - lines.append(" and cannot be verified by IP - not counted either way.") - # --- vendors verified by reverse DNS --------------------------------- - if RDNS_ENABLE and (rdns_ok or rdns_mismatch or rdns_noptr or rdns_asn - or rdns_proxied or rdns_private): - lines.append("") - lines.append("-" * 62) - lines.append("VERIFIED BY DNS / ASN (vendors publishing no IP ranges)") - lines.append("-" * 62) - lines.append(f" {'bot':<20}{'PTR ok':>7}{'ASN ok':>7}{'FORGED':>8}" - f"{'no-PTR':>7}{'CF':>6}{'priv':>7} {'IPs':>4}") - allbots = (set(rdns_ok) | set(rdns_mismatch) | set(rdns_noptr) - | set(rdns_asn) | set(rdns_proxied) | set(rdns_private)) - for bot in sorted(allbots, key=lambda b: -(rdns_ok[b] + rdns_mismatch[b] - + rdns_noptr[b] + rdns_asn[b] - + rdns_proxied[b] + rdns_private[b])): - lines.append(f" {bot:<20}{rdns_ok[bot]:>7}{rdns_asn[bot]:>7}" - f"{rdns_mismatch[bot]:>8}{rdns_noptr[bot]:>7}" - f"{rdns_proxied[bot]:>6}{rdns_private[bot]:>7}" - f" {len(rdns_ok_ips.get(bot, ())):>4}") - if rdns_skipped: - sk = ", ".join(f"{b} {c}" for b, c in rdns_skipped.most_common(4)) - lines.append(f" (unresolved, over CRAWLER_RDNS_MAX={RDNS_MAX}: {sk})") - lines.append("") - lines.append(" PTR ok forward-confirmed: PTR ends in a vendor domain AND") - lines.append(" that hostname resolves back to the same address.") - lines.append(" ASN ok no PTR, but the address sits in an ASN belonging") - lines.append(" solely to the vendor (Meta's AS32934). Only used") - lines.append(" where the ASN sells no compute - never for clouds.") - lines.append(" FORGED a PTR exists and points somewhere else. This is") - lines.append(" the only column that is evidence of forgery.") - lines.append(" no-PTR no PTR record and no usable ASN: unknown, not bad.") - if sum(rdns_private.values()): - lines.append(" priv logged source was RFC1918: a proxy or Docker") - lines.append(" bridge masked the client. Unjudgeable. See README.") - - # --- what the verified crawlers actually fetched --------------------- - # Last, because it spans both tables above: an address only counts here - # once it has been confirmed, whether by IP range, PTR or ASN. - if ver_paths: - lines.append("") - lines.append("=" * 62) - lines.append("WHAT THE VERIFIED CRAWLERS DID (all methods)") - lines.append("=" * 62) - tot_v = sum(ver_paths.values()) - mb = ver_bytes[0] / 1048576 - lines.append(f" {tot_v} requests, {mb:.1f} MB served.") - if ver_status: - mix = " ".join(f"{s}:{c}" for s, c in ver_status.most_common(6)) - lines.append(f" Status: {mix}") - if ver_bot_bytes: - top = " ".join(f"{b} {v/1048576:.1f}MB" - for b, v in ver_bot_bytes.most_common(4)) - lines.append(f" Bandwidth: {top}") - lines.append("") - if not ROBOTS_RULES: - lines.append(" robots.txt compliance: not checked " - "(set CRAWLER_ROBOTS to enable)") - elif ver_violations: - n = sum(ver_violations.values()) - lines.append(f" ROBOTS.TXT VIOLATIONS: {n} requests to disallowed paths") - for p, c in ver_violations.most_common(6): - lines.append(f" {c:>6} {p}") - lines.append(" A verified crawler ignoring robots.txt is a policy") - lines.append(" problem, not a security one - the identity is genuine.") - else: - lines.append(f" robots.txt compliance: clean, 0 violations in " - f"{tot_v} requests") - lines.append("") - # Repository content vs everything else. If robots.txt permits - # /src/ and /raw/, this is what says whether anyone took it up. - nc = sum(ver_content.values()) - pct_c = nc / tot_v * 100 if tot_v else 0 - lines.append(f" Repository content fetched: {nc} of {tot_v} requests " - f"({pct_c:.1f}%)") - if nc: - by_bot = " ".join(f"{b} {c}" for b, c in ver_content.most_common(5)) - lines.append(f" by: {by_bot}") - for p, c in ver_content_paths.most_common(8): - lines.append(f" {c:>6} {p}") - else: - lines.append(" none - crawlers indexed the site but read no code") - # Which repositories each vendor cares about. Grouped by vendor - # rather than by UA token: OpenAI alone sends three tokens, and - # "what is OpenAI reading" is the useful question. - if ver_repos: - groups = {} - for b, c in ver_repos.items(): - if b in BOT_VENDOR: - v = BOT_VENDOR[b] # openai, anthropic, ... - elif b in BOT_ASN: - v = "meta" - elif b in BOT_RDNS: - v = b.lower() # amazonbot, youbot, ... - else: - v = b.lower() - groups.setdefault(v, Counter()).update(c) - lines.append("") - lines.append(" Repositories by vendor:") - for v in sorted(groups, key=lambda x: -sum(groups[x].values())): - tot = sum(groups[v].values()) - top = ", ".join(f"{r} ({n})" for r, n in groups[v].most_common(3)) - lines.append(f" {v:<12} {tot:>5} hits {top}") - if ver_pkgs or ver_pkg_index: - np = sum(ver_pkgs.values()) + sum(ver_pkg_index.values()) - lines.append("") - lines.append(f" Package registry: {np} requests") - for p, c in ver_pkgs.most_common(6): - lines.append(f" {c:>6} {p}") - if ver_pkg_index: - idx = ", ".join(f"{o} ({n})" for o, n in ver_pkg_index.most_common(4)) - lines.append(f" index pages: {idx}") - lines.append("") - lines.append(" Top paths overall:") - for p, c in ver_paths.most_common(12): - lines.append(f" {c:>6} {p}") - body = "\n".join(lines) + "\n" - subject = f"{SITE} weekly crawler report: {total} requests, {len(all_ips)} IPs" - if DRY: - print(subject); print(); print(body) - sys.exit(0) - -# SMTP settings: use CRAWLER_SMTP_* if given, otherwise borrow them from -# a Forgejo/Gitea app.ini [mailer] section so there is no second copy of -# the credentials to keep in sync. -if os.environ.get("CRAWLER_SMTP_ADDR"): - addr = os.environ["CRAWLER_SMTP_ADDR"] - port = int(os.environ.get("CRAWLER_SMTP_PORT", "587")) - user = os.environ.get("CRAWLER_SMTP_USER", "") - passwd = os.environ.get("CRAWLER_SMTP_PASSWORD", "") - sender = os.environ.get("CRAWLER_SMTP_FROM", user or RECIPIENT) - proto = os.environ.get("CRAWLER_SMTP_PROTOCOL", "smtp+starttls") -else: - ini = subprocess.run(["docker", "exec", MAIL_CONTAINER, "cat", MAIL_INI], - capture_output=True, text=True).stdout - if not ini.strip(): - sys.exit(f"could not read {MAIL_INI} from container " - f"'{MAIL_CONTAINER}' and CRAWLER_SMTP_ADDR is unset") - cp = configparser.ConfigParser(interpolation=None, strict=False) - cp.read_string("[DEFAULT]\n" + ini) - m = cp["mailer"] - proto = m.get("PROTOCOL", "smtps").strip() - addr, port = m.get("SMTP_ADDR").strip(), int(m.get("SMTP_PORT", "465").strip()) - user, passwd = m.get("USER", "").strip(), m.get("PASSWD", "").strip().strip("`\"") - sender = m.get("FROM", user).strip() - -msg = MIMEText(body) -msg["Subject"], msg["From"], msg["To"] = subject, sender, RECIPIENT -if proto == "smtps": - s = smtplib.SMTP_SSL(addr, port, timeout=30) -else: - s = smtplib.SMTP(addr, port, timeout=30) - if proto != "smtp": # plain smtp = no TLS (local relay) - s.starttls() -if user: # unauthenticated local relays exist - s.login(user, passwd) -s.sendmail(sender, [RECIPIENT], msg.as_string()) -s.quit() -print(f"mailed to {RECIPIENT}") diff --git a/ansible/roles/crawler_alert/files/crawler-alert.service b/ansible/roles/crawler_alert/files/crawler-alert.service deleted file mode 100644 index 6df88b7..0000000 --- a/ansible/roles/crawler_alert/files/crawler-alert.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Daily crawler threshold alert -After=docker.service - -[Service] -Type=oneshot -EnvironmentFile=/etc/crawler-alert.env -ExecStart=/usr/local/bin/crawler-alert.py diff --git a/ansible/roles/crawler_alert/files/crawler-alert.timer b/ansible/roles/crawler_alert/files/crawler-alert.timer deleted file mode 100644 index 0b8b4f5..0000000 --- a/ansible/roles/crawler_alert/files/crawler-alert.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Daily Forgejo crawler volume check - -[Timer] -OnCalendar=*-*-* 00:15:00 -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/crawler_alert/files/crawler-metrics.service b/ansible/roles/crawler_alert/files/crawler-metrics.service deleted file mode 100644 index aad2da2..0000000 --- a/ansible/roles/crawler_alert/files/crawler-metrics.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Crawler counters for Prometheus (node_exporter textfile) -After=docker.service - -[Service] -Type=oneshot -EnvironmentFile=/etc/crawler-alert.env -# Every router, not only Forgejo's; fewer DNS lookups per 5-minute run -Environment=CRAWLER_METRICS_ROUTER= CRAWLER_RDNS_MAX=100 -ExecStart=/usr/local/bin/crawler-alert.py --metrics -Nice=10 -TimeoutStartSec=4min diff --git a/ansible/roles/crawler_alert/files/crawler-metrics.timer b/ansible/roles/crawler_alert/files/crawler-metrics.timer deleted file mode 100644 index 2b20a3e..0000000 --- a/ansible/roles/crawler_alert/files/crawler-metrics.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Crawler counters every 5 minutes - -[Timer] -OnCalendar=*:0/5 -RandomizedDelaySec=30 - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/crawler_alert/files/crawler-weekly.service b/ansible/roles/crawler_alert/files/crawler-weekly.service deleted file mode 100644 index ed9916f..0000000 --- a/ansible/roles/crawler_alert/files/crawler-weekly.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Weekly crawler report mail -After=docker.service - -[Service] -Type=oneshot -EnvironmentFile=/etc/crawler-alert.env -ExecStart=/usr/local/bin/crawler-alert.py --weekly diff --git a/ansible/roles/crawler_alert/files/crawler-weekly.timer b/ansible/roles/crawler_alert/files/crawler-weekly.timer deleted file mode 100644 index 2982024..0000000 --- a/ansible/roles/crawler_alert/files/crawler-weekly.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Weekly Forgejo crawler report, Mondays 12:00 UTC - -[Timer] -OnCalendar=Mon *-*-* 12:00:00 -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/crawler_alert/handlers/main.yaml b/ansible/roles/crawler_alert/handlers/main.yaml deleted file mode 100644 index c28484f..0000000 --- a/ansible/roles/crawler_alert/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Reload systemd - ansible.builtin.systemd: - daemon_reload: true diff --git a/ansible/roles/crawler_alert/tasks/main.yaml b/ansible/roles/crawler_alert/tasks/main.yaml deleted file mode 100644 index 590d871..0000000 --- a/ansible/roles/crawler_alert/tasks/main.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: Install crawler-alert script - ansible.builtin.copy: - src: crawler-alert.py - dest: /usr/local/bin/crawler-alert.py - mode: "0755" - -- name: Configure crawler-alert - ansible.builtin.template: - src: crawler-alert.env.j2 - dest: /etc/crawler-alert.env - mode: "0600" - diff: false - -- name: Install crawler-alert units - ansible.builtin.copy: - src: "{{ item }}" - dest: "/etc/systemd/system/{{ item }}" - mode: "0644" - loop: - - crawler-alert.service - - crawler-alert.timer - - crawler-weekly.service - - crawler-weekly.timer - - crawler-metrics.service - - crawler-metrics.timer - notify: Reload systemd - -- name: Flush handlers - ansible.builtin.meta: flush_handlers - -- name: Enable crawler-alert timers - ansible.builtin.systemd: - name: "{{ item }}" - enabled: true - state: started - loop: - - crawler-alert.timer - - crawler-weekly.timer - - crawler-metrics.timer - # A dry run installs no new unit files, so a new timer can't be found yet - ignore_errors: "{{ ansible_check_mode }}" diff --git a/ansible/roles/crawler_alert/templates/crawler-alert.env.j2 b/ansible/roles/crawler_alert/templates/crawler-alert.env.j2 deleted file mode 100644 index a7186be..0000000 --- a/ansible/roles/crawler_alert/templates/crawler-alert.env.j2 +++ /dev/null @@ -1,10 +0,0 @@ -CRAWLER_RECIPIENT={{ crawler_recipient }} -CRAWLER_SITE={{ crawler_site }} -CRAWLER_LOG=/opt/traefik/logs/access.log* -CRAWLER_ROUTER=forgejo@docker -CRAWLER_THRESHOLD={{ crawler_threshold }} -CRAWLER_MAIL_CONTAINER=forgejo -CRAWLER_MAIL_INI=/data/gitea/conf/app.ini -CRAWLER_ROBOTS={{ crawler_robots_url }} -CRAWLER_LIVE_LOG=/opt/traefik/logs/access.log -CRAWLER_TEXTFILE={{ monitoring_textfile_dir }}/crawler.prom diff --git a/ansible/roles/docker_service/defaults/main.yaml b/ansible/roles/docker_service/defaults/main.yaml deleted file mode 100644 index b3baa37..0000000 --- a/ansible/roles/docker_service/defaults/main.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -service_name: "" # required, also the compose project name -service_base_path: "" # required, e.g. /opt/traefik - -# Each list item: path/dest plus optional owner, group, mode. Ownership and -# mode are only enforced when given, so existing data directories keep theirs. -service_directories: [] -service_templates: [] # src (template), dest -service_files: [] # src (plain file, copied verbatim), dest -service_absent: [] # paths under the base path that must not exist - -# Containers to save and stop properly before compose recreates them: -# - { container: name, timeout: 120, pre_stop: "docker exec ..." } -service_graceful_stop: [] - -docker_compose_file: "docker-compose.yml" -docker_compose_project_name: "{{ service_name }}" - -# A changed config file restarts the stack unless compose already recreated it -service_restart_on_change: true - -health_check_enabled: true -health_check_url: "" -health_check_host: "localhost" -health_check_port: "" -health_check_delay: 10 -health_check_retries: 30 -health_check_retry_delay: 2 diff --git a/ansible/roles/docker_service/tasks/main.yaml b/ansible/roles/docker_service/tasks/main.yaml deleted file mode 100644 index a0cc840..0000000 --- a/ansible/roles/docker_service/tasks/main.yaml +++ /dev/null @@ -1,148 +0,0 @@ ---- -- name: Validate required variables - ansible.builtin.assert: - that: - - service_name | length > 0 - - service_base_path | length > 0 - fail_msg: "service_name and service_base_path are required" - quiet: true - -- name: Create base service directory - ansible.builtin.file: - path: "{{ service_base_path }}" - state: directory - -- name: Create service subdirectories - ansible.builtin.file: - path: "{{ service_base_path }}/{{ item.path }}" - state: directory - owner: "{{ item.owner | default(omit) }}" - group: "{{ item.group | default(omit) }}" - mode: "{{ item.mode | default(omit) }}" - loop: "{{ service_directories }}" - loop_control: - label: "{{ item.path }}" - -- name: Deploy service templates - ansible.builtin.template: - src: "{{ item.src }}" - dest: "{{ service_base_path }}/{{ item.dest }}" - owner: "{{ item.owner | default('root') }}" - group: "{{ item.group | default('root') }}" - mode: "{{ item.mode | default('0644') }}" - loop: "{{ service_templates }}" - loop_control: - label: "{{ item.dest }}" - # Templates may carry secrets; never print their contents - diff: false - register: template_result - -- name: Deploy service files - ansible.builtin.copy: - src: "{{ item.src }}" - dest: "{{ service_base_path }}/{{ item.dest }}" - owner: "{{ item.owner | default('root') }}" - group: "{{ item.group | default('root') }}" - mode: "{{ item.mode | default('0644') }}" - loop: "{{ service_files }}" - loop_control: - label: "{{ item.dest }}" - register: file_result - -- name: Remove files that are no longer part of the service - ansible.builtin.file: - path: "{{ service_base_path }}/{{ item }}" - state: absent - loop: "{{ service_absent }}" - -# Game servers need time to save: Docker's default stop timeout is 10 s. -# When compose is about to recreate one of the listed containers, save -# and stop it properly first; compose then replaces the stopped container. -- name: Ask compose what it would do - ansible.builtin.command: - cmd: docker compose -p {{ docker_compose_project_name }} -f {{ docker_compose_file }} up -d --dry-run - chdir: "{{ service_base_path }}" - register: compose_plan - changed_when: false - # The dry run exits non-zero when an image still has to be pulled; the - # plan it prints up to that point is all that is needed here - failed_when: false - check_mode: false - when: service_graceful_stop | length > 0 - -- name: Run pre-stop command before recreation - ansible.builtin.command: - cmd: "{{ item.pre_stop }}" - loop: "{{ service_graceful_stop }}" - loop_control: - label: "{{ item.container }}" - when: - - item.pre_stop is defined - - (compose_plan.stdout ~ compose_plan.stderr) is search('Container ' ~ item.container ~ ' Recreate') - failed_when: false - -- name: Stop gracefully before recreation - ansible.builtin.command: - cmd: "docker stop -t {{ item.timeout | default(120) }} {{ item.container }}" - loop: "{{ service_graceful_stop }}" - loop_control: - label: "{{ item.container }}" - when: (compose_plan.stdout ~ compose_plan.stderr) is search('Container ' ~ item.container ~ ' Recreate') - -- name: Start service with Docker Compose - community.docker.docker_compose_v2: - project_src: "{{ service_base_path }}" - project_name: "{{ docker_compose_project_name }}" - files: - - "{{ docker_compose_file }}" - state: present - register: compose_result - # In check mode compose cannot pull, so a missing image looks like an error - ignore_errors: "{{ ansible_check_mode }}" - -- name: Restart service after a config change - community.docker.docker_compose_v2: - project_src: "{{ service_base_path }}" - project_name: "{{ docker_compose_project_name }}" - files: - - "{{ docker_compose_file }}" - state: restarted - when: - - service_restart_on_change - - template_result is changed or file_result is changed - - compose_result is not changed - # A first dry run has no project directory to restart yet - ignore_errors: "{{ ansible_check_mode }}" - -- name: Wait before health check - ansible.builtin.pause: - seconds: "{{ health_check_delay }}" - when: - - health_check_enabled - - health_check_url != "" or health_check_port != "" - - not ansible_check_mode - - compose_result is changed or template_result is changed or file_result is changed - -- name: Wait for service HTTP endpoint - ansible.builtin.uri: - url: "{{ health_check_url }}" - status_code: [200, 301, 302, 303, 401, 404] - follow_redirects: none - timeout: 5 - register: health_result - until: health_result is not failed - retries: "{{ health_check_retries }}" - delay: "{{ health_check_retry_delay }}" - when: - - health_check_enabled and health_check_url != "" - # A dry run changes nothing to verify, and a new service is not there yet - - not ansible_check_mode - -- name: Wait for service port - ansible.builtin.wait_for: - host: "{{ health_check_host }}" - port: "{{ health_check_port }}" - timeout: "{{ health_check_retries * health_check_retry_delay }}" - when: - - health_check_enabled and health_check_port != "" - - not ansible_check_mode diff --git a/ansible/roles/forgejo/handlers/main.yaml b/ansible/roles/forgejo/handlers/main.yaml deleted file mode 100644 index aadedae..0000000 --- a/ansible/roles/forgejo/handlers/main.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Restart Forgejo - community.docker.docker_compose_v2: - project_src: /opt/forgejo - state: restarted - -- name: Reload SSH daemon - systemd: - name: sshd - state: reloaded diff --git a/ansible/roles/forgejo/tasks/main.yaml b/ansible/roles/forgejo/tasks/main.yaml deleted file mode 100644 index 541a5af..0000000 --- a/ansible/roles/forgejo/tasks/main.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Validate Forgejo variables - ansible.builtin.import_tasks: validate.yaml - -- name: Configure SSH passthrough - ansible.builtin.import_tasks: ssh-passthrough.yaml - -- name: Deploy Forgejo - ansible.builtin.include_role: - name: docker_service - vars: - service_name: "forgejo" - service_base_path: "{{ forgejo_base_path }}" - service_directories: - - { path: "data" } - - { path: "config" } - service_templates: - - src: "app.ini.j2" - dest: "config/app.ini" - owner: "{{ forgejo_uid }}" - group: "{{ forgejo_gid }}" - mode: "0600" - - { src: "docker-compose.yml.j2", dest: "docker-compose.yml" } - health_check_url: "http://localhost:{{ forgejo_http_port }}/api/v1/version" - health_check_delay: 5 - health_check_retries: 30 diff --git a/ansible/roles/forgejo/tasks/ssh-passthrough.yaml b/ansible/roles/forgejo/tasks/ssh-passthrough.yaml deleted file mode 100644 index ffcb436..0000000 --- a/ansible/roles/forgejo/tasks/ssh-passthrough.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# git@ lands on the host's sshd, which hands the session to the -# Forgejo container. Keys are looked up through the container too -# (AuthorizedKeysCommand), so the host keeps no authorized_keys for git. - -- name: Create git user on host - ansible.builtin.user: - name: git - comment: "Forgejo Git User" - home: "{{ forgejo_base_path }}/data/git" - create_home: false - shell: /usr/local/bin/forgejo-shell - system: true - groups: docker - append: true - -- name: Deploy forgejo-shell wrapper script - ansible.builtin.template: - src: forgejo-shell.j2 - dest: /usr/local/bin/forgejo-shell - owner: root - group: root - mode: "0755" - -- name: Deploy SSH daemon configuration for Forgejo passthrough - ansible.builtin.template: - src: sshd-forgejo.conf.j2 - dest: /etc/ssh/sshd_config.d/forgejo.conf - owner: root - group: root - mode: "0644" - notify: Reload SSH daemon diff --git a/ansible/roles/forgejo/tasks/validate.yaml b/ansible/roles/forgejo/tasks/validate.yaml deleted file mode 100644 index 7c9b883..0000000 --- a/ansible/roles/forgejo/tasks/validate.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Variable validation for forgejo role - -- name: Validate Forgejo required variables - ansible.builtin.assert: - that: - - forgejo_base_path is defined - - forgejo_base_path | length > 0 - - forgejo_http_port is defined - - forgejo_http_port | int > 0 - - forgejo_http_port | int < 65536 - - forgejo_domain is defined - - forgejo_domain | length > 0 - fail_msg: | - Forgejo role requires: - - forgejo_base_path (installation directory) - - forgejo_http_port (1-65535) - - forgejo_domain (domain name) - success_msg: "Forgejo basic variables validated successfully" - -- name: Validate Forgejo secrets (if not using vault) - ansible.builtin.assert: - that: - - forgejo_secret_key is defined - - forgejo_secret_key | length >= 32 - - forgejo_internal_token is defined - - forgejo_internal_token | length > 0 - - forgejo_jwt_secret is defined - - forgejo_jwt_secret | length >= 32 - - forgejo_lfs_jwt_secret is defined - - forgejo_lfs_jwt_secret | length >= 32 - fail_msg: | - Forgejo role requires secrets: - - forgejo_secret_key (min 32 chars) - - forgejo_internal_token - - forgejo_jwt_secret (min 32 chars) - - forgejo_lfs_jwt_secret (min 32 chars) - - WARNING: These should be stored in Ansible Vault! - success_msg: "Forgejo secrets validated (WARNING: should use Ansible Vault)" - when: not ansible_check_mode diff --git a/ansible/roles/forgejo/templates/app.ini.j2 b/ansible/roles/forgejo/templates/app.ini.j2 deleted file mode 100644 index 7d51781..0000000 --- a/ansible/roles/forgejo/templates/app.ini.j2 +++ /dev/null @@ -1,106 +0,0 @@ -APP_NAME = Git with a cup of tea -RUN_MODE = prod -WORK_PATH = /data/gitea - -[server] -PROTOCOL = http -DOMAIN = {{ forgejo_domain }} -ROOT_URL = https://{{ forgejo_domain }}/ -HTTP_PORT = 3000 -DISABLE_SSH = false -SSH_DOMAIN = {{ forgejo_domain }} -SSH_PORT = 22 -SSH_LISTEN_PORT = 22 -START_SSH_SERVER = false -LFS_START_SERVER = true -OFFLINE_MODE = false -LFS_JWT_SECRET = {{ forgejo_server_lfs_jwt_secret }} -LANDING_PAGE = explore - -[database] -DB_TYPE = sqlite3 -PATH = /data/gitea/gitea.db -LOG_SQL = false - -[repository] -ROOT = /data/git/repositories -SCRIPT_TYPE = bash -DEFAULT_BRANCH = main -DEFAULT_PRIVATE = private -ENABLE_PUSH_CREATE_USER = true -ENABLE_PUSH_CREATE_ORG = false -DISABLED_REPO_UNITS = -DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions - -[ui] -THEMES = forgejo-auto,forgejo-light,forgejo-dark,gitea-auto,gitea-light,gitea-dark -DEFAULT_THEME = forgejo-auto - -[security] -INSTALL_LOCK = true -SECRET_KEY = {{ forgejo_secret_key }} -INTERNAL_TOKEN = {{ forgejo_internal_token }} -PASSWORD_HASH_ALGO = pbkdf2 - -[service] -DISABLE_REGISTRATION = true -REQUIRE_SIGNIN_VIEW = false -REGISTER_EMAIL_CONFIRM = false -ENABLE_NOTIFY_MAIL = true -DEFAULT_KEEP_EMAIL_PRIVATE = true -DEFAULT_ALLOW_CREATE_ORGANIZATION = true -DEFAULT_ENABLE_TIMETRACKING = true -NO_REPLY_ADDRESS = noreply.{{ forgejo_domain }} - -[oauth2] -ENABLED = true -JWT_SECRET = {{ forgejo_jwt_secret }} - -[mailer] -ENABLED = true -FROM = Czechoslovakia Git -PROTOCOL = smtp+starttls -SMTP_ADDR = smtp.fastmail.com -SMTP_PORT = 587 -USER = {{ forgejo_smtp_user }} -PASSWD = {{ forgejo_smtp_password }} - -[session] -PROVIDER = file - -[log] -MODE = console -LEVEL = info -ROOT_PATH = /data/gitea/log - -[actions] -ENABLED = true -DEFAULT_ACTIONS_URL = https://github.com -ARTIFACT_RETENTION_DAYS = 365 - -[repository.upload] -ENABLED = true - -[repository.pull-request] -DEFAULT_MERGE_STYLE = merge - -[repository.signing] -DEFAULT_TRUST_MODEL = collaborator - -[lfs] -PATH = /data/git/lfs -LFS_JWT_SECRET = {{ forgejo_lfs_jwt_secret }} - -[packages] -ENABLED = true - -[other] -SHOW_FOOTER_VERSION = false -SHOW_FOOTER_TEMPLATE_LOAD_TIME = false -SHOW_FOOTER_POWERED_BY = false - - -[metrics] -; scraped by Prometheus on asxpio-ops over the traefik network -ENABLED = true -TOKEN = {{ monitoring_forgejo_metrics_token }} diff --git a/ansible/roles/forgejo/templates/docker-compose.yml.j2 b/ansible/roles/forgejo/templates/docker-compose.yml.j2 deleted file mode 100644 index e4e114c..0000000 --- a/ansible/roles/forgejo/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,30 +0,0 @@ -services: - forgejo: - image: codeberg.org/forgejo/forgejo:{{ forgejo_version }} - container_name: forgejo - restart: unless-stopped - environment: - - USER_UID=1000 - - USER_GID=1000 - - FORGEJO__database__DB_TYPE=sqlite3 - - FORGEJO__database__PATH=/data/gitea/gitea.db - volumes: - - ./data:/data - - ./config/app.ini:/data/gitea/conf/app.ini - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "{{ forgejo_http_port }}:3000" - networks: - - {{ traefik_network }} - labels: - - "traefik.enable=true" - - "traefik.http.routers.forgejo.rule={{ ([forgejo_domain] + forgejo_alias_domains) | map('regex_replace', '^(.*)$', 'Host(`\\1`)') | join(' || ') }}" - - "traefik.http.routers.forgejo.entrypoints=websecure" - - "traefik.http.routers.forgejo.tls=true" - - "traefik.http.routers.forgejo.tls.certresolver=letsencrypt" - - "traefik.http.services.forgejo.loadbalancer.server.port=3000" - -networks: - {{ traefik_network }}: - external: true diff --git a/ansible/roles/forgejo/templates/forgejo-shell.j2 b/ansible/roles/forgejo/templates/forgejo-shell.j2 deleted file mode 100644 index b7ff999..0000000 --- a/ansible/roles/forgejo/templates/forgejo-shell.j2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Forgejo SSH passthrough wrapper -# Relays SSH commands to Forgejo container -docker exec -i -u git --env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" forgejo sh "$@" diff --git a/ansible/roles/forgejo/templates/sshd-forgejo.conf.j2 b/ansible/roles/forgejo/templates/sshd-forgejo.conf.j2 deleted file mode 100644 index 872f676..0000000 --- a/ansible/roles/forgejo/templates/sshd-forgejo.conf.j2 +++ /dev/null @@ -1,6 +0,0 @@ -# Forgejo SSH passthrough configuration -# Delegates SSH key authentication for git user to Forgejo container - -Match User git - AuthorizedKeysCommand /usr/bin/docker exec -i -u git forgejo /usr/local/bin/forgejo keys -c /data/gitea/conf/app.ini -e git -u %u -t %t -k %k - AuthorizedKeysCommandUser git diff --git a/ansible/roles/forgejo_runner/handlers/main.yaml b/ansible/roles/forgejo_runner/handlers/main.yaml deleted file mode 100644 index 4ece759..0000000 --- a/ansible/roles/forgejo_runner/handlers/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Restart Forgejo Runner - community.docker.docker_compose_v2: - project_src: /opt/forgejo-runner - state: restarted diff --git a/ansible/roles/forgejo_runner/tasks/main.yaml b/ansible/roles/forgejo_runner/tasks/main.yaml deleted file mode 100644 index 82d89da..0000000 --- a/ansible/roles/forgejo_runner/tasks/main.yaml +++ /dev/null @@ -1,74 +0,0 @@ ---- -- name: Validate Forgejo Runner variables - ansible.builtin.import_tasks: validate.yaml - -- name: Deploy Forgejo Runner using shared docker_service role - ansible.builtin.include_role: - name: docker_service - vars: - service_name: "forgejo-runner" - service_base_path: "{{ forgejo_runner_base_path }}" - service_directories: - - { path: "data" } - - { path: "config" } - service_templates: - - { src: "config.yaml.j2", dest: "config/config.yaml" } - - { src: "docker-compose.yml.j2", dest: "docker-compose.yml" } - health_check_enabled: false # the runner exposes no port - -- name: Check if runner is already registered - ansible.builtin.stat: - path: "{{ forgejo_runner_base_path }}/data/.runner" - register: runner_registered - -- name: Set permissions on data directory - ansible.builtin.file: - path: "{{ forgejo_runner_base_path }}/data" - state: directory - mode: '0777' - recurse: true - when: not runner_registered.stat.exists - -- name: Stop runner for registration - community.docker.docker_compose_v2: - project_src: "{{ forgejo_runner_base_path }}" - state: stopped - when: not runner_registered.stat.exists - -- name: Register runner with Forgejo - ansible.builtin.command: - cmd: > - docker run --rm - -v {{ forgejo_runner_base_path }}/data:/data - -v {{ forgejo_runner_base_path }}/config/config.yaml:/config.yaml - code.forgejo.org/forgejo/runner:{{ forgejo_runner_version }} - forgejo-runner register - --no-interactive - --token {{ forgejo_runner_token }} - --name runner-{{ inventory_hostname }} - --instance http://{{ asxpio_ops_vpc_ip }}:{{ forgejo_http_port }} - --labels ubuntu-latest:docker://node:20.20.2-bookworm,ubuntu-22.04:docker://node:20.20.2-bookworm,ubuntu-24.04:docker://node:22.23.5-bookworm,debian-latest:docker://debian:12.15,debian-12:docker://debian:12.15,debian-11:docker://debian:11.11,arch-latest:docker://archlinux:base-20261108.0.623074,nginx-latest:docker://nginx:1.31.8,nginx-alpine:docker://nginx:1.31.8-alpine,node-20:docker://node:20.20.2,node-22:docker://node:22.23.5,python-3.11:docker://python:3.11.18,python-3.12:docker://python:3.12.16,alpine-latest:docker://alpine:3.24.4 - when: not runner_registered.stat.exists - changed_when: true - register: registration_result - -- name: Start runner after registration - community.docker.docker_compose_v2: - project_src: "{{ forgejo_runner_base_path }}" - state: present - when: not runner_registered.stat.exists - -- name: Display runner status - ansible.builtin.debug: - msg: | - Forgejo Runner deployed successfully! - - Runner name: runner-{{ inventory_hostname }} - Forgejo instance: http://{{ asxpio_ops_vpc_ip }}:{{ forgejo_http_port }} - {% if runner_registered.stat.exists %} - Status: Already registered (using existing registration) - {% else %} - Status: Newly registered - {% endif %} - - Check runner status: docker logs forgejo-runner diff --git a/ansible/roles/forgejo_runner/tasks/validate.yaml b/ansible/roles/forgejo_runner/tasks/validate.yaml deleted file mode 100644 index a0a2987..0000000 --- a/ansible/roles/forgejo_runner/tasks/validate.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# Variable validation for forgejo_runner role - -- name: Validate Forgejo Runner required variables - ansible.builtin.assert: - that: - - forgejo_runner_base_path is defined - - forgejo_runner_base_path | length > 0 - - forgejo_runner_token is defined - - forgejo_runner_token | length > 0 - - forgejo_runner_version is defined - - forgejo_runner_version | length > 0 - - forgejo_http_port is defined - - forgejo_http_port | int > 0 - - asxpio_ops_vpc_ip is defined - - asxpio_ops_vpc_ip | length > 0 - fail_msg: | - Forgejo Runner role requires: - - forgejo_runner_base_path (installation directory) - - forgejo_runner_token (runner registration token) - - forgejo_runner_version (e.g., '3.5.1') - - forgejo_http_port (Forgejo HTTP port) - - asxpio_ops_vpc_ip (Forgejo server IP) - - WARNING: forgejo_runner_token should be stored in Ansible Vault! - success_msg: "Forgejo Runner variables validated (WARNING: token should use Ansible Vault)" diff --git a/ansible/roles/forgejo_runner/templates/config.yaml.j2 b/ansible/roles/forgejo_runner/templates/config.yaml.j2 deleted file mode 100644 index 40d16c0..0000000 --- a/ansible/roles/forgejo_runner/templates/config.yaml.j2 +++ /dev/null @@ -1,48 +0,0 @@ -log: - level: info - job_level: info - -runner: - file: /data/.runner - capacity: {{ forgejo_runner_capacity }} - envs: {} - env_file: .env - timeout: {{ forgejo_runner_timeout }} - shutdown_timeout: {{ forgejo_runner_timeout }} - insecure: false - fetch_timeout: 5s - fetch_interval: 2s - report_interval: 1s - labels: - - "ubuntu-latest:docker://node:20.20.2-bookworm" - - "ubuntu-22.04:docker://node:20.20.2-bookworm" - - "ubuntu-24.04:docker://node:22.23.5-bookworm" - - "debian-latest:docker://debian:12.15" - - "debian-12:docker://debian:12.15" - - "debian-11:docker://debian:11.11" - - "arch-latest:docker://archlinux:base-20261108.0.623074" - - "nginx-latest:docker://nginx:1.31.8" - - "nginx-alpine:docker://nginx:1.31.8-alpine" - - "node-20:docker://node:20.20.2" - - "node-22:docker://node:22.23.5" - - "python-3.11:docker://python:3.11.18" - - "python-3.12:docker://python:3.12.16" - - "alpine-latest:docker://alpine:3.24.4" - - "nix-latest:docker://nixos/nix:{{ forgejo_runner_nix_version }}" - -cache: - enabled: true - port: 0 - dir: "" - -container: - # "" so each workflow gets a bridge network; services (Postgres) need it. - network: "" - enable_ipv6: false - privileged: false - options: "-v nix-store-{{ forgejo_runner_nix_version }}:/nix" - valid_volumes: - - '**' - docker_host: "automount" - force_pull: false - force_rebuild: false diff --git a/ansible/roles/forgejo_runner/templates/docker-compose.yml.j2 b/ansible/roles/forgejo_runner/templates/docker-compose.yml.j2 deleted file mode 100644 index 1f9bd17..0000000 --- a/ansible/roles/forgejo_runner/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,16 +0,0 @@ -name: forgejo-runner - -services: - forgejo-runner: - container_name: forgejo-runner - image: code.forgejo.org/forgejo/runner:{{ forgejo_runner_version }} - restart: unless-stopped - user: "0:0" # Run as root to access Docker socket - command: forgejo-runner daemon --config /config.yaml - environment: - - CONFIG_FILE=/config.yaml - volumes: - - ./data:/data - - ./config/config.yaml:/config.yaml - - /var/run/docker.sock:/var/run/docker.sock - network_mode: host diff --git a/ansible/roles/forgejo_runner_interop/tasks/main.yaml b/ansible/roles/forgejo_runner_interop/tasks/main.yaml deleted file mode 100644 index 2682872..0000000 --- a/ansible/roles/forgejo_runner_interop/tasks/main.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Deploy the another-im/interop runner - ansible.builtin.include_role: - name: docker_service - vars: - service_name: forgejo-runner-interop - service_base_path: "{{ services_base_path }}/forgejo-runner-interop" - service_directories: - - { path: data } - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: config.yaml.j2, dest: config.yaml, mode: "0600" } - health_check_enabled: false diff --git a/ansible/roles/forgejo_runner_interop/templates/config.yaml.j2 b/ansible/roles/forgejo_runner_interop/templates/config.yaml.j2 deleted file mode 100644 index 2f057d8..0000000 --- a/ansible/roles/forgejo_runner_interop/templates/config.yaml.j2 +++ /dev/null @@ -1,40 +0,0 @@ -# Managed by Ansible (role forgejo_runner_interop). -log: - level: info - job_level: info - -runner: - capacity: {{ interop_runner_capacity }} - # Builds wait up to 4 h on their builder VM - timeout: 5h - shutdown_timeout: 5h - fetch_interval: 5s - envs: - # The old host had flakes on in nix.conf; jobs here get it this way - NIX_CONFIG: | - experimental-features = nix-command flakes - build-users-group = - sandbox = false - labels: - # PR checks: throwaway container - - "nix:docker://nixos/nix:{{ forgejo_runner_nix_version }}" - - "docker:docker://node:22.23.5-bookworm" - # Trusted workflows (servers, build-anotherim). On the old host this ran - # on the host with its Nix store as cache; here a throwaway container - # until a second, trusted-only registration gets a persistent store. - - "nix-host:docker://nixos/nix:{{ forgejo_runner_nix_version }}" - -container: - network: bridge - privileged: false - # PR checks run here: no Docker socket and no host volumes in jobs - docker_host: "-" - valid_volumes: [] - force_pull: false - -server: - connections: - interop: - url: https://dev.another.im/ - uuid: {{ interop_runner_uuid }} - token: {{ interop_runner_token }} diff --git a/ansible/roles/forgejo_runner_interop/templates/docker-compose.yml.j2 b/ansible/roles/forgejo_runner_interop/templates/docker-compose.yml.j2 deleted file mode 100644 index 7114fd2..0000000 --- a/ansible/roles/forgejo_runner_interop/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,12 +0,0 @@ -# Managed by Ansible (role forgejo_runner_interop). -services: - forgejo-runner-interop: - container_name: forgejo-runner-interop - image: code.forgejo.org/forgejo/runner:{{ forgejo_runner_version }} - restart: unless-stopped - user: "0:0" # the runner itself talks to Docker; its jobs do not - command: forgejo-runner daemon --config /config.yaml - volumes: - - ./data:/data - - ./config.yaml:/config.yaml:ro - - /var/run/docker.sock:/var/run/docker.sock diff --git a/ansible/roles/minecraft/files/docker-compose.yml b/ansible/roles/minecraft/files/docker-compose.yml deleted file mode 100644 index ab49616..0000000 --- a/ansible/roles/minecraft/files/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - minecraft: - image: eclipse-temurin:21.0.13_9-jre - container_name: minecraft - working_dir: /data - command: java -Xmx4G -Xms2G -jar paper-1.21.11-54.jar nogui - stdin_open: true - tty: true - restart: unless-stopped - stop_grace_period: 2m - ports: - - "25565:25565" - - "19132:19132/udp" - volumes: - - /opt/minecraft:/data diff --git a/ansible/roles/minecraft/tasks/main.yaml b/ansible/roles/minecraft/tasks/main.yaml deleted file mode 100644 index 6656822..0000000 --- a/ansible/roles/minecraft/tasks/main.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# Paper server; the world and the server jar live next to the compose -# file in /opt/minecraft and are not managed here. A compose change -# recreates the container, so it is stopped with time to save first. -- name: Deploy Minecraft - ansible.builtin.include_role: - name: docker_service - vars: - service_name: "minecraft" - service_base_path: "{{ services_base_path }}/minecraft" - service_files: - - { src: "docker-compose.yml", dest: "docker-compose.yml" } - service_graceful_stop: - - { container: minecraft, timeout: 120 } - health_check_enabled: false diff --git a/ansible/roles/monitoring/defaults/main.yaml b/ansible/roles/monitoring/defaults/main.yaml deleted file mode 100644 index 2d79387..0000000 --- a/ansible/roles/monitoring/defaults/main.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -monitoring_base_path: "{{ services_base_path }}/monitoring" - -# Hosts with node_exporter, cAdvisor and Alloy, scraped over the VPC -monitoring_hosts: - - { name: asxpio-ops, address: "{{ asxpio_ops_vpc_ip }}" } - - { name: asxpio-services, address: "{{ asxpio_services_vpc_ip }}" } - -# Outside-in probes (blackbox_exporter). module: see blackbox.yml.j2 -monitoring_probes: - - { name: asxp.io, target: "https://asxp.io/", module: http_2xx } - - { name: blog, target: "https://blog.asxp.io/", module: http_2xx } - - { name: czsk.it, target: "https://czsk.it/", module: http_2xx } - - { name: datacenterbingo, target: "https://datacenterbingo.xyz/", module: http_2xx } - - { name: datacenterbingo data.json, target: "https://datacenterbingo.xyz/data.json", module: http_2xx } - - { name: forgejo, target: "https://git.asxp.io/", module: http_2xx } - - { name: s3, target: "https://s3.asxp.io/", module: http_up } - - { name: sillytavern, target: "http://{{ asxpio_services_wireguard_ip }}:8000/", module: http_up } - # blackbox matches responses line by line and ejabberd sends no newlines, - # so a STARTTLS dialogue times out: plain connect here, TLS on 5223. - - { name: xmpp c2s, target: "xmpp.asxp.io:5222", module: tcp_connect } - - { name: xmpp c2s tls, target: "xmpp.asxp.io:5223", module: tls_connect } - - { name: xmpp c2s tls asxp.io, target: "xmpp.asxp.io:5223", module: tls_connect_asxpio } - - { name: xmpp s2s, target: "xmpp.asxp.io:5269", module: tcp_connect } - - { name: turn, target: "xmpp.asxp.io:3478", module: tcp_connect } - - { name: xray, target: "{{ hostvars['asxpio-services'].public_ip }}:443", module: tcp_connect } - - { name: minecraft, target: "mc.asxp.io:25565", module: tcp_connect } diff --git a/ansible/roles/monitoring/files/dashboards/Infrastructure/containers.json b/ansible/roles/monitoring/files/dashboards/Infrastructure/containers.json deleted file mode 100644 index 06f43b0..0000000 --- a/ansible/roles/monitoring/files/dashboards/Infrastructure/containers.json +++ /dev/null @@ -1,781 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": 14282, - "graphTooltip": 0, - "id": null, - "iteration": 1617715580880, - "links": [], - "panels": [ - { - "collapsed": false, - "datasource": "prometheus", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 8, - "panels": [], - "title": "CPU", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 15, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.4.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(container_cpu_usage_seconds_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name) *100", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:606", - "format": "percent", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:607", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "datasource": "prometheus", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 11, - "panels": [], - "title": "Memory", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "hiddenSeries": false, - "id": 9, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.4.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(container_memory_rss{instance=~\"$host\",name=~\"$container\",name=~\".+\"}) by (name)", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:606", - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:607", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null as zero", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.4.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(container_memory_cache{instance=~\"$host\",name=~\"$container\",name=~\".+\"}) by (name)", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory Cached", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:606", - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:607", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "datasource": "prometheus", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 2, - "panels": [], - "title": "Network", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 18 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "hideEmpty": false, - "hideZero": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sideWidth": null, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.4.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(container_network_receive_bytes_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name)", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Received Network Traffic", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:674", - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:675", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 18 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.4.5", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(container_network_transmit_bytes_total{instance=~\"$host\",name=~\"$container\",name=~\".+\"}[5m])) by (name)", - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Sent Network Traffic", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:832", - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "$$hashKey": "object:833", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "datasource": "prometheus", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 19, - "panels": [], - "title": "Misc", - "type": "row" - }, - { - "datasource": "prometheus", - "fieldConfig": { - "defaults": { - "custom": { - "align": null, - "filterable": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "custom.width", - "value": 260 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Running" - }, - "properties": [ - { - "id": "unit", - "value": "d" - }, - { - "id": "decimals", - "value": 1 - }, - { - "id": "custom.displayMode", - "value": "color-text" - }, - { - "id": "color", - "value": { - "fixedColor": "dark-green", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 27 - }, - "id": 17, - "options": { - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "7.4.5", - "targets": [ - { - "expr": "(time() - container_start_time_seconds{instance=~\"$host\",name=~\"$container\",name=~\".+\"})/86400", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "{{name}}", - "refId": "A" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Containers Info", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "container_label_com_docker_compose_project", - "container_label_com_docker_compose_project_working_dir", - "image", - "instance", - "name", - "Value", - "container_label_com_docker_compose_service" - ] - } - } - }, - { - "id": "organize", - "options": { - "excludeByName": {}, - "indexByName": {}, - "renameByName": { - "Value": "Running", - "container_label_com_docker_compose_project": "Label", - "container_label_com_docker_compose_project_working_dir": "Working dir", - "container_label_com_docker_compose_service": "Service", - "image": "Registry Image", - "instance": "Instance", - "name": "Name" - } - } - } - ], - "type": "table" - } - ], - "schemaVersion": 27, - "style": "dark", - "tags": [ - "cadvisor", - "docker" - ], - "templating": { - "list": [ - { - "allValue": ".*", - "current": {}, - "datasource": "prometheus", - "definition": "label_values({__name__=~\"container.*\"},instance)", - "description": null, - "error": null, - "hide": 0, - "includeAll": true, - "label": "Host", - "multi": false, - "name": "host", - "options": [], - "query": { - "query": "label_values({__name__=~\"container.*\"},instance)", - "refId": "Prometheus-host-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": {}, - "datasource": "prometheus", - "definition": "label_values({__name__=~\"container.*\", instance=~\"$host\"},name)", - "description": null, - "error": null, - "hide": 0, - "includeAll": true, - "label": "Container", - "multi": false, - "name": "container", - "options": [], - "query": { - "query": "label_values({__name__=~\"container.*\", instance=~\"$host\"},name)", - "refId": "Prometheus-container-Variable-Query" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Cadvisor exporter", - "uid": "gnet-14282", - "version": 1, - "description": "Simple exporter for cadvisor only" -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/Infrastructure/hosts.json b/ansible/roles/monitoring/files/dashboards/Infrastructure/hosts.json deleted file mode 100644 index db45e83..0000000 --- a/ansible/roles/monitoring/files/dashboards/Infrastructure/hosts.json +++ /dev/null @@ -1,15517 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": null, - "links": [ - { - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "GitHub", - "type": "link", - "url": "https://github.com/rfmoz/grafana-dashboards" - }, - { - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "Grafana", - "type": "link", - "url": "https://grafana.com/grafana/dashboards/1860" - } - ], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 261, - "panels": [], - "title": "Quick CPU / Mem / Disk", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Resource pressure via PSI", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "links": [], - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, - { - "color": "dark-yellow", - "value": 70 - }, - { - "color": "dark-red", - "value": 90 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 0, - "y": 1 - }, - "id": 323, - "options": { - "displayMode": "basic", - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "maxVizHeight": 300, - "minVizHeight": 10, - "minVizWidth": 0, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "auto", - "text": {}, - "valueMode": "color" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "rate(node_pressure_cpu_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": true, - "legendFormat": "CPU", - "range": false, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "exemplar": false, - "expr": "rate(node_pressure_memory_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": true, - "legendFormat": "Mem", - "range": false, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "exemplar": false, - "expr": "rate(node_pressure_io_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": true, - "legendFormat": "I/O", - "range": false, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "exemplar": false, - "expr": "rate(node_pressure_irq_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": true, - "legendFormat": "Irq", - "range": false, - "refId": "D", - "step": 240 - } - ], - "title": "Pressure", - "type": "bargauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Overall CPU busy percentage (averaged across all cores)", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-green" - }, - { - "color": "orange", - "value": 85 - }, - { - "color": "red", - "value": 95 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 3, - "y": 1 - }, - "id": 20, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "100 * (1 - avg(rate(node_cpu_seconds_total{mode=\"idle\",instance=\"$node\",job=\"$job\"}[$__rate_interval])))", - "instant": true, - "legendFormat": "", - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "CPU Busy", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tasks running or waiting (CPU, I/O) per core", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-green" - }, - { - "color": "orange", - "value": 85 - }, - { - "color": "red", - "value": 95 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 6, - "y": 1 - }, - "id": 155, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "scalar(node_load1{instance=\"$node\",job=\"$job\"}) * 100 / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", - "format": "time_series", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "Sys Load", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Real RAM usage excluding cache and reclaimable memory", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-green" - }, - { - "color": "orange", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 9, - "y": 1 - }, - "id": 16, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "clamp_min((1 - (node_memory_MemAvailable_bytes{instance=\"$node\", job=\"$job\"} / node_memory_MemTotal_bytes{instance=\"$node\", job=\"$job\"})) * 100, 0)", - "format": "time_series", - "instant": true, - "range": false, - "refId": "B", - "step": 240 - } - ], - "title": "RAM Used", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Percentage of swap space currently used by the system", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-green" - }, - { - "color": "orange", - "value": 10 - }, - { - "color": "red", - "value": 25 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 12, - "y": 1 - }, - "id": 21, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "((node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} > 0)) * 100", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "SWAP Used", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Percentage of root filesystem space currently used", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-green" - }, - { - "color": "orange", - "value": 80 - }, - { - "color": "red", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 15, - "y": 1 - }, - "id": 154, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "(\n (node_filesystem_size_bytes{instance=\"$node\", job=\"$job\", mountpoint=\"/\", fstype!=\"rootfs\"}\n - node_filesystem_avail_bytes{instance=\"$node\", job=\"$job\", mountpoint=\"/\", fstype!=\"rootfs\"})\n / node_filesystem_size_bytes{instance=\"$node\", job=\"$job\", mountpoint=\"/\", fstype!=\"rootfs\"}\n) * 100\n", - "format": "time_series", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "Root FS Used", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short", - "displayName": "CPU Cores" - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 2, - "x": 18, - "y": 1 - }, - "id": 14, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "value_and_name", - "wideLayout": false, - "text": { - "titleSize": 12, - "valueSize": 20 - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes", - "displayName": "RAM Total" - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 2, - "x": 20, - "y": 1 - }, - "id": 75, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "value_and_name", - "wideLayout": false, - "text": { - "titleSize": 12, - "valueSize": 20 - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes", - "displayName": "SWAP Total" - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 2, - "x": 22, - "y": 1 - }, - "id": 18, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "value_and_name", - "wideLayout": false, - "text": { - "titleSize": 12, - "valueSize": 20 - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"}", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes", - "displayName": "RootFS Total" - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 3, - "x": 18, - "y": 3 - }, - "id": 23, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "value_and_name", - "wideLayout": false, - "text": { - "titleSize": 12, - "valueSize": 20 - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"}", - "format": "time_series", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "s", - "displayName": "Uptime" - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 3, - "x": 21, - "y": 3 - }, - "id": 15, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "value_and_name", - "wideLayout": false, - "text": { - "titleSize": 12, - "valueSize": 20 - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "node_time_seconds{instance=\"$node\",job=\"$job\"} - node_boot_time_seconds{instance=\"$node\",job=\"$job\"}", - "instant": true, - "range": false, - "refId": "A", - "step": 240 - } - ], - "title": "", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 5 - }, - "id": 263, - "panels": [], - "title": "Basic CPU / Mem / Net / Disk", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "CPU time spent busy vs idle, split by activity type", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "percent" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Busy Iowait" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#890F02", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Idle" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#052B51", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Busy System" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#EAB839", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Busy User" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#0A437C", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Busy Other" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#6D1F62", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 6 - }, - "id": 77, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true, - "width": 250 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "exemplar": false, - "expr": "avg(rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval]))", - "format": "time_series", - "instant": false, - "legendFormat": "Busy System", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval]))", - "format": "time_series", - "legendFormat": "Busy User", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval]))", - "format": "time_series", - "legendFormat": "Busy Iowait", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(sum without(mode) (rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=~\".*irq\"}[$__rate_interval])))", - "format": "time_series", - "legendFormat": "Busy IRQs", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(sum without (mode) (rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode!='idle',mode!='user',mode!='system',mode!='iowait',mode!='irq',mode!='softirq'}[$__rate_interval])))", - "format": "time_series", - "legendFormat": "Busy Other", - "range": true, - "refId": "E", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval]))", - "format": "time_series", - "legendFormat": "Idle", - "range": true, - "refId": "F", - "step": 240 - } - ], - "title": "CPU Basic", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "RAM and swap usage overview, including caches", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Swap used" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#BF1B00", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Total" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#E0F9D7", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.stacking", - "value": { - "group": false, - "mode": "normal" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Cache + Buffer" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#052B51", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Free" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#7EB26D", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 6 - }, - "id": 78, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Total", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - (node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "Used", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Cache + Buffer", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Free", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "Swap used", - "range": true, - "refId": "E", - "step": 240 - } - ], - "title": "Memory Basic", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Per-interface network traffic (receive and transmit) in bits per second", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Tx.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 13 - }, - "id": 74, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", - "format": "time_series", - "legendFormat": "Rx {{device}}", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", - "format": "time_series", - "legendFormat": "Tx {{device}}", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic Basic", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Percentage of filesystem space used for each mounted filesystem", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 13 - }, - "id": 152, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "((node_filesystem_size_bytes{instance=\"$node\", job=\"$job\", fstype!~'rootfs'} - node_filesystem_avail_bytes{instance=\"$node\", job=\"$job\", fstype!~'rootfs'}) / node_filesystem_size_bytes{instance=\"$node\", job=\"$job\", fstype!~'rootfs'}) * 100", - "format": "time_series", - "legendFormat": "{{mountpoint}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Disk Space Used Basic", - "type": "timeseries" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 265, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "CPU time usage split by state, normalized across all CPU cores", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 70, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "percent" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Idle - Waiting for something to happen" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#052B51", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Iowait - Waiting for I/O to complete" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#890F02", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Irq - Servicing interrupts" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#BF1B00", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Nice - Niced processes executing in user mode" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#6D1F62", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Softirq - Servicing softirqs" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#A06D99", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Steal - Time spent in other operating systems when running in a virtualized environment" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#CCB1C8", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "System - Processes executing in kernel mode" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#EAB839", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "User - Normal processes executing in user mode" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#0A437C", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Guest - Running virtual CPUs, included in User/Nice" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "none" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 21 - }, - "id": 3, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 250 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"system\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "interval": "", - "legendFormat": "System - Processes executing in kernel mode", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"user\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "User - Normal processes executing in user mode", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"nice\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Nice - Niced processes executing in user mode", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"iowait\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Iowait - Waiting for I/O to complete", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"irq\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Irq - Servicing interrupts", - "range": true, - "refId": "E", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"softirq\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Softirq - Servicing softirqs", - "range": true, - "refId": "F", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"steal\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Steal - Time spent in other operating systems when running in a virtualized environment", - "range": true, - "refId": "G", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum(rate(node_cpu_seconds_total{mode=\"idle\",instance=\"$node\",job=\"$job\"}[$__rate_interval])) / scalar(count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)))", - "format": "time_series", - "legendFormat": "Idle - Waiting for something to happen", - "range": true, - "refId": "H", - "step": 240 - }, - { - "editorMode": "code", - "expr": "sum by(instance) (rate(node_cpu_guest_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((rate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]))) > 0", - "format": "time_series", - "legendFormat": "Guest - Running virtual CPUs, included in User/Nice", - "range": true, - "refId": "I", - "step": 240 - } - ], - "title": "CPU", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Breakdown of physical memory and swap usage. Hardware-detected memory errors are also displayed", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#CFFAFF", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Unused - Free memory unassigned" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#7EB26D", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Apps - Memory used by user-space applications" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#EAB839", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "PageTables - Memory used to map between virtual and physical memory addresses" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#0A50A1", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "SwapCache - Memory that keeps track of pages that have been fetched from swap but not yet been modified" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#E24D42", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Slab - Memory used by the kernel to cache data structures for its own use (caches like inode, dentry, etc)" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#806EB7", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Cache - Parked file data (file content) cache" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#052B51", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Buffers - Block device (e.g. harddisk) cache" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#698097", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Swap - Swap space used" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#BF1B00", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/.*Hardware Corrupted - *./" - }, - "properties": [ - { - "id": "custom.stacking", - "value": { - "group": false, - "mode": "normal" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 21 - }, - "id": 24, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"} - node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Apps - Memory used by user-space applications", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "PageTables - Memory used to map between virtual and physical memory addresses", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "SwapCache - Memory that keeps track of pages that have been fetched from swap but not yet been modified", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Slab - Memory used by the kernel to cache data structures for its own use (caches like inode, dentry, etc)", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Cache - Parked file data (file content) cache", - "range": true, - "refId": "E", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Buffers - Block device (e.g. harddisk) cache", - "range": true, - "refId": "F", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Unused - Free memory unassigned", - "range": true, - "refId": "G", - "step": 240 - }, - { - "editorMode": "code", - "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "Swap - Swap space used", - "range": true, - "refId": "H", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_HardwareCorrupted_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working", - "range": true, - "refId": "I", - "step": 240 - } - ], - "title": "Memory", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Incoming and outgoing network traffic per interface", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 31 - }, - "id": 84, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Network interface utilization as a percentage of its maximum capacity", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 31 - }, - "id": 338, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "(node_network_speed_bytes{instance=\"$node\",job=\"$job\"} > bool 0) * (rate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / node_network_speed_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "(node_network_speed_bytes{instance=\"$node\",job=\"$job\"} > bool 0) * (rate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / node_network_speed_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Saturation", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Disk I/O operations per second for each device", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "iops" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 41 - }, - "id": 229, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\",device=~\"[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+\"}[$__rate_interval])", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\",device=~\"[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+\"}[$__rate_interval])", - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk IOps", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Disk I/O throughput per device", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 41 - }, - "id": 42, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\",device=~\"[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\",device=~\"[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk Throughput", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Amount of available disk space per mounted filesystem, excluding rootfs. Based on block availability to non-root users", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 51 - }, - "id": 43, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "legendFormat": "{{mountpoint}}", - "metric": "", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_filesystem_free_bytes{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "hide": true, - "legendFormat": "{{mountpoint}} - Free", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "hide": true, - "legendFormat": "{{mountpoint}} - Size", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Filesystem Space Available", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Disk usage (used = total - available) per mountpoint", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 51 - }, - "id": 156, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",fstype!~'rootfs'} - node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "legendFormat": "{{mountpoint}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Filesystem Used", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Percentage of time the disk was actively processing I/O operations", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 40, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 61 - }, - "id": 127, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\",device=~\"[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+\"} [$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{device}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Disk I/O Utilization", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "How often tasks experience CPU, memory, or I/O delays. 'Some' indicates partial slowdown; 'Full' indicates all tasks are stalled. Based on Linux PSI metrics:\nhttps://docs.kernel.org/accounting/psi.html", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "some (-) / full (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Some.*/" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/.*Some.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 61 - }, - "id": 322, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_pressure_cpu_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "CPU - Some", - "range": true, - "refId": "CPU some", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_pressure_memory_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Memory - Some", - "range": true, - "refId": "Memory some", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_pressure_memory_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Memory - Full", - "range": true, - "refId": "Memory full", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_pressure_io_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "I/O - Some", - "range": true, - "refId": "I/O some", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_pressure_io_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "I/O - Full", - "range": true, - "refId": "I/O full", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_pressure_irq_stalled_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IRQ - Full", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Pressure Stall Information", - "type": "timeseries" - } - ], - "title": "CPU / Memory / Net / Disk", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 21 - }, - "id": 266, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Displays committed memory usage versus the system's commit limit. Exceeding the limit is allowed under Linux overcommit policies but may increase OOM risks under high load", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*CommitLimit - *./" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 752 - }, - "id": 135, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Committed_AS_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Committed_AS \u2013 Memory promised to processes (not necessarily used)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_CommitLimit_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "CommitLimit - Max allowable committed memory", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Committed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Memory currently dirty (modified but not yet written to disk), being actively written back, or held by writeback buffers. High dirty or writeback memory may indicate disk I/O pressure or delayed flushing", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 762 - }, - "id": 130, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Writeback_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Writeback \u2013 Memory currently being flushed to disk", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_WritebackTmp_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "WritebackTmp \u2013 FUSE temporary writeback buffers", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Dirty_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Dirty \u2013 Memory marked dirty (pending write to disk)", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_NFS_Unstable_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "NFS Unstable \u2013 Pages sent to NFS server, awaiting storage commit", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Memory Writeback and Dirty", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Memory used by anonymous pages (not backed by files), including standard and huge page allocations. Includes heap, stack, and memory-mapped anonymous regions", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 732 - }, - "id": 129, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_AnonHugePages_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "AnonHugePages \u2013 Anonymous memory using HugePages", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_AnonPages_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "AnonPages \u2013 Anonymous memory (non-file-backed)", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Anonymous", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Memory used for mapped files (such as libraries) and shared memory (shmem and tmpfs), including variants backed by huge pages", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 732 - }, - "id": 138, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Mapped_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Mapped \u2013 Memory mapped from files (e.g., libraries, mmap)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Shmem_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Shmem \u2013 Shared memory used by processes and tmpfs", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_ShmemHugePages_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "ShmemHugePages \u2013 Shared memory (shmem/tmpfs) allocated with HugePages", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_ShmemPmdMapped_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "PMD Mapped \u2013 Shmem/tmpfs backed by Transparent HugePages (PMD)", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Memory Shared and Mapped", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Proportion of memory pages in the kernel's active and inactive LRU lists relative to total RAM. Active pages have been recently used, while inactive pages are less recently accessed but still resident in memory", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Active.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/.*Inactive.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-blue", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 772 - }, - "id": 136, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "(node_memory_Inactive_bytes{instance=\"$node\",job=\"$job\"}) \n/ \n(node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "legendFormat": "Inactive \u2013 Less recently used memory, more likely to be reclaimed", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "(node_memory_Active_bytes{instance=\"$node\",job=\"$job\"}) \n/ \n(node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"})\n", - "format": "time_series", - "legendFormat": "Active \u2013 Recently used memory, retained unless under pressure", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory LRU Active / Inactive (%)", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Breakdown of memory pages in the kernel's active and inactive LRU lists, separated by anonymous (heap, tmpfs) and file-backed (caches, mmap) pages.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 772 - }, - "id": 191, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Inactive_file_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Inactive_file - File-backed memory on inactive LRU list", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Inactive_anon_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Inactive_anon \u2013 Anonymous memory on inactive LRU (incl. tmpfs & swap cache)", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Active_file_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Active_file - File-backed memory on active LRU list", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Active_anon_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Active_anon \u2013 Anonymous memory on active LRU (incl. tmpfs & swap cache)", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Memory LRU Active / Inactive Detail", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Kernel slab memory usage, separated into reclaimable and non-reclaimable categories. Reclaimable memory can be freed under memory pressure (e.g., caches), while unreclaimable memory is locked by the kernel for core functions", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 792 - }, - "id": 131, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_SUnreclaim_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "SUnreclaim \u2013 Non-reclaimable slab memory (kernel objects)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "SReclaimable \u2013 Potentially reclaimable slab memory (e.g., inode cache)", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Slab", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Usage of the kernel's vmalloc area, which provides virtual memory allocations for kernel modules and drivers. Includes total, used, and largest free block sizes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Total.*/" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 792 - }, - "id": 70, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_VmallocChunk_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Vmalloc Free Chunk \u2013 Largest available block in vmalloc area", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_VmallocTotal_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Vmalloc Total \u2013 Total size of the vmalloc memory area", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_VmallocUsed_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Vmalloc Used \u2013 Portion of vmalloc area currently in use", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Memory Vmalloc", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks kernel memory used for CPU-local structures and per-thread stacks. These areas are typically small but critical for low-level operations", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 802 - }, - "id": 160, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_KernelStack_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "KernelStack \u2013 Kernel stack memory (per-thread, non-reclaimable)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Percpu_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "PerCPU \u2013 Dynamically allocated per-CPU memory (used by kernel modules)", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Kernel / CPU", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "How much memory is directly mapped in the kernel using different page sizes (4K, 2M, 1G). Helps monitor large page utilization in the direct map region", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 802 - }, - "id": 128, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_DirectMap1G_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "DirectMap 1G \u2013 Memory mapped with 1GB pages", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_DirectMap2M_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "DirectMap 2M \u2013 Memory mapped with 2MB pages", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_DirectMap4k_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "DirectMap 4K \u2013 Memory mapped with 4KB pages", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Memory DirectMap", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Memory that is locked in RAM and cannot be swapped out. Includes both kernel-unevictable memory and user-level memory locked with mlock()", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 742 - }, - "id": 137, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Unevictable_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Unevictable \u2013 Kernel-pinned memory (not swappable)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Mlocked_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Mlocked \u2013 Application-locked memory via mlock()", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Unevictable and MLocked", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Displays HugePages memory usage in bytes, including allocated, free, reserved, and surplus memory. All values are calculated based on the number of huge pages multiplied by their configured size", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 742 - }, - "id": 140, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "(node_memory_HugePages_Total{instance=\"$node\",job=\"$job\"} - node_memory_HugePages_Free{instance=\"$node\",job=\"$job\"}) * node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "HugePages Used \u2013 Currently allocated", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_HugePages_Rsvd{instance=\"$node\",job=\"$job\"} * node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "HugePages Reserved \u2013 Promised but unused", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_HugePages_Surp{instance=\"$node\",job=\"$job\"} * node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "HugePages Surplus \u2013 Dynamic pool extension", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_HugePages_Total{instance=\"$node\",job=\"$job\"} * node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "HugePages Total \u2013 Preallocated pool size", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Memory HugePages", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Zswap is a compressed RAM cache for swap pages. Zswap stores compressed pages that would otherwise be written to swap, reducing disk I/O. Zswapped shows the amount of data stored in the Zswap pool before compression", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 762 - }, - "id": 342, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_memory_Zswap_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Zswap \u2013 Compressed pool size in RAM", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_memory_Zswapped_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Zswapped \u2013 Original data size before compression", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Zswap", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of data read from and written to block devices. Despite the historical name, it covers all block I/O, not only memory paging", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 782 - }, - "id": 176, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_vmstat_pgpgin{instance=\"$node\",job=\"$job\"}[$__rate_interval]) * 1024", - "format": "time_series", - "legendFormat": "Pagesin - Data paged in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_vmstat_pgpgout{instance=\"$node\",job=\"$job\"}[$__rate_interval]) * 1024", - "format": "time_series", - "legendFormat": "Pagesout - Data paged out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Pages In / Out", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate at which memory pages are being swapped in from or out to disk. High swap-out activity may indicate memory pressure", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 782 - }, - "id": 22, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_vmstat_pswpin{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Pswpin - Pages swapped in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_vmstat_pswpout{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Pswpout - Pages swapped out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Memory Pages Swap In / Out", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of memory page faults, split into total, major (disk-backed), and derived minor (non-disk) faults. High major fault rates may indicate memory pressure or insufficient RAM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Pgfault - Page major and minor fault ops" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.stacking", - "value": { - "group": false, - "mode": "none" - } - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 782 - }, - "id": 175, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 350 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Pgfault - Page major and minor fault ops", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Pgmajfault - Major page fault ops", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval]) - rate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Pgminfault - Minor page fault ops", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Memory Page Faults", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of Out-of-Memory (OOM) kill events. A non-zero value indicates the kernel has terminated one or more processes due to memory exhaustion", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "OOM Kills" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 752 - }, - "id": 307, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_vmstat_oom_kill{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "OOM Kills", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "OOM Killer", - "type": "timeseries" - } - ], - "title": "Memory Details", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 23 - }, - "id": 312, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "System load average over 1, 5, and 15 minutes. Reflects the number of active or waiting processes. Values above CPU core count may indicate overload", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "CPU Core Count" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 735 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_load1{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Load 1m", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_load5{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Load 5m", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_load15{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Load 15m", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", - "format": "time_series", - "legendFormat": "CPU Core Count", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "System Load", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Running and blocked processes, plus kernel hung tasks detected (processes stuck in uninterruptible D state beyond the kernel timeout threshold)", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 745 - }, - "id": 62, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_procs_blocked{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Blocked (I/O Wait)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_procs_running{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Runnable (Ready for CPU)", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "increase(node_kernel_hung_tasks_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Hung Tasks Detected (D state > timeout)", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Processes Status", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Current number of processes in each state (e.g., running, sleeping, zombie). Requires --collector.processes to be enabled in node_exporter", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "D" - }, - "properties": [ - { - "id": "displayName", - "value": "Uninterruptible Sleeping" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "I" - }, - "properties": [ - { - "id": "displayName", - "value": "Idle Kernel Thread" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "R" - }, - "properties": [ - { - "id": "displayName", - "value": "Running" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "S" - }, - "properties": [ - { - "id": "displayName", - "value": "Interruptible Sleeping" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "T" - }, - "properties": [ - { - "id": "displayName", - "value": "Stopped" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "X" - }, - "properties": [ - { - "id": "displayName", - "value": "Dead" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Z" - }, - "properties": [ - { - "id": "displayName", - "value": "Zombie" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 745 - }, - "id": 315, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_processes_state{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{ state }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Processes Detailed States", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of new processes being created on the system (forks/sec).", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 735 - }, - "id": 148, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_forks_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Process Forks per second", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Processes Forks", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of active PIDs on the system and the configured maximum allowed. Useful for detecting PID exhaustion risk. Requires --collector.processes in node_exporter", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "PIDs limit" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 755 - }, - "id": 313, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_processes_pids{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Number of PIDs", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_processes_max_processes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "PIDs limit", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "PIDs Number and Limit", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of active threads on the system and the configured thread limit. Useful for monitoring thread pressure. Requires --collector.processes in node_exporter", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Threads limit" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 755 - }, - "id": 314, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_processes_threads{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Allocated threads", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_processes_max_threads{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Threads limit", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Threads Number and Limit", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of file descriptors currently allocated system-wide versus the system limit. Important for detecting descriptor exhaustion risks", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Max.*/" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 755 - }, - "id": 28, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filefd_maximum{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Max open files", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_filefd_allocated{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Open files", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "File Descriptor", - "type": "timeseries" - } - ], - "title": "Processes", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 24 - }, - "id": 269, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Per-second rate of context switches and hardware interrupts. High values may indicate intense CPU or I/O activity", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 816 - }, - "id": 8, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_context_switches_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Context switches", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_intr_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "Interrupts", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Context Switches / Interrupts", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Shows CPU saturation per core, calculated as the proportion of time spent waiting to run relative to total time demanded (running + waiting).", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "CPU saturation (%)", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 0.8 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 826 - }, - "id": 305, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_schedstat_running_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "CPU {{ cpu }} - Running", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_schedstat_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "CPU {{cpu}} - Waiting Queue", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_schedstat_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / ((rate(node_schedstat_running_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) + rate(node_schedstat_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])) > 0)", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}}", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "CPU Saturation per Core", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Real-time CPU frequency scaling per core, including average minimum and maximum allowed scaling frequencies", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "hertz" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Max" - }, - "properties": [ - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": false, - "viz": false - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Min" - }, - "properties": [ - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - }, - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": false, - "viz": false - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 836 - }, - "id": 321, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_cpu_scaling_frequency_hertz{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{ cpu }}", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(node_cpu_scaling_frequency_max_hertz{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "interval": "", - "legendFormat": "Max", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "avg(node_cpu_scaling_frequency_min_hertz{instance=\"$node\",job=\"$job\"})", - "format": "time_series", - "interval": "", - "legendFormat": "Min", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "CPU Frequency Scaling", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of scheduling timeslices executed per CPU. Reflects how frequently the scheduler switches tasks on each core", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 826 - }, - "id": 306, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_schedstat_timeslices_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{ cpu }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "CPU Schedule Timeslices", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Breaks down hardware interrupts by type and device. Useful for diagnosing IRQ load on network, disk, or CPU interfaces. Requires --collector.interrupts to be enabled in node_exporter", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 816 - }, - "id": 259, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "sum without (cpu) (rate(node_interrupts_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]))", - "format": "time_series", - "interval": "", - "legendFormat": "{{ type }} - {{ info }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "IRQ Detail", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of bits of entropy currently available to the system's random number generators (e.g., /dev/random). Low values may indicate that random number generation could block or degrade performance of cryptographic operations", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "decbits" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Entropy pool max" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 836 - }, - "id": 151, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_entropy_available_bits{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Entropy available", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_entropy_pool_size_bits{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "Entropy pool max", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Entropy", - "type": "timeseries" - } - ], - "title": "CPU & Scheduler", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 25 - }, - "id": 304, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Monitors hardware sensor temperatures and critical thresholds as exposed by Linux hwmon. Includes CPU, GPU, and motherboard sensors where available", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "celsius" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Critical.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 737 - }, - "id": 158, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_hwmon_temp_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }}", - "range": true, - "refId": "A", - "step": 240 - }, - { - "expr": "node_hwmon_temp_crit_alarm_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }} Critical Alarm", - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_hwmon_temp_crit_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }} Critical", - "range": true, - "refId": "C", - "step": 240 - }, - { - "expr": "node_hwmon_temp_crit_hyst_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }} Critical Hysteresis", - "refId": "D", - "step": 240 - }, - { - "expr": "node_hwmon_temp_max_celsius{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }} Max", - "refId": "E", - "step": 240 - } - ], - "title": "Hardware Temperature Monitor", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Shows how hard each cooling device (fan/throttle) is working relative to its maximum capacity", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percent" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Max.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 747 - }, - "id": 300, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "100 * node_cooling_device_cur_state{instance=\"$node\",job=\"$job\"} / (node_cooling_device_max_state{instance=\"$node\",job=\"$job\"} > 0)", - "format": "time_series", - "interval": "", - "legendFormat": "{{name}} - {{type}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Cooling Device Utilization", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Displays the current fan speeds (RPM) from hardware sensors via the hwmon interface", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "rotrpm" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 737 - }, - "id": 325, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_hwmon_fan_rpm{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }}", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_hwmon_fan_min_rpm{instance=\"$node\",job=\"$job\"} * on(chip) group_left(chip_name) node_hwmon_chip_names{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "{{ chip_name }} {{ sensor }} rpm min", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Hardware Fan Speed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Core-level CPU thermal throttling events per package. Values above zero indicate cores were throttled during the interval. Requires hardware that exposes thermal_throttle counters (mostly Intel); absent on AMD and most virtual machines.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "throttle events", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 747 - }, - "id": 344, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": true, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "sum by (package) (increase(node_cpu_core_throttles_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]))", - "format": "time_series", - "legendFormat": "Package {{package}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "CPU Throttling", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks the system clock's estimated and maximum error, as well as its offset from the reference clock (e.g., via NTP). Useful for detecting synchronization drift", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 767 - }, - "id": 260, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_timex_estimated_error_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Estimated error", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_timex_offset_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Offset local vs reference", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_timex_maxerror_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Maximum error", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Time Synchronized Drift", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "NTP phase-locked loop (PLL) time constant used by the kernel to control time adjustments. Lower values mean faster correction but less stability", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 767 - }, - "id": 291, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_timex_loop_time_constant{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "PLL Time Constant", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Time PLL Adjust", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Shows whether the system clock is synchronized to a reliable time source, and the current frequency correction ratio applied by the kernel to maintain synchronization", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 767 - }, - "id": 168, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_timex_sync_status{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Sync status (1 = ok)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_timex_frequency_adjustment_ratio{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Frequency Adjustment", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_timex_tick_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "Tick Interval", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_timex_tai_offset_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "hide": true, - "interval": "", - "legendFormat": "TAI Offset", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Time Synchronized Status", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Correctable and uncorrectable ECC memory errors reported by EDAC. Correctable errors indicate a degrading DIMM; uncorrectable errors can cause data corruption. Only available on bare metal hosts that expose EDAC.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/ - Correctable$/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/ - Uncorrectable$/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 757 - }, - "id": 302, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "increase(node_edac_correctable_errors_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{controller}} - Correctable", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "increase(node_edac_uncorrectable_errors_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{controller}} - Uncorrectable", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "ECC Memory Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Online and present state of each power supply exposed by /sys/class/power_supply. 1 = OK, 0 = failed or missing. Only available on hardware that exposes node_power_supply_online or node_power_supply_present; absent on most virtual machines.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "state (1 = OK)", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "links": [], - "mappings": [ - { - "options": { - "0": { - "color": "red", - "index": 1, - "text": "DOWN" - }, - "1": { - "color": "green", - "index": 0, - "text": "OK" - } - }, - "type": "value" - } - ], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red" - }, - { - "color": "green", - "value": 0.5 - } - ] - }, - "unit": "bool_yes_no" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 757 - }, - "id": 345, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_power_supply_online{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{power_supply}} online", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_power_supply_present{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{power_supply}} present", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Power Supply Status", - "type": "timeseries" - } - ], - "title": "Hardware & Time", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 296, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Current number of systemd units in each operational state, such as active, failed, inactive, or transitioning", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Failed" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#F2495C", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Active" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#73BF69", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Activating" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#C8F2C2", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Deactivating" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Inactive" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-blue", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 4228 - }, - "id": 298, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"activating\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Activating", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"active\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Active", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"deactivating\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Deactivating", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"failed\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Failed", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"inactive\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Inactive", - "range": true, - "refId": "E", - "step": 240 - } - ], - "title": "Systemd Units State", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Current number of active connections per systemd socket, as reported by the Node Exporter systemd collector", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 4228 - }, - "id": 331, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_systemd_socket_current_connections{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{ name }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Systemd Sockets Current", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of accepted connections per second for each systemd socket", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 4238 - }, - "id": 297, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_systemd_socket_accepted_connections_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{ name }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Systemd Sockets Accepted", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of systemd socket connection refusals per second, typically due to service unavailability or backlog overflow", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 4238 - }, - "id": 332, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_systemd_socket_refused_connections_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{ name }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Systemd Sockets Refused", - "type": "timeseries" - } - ], - "title": "Systemd", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 27 - }, - "id": 270, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of I/O operations completed per second for the device (after merges), including both reads and writes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "iops" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 29 - }, - "id": 9, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk Read/Write IOps", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of bytes read from or written to the device per second", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 29 - }, - "id": 33, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "exemplar": false, - "expr": "rate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": false, - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk Read/Write Data", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Average time for requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "s" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 39 - }, - "id": 37, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_read_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / (rate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) > 0)", - "interval": "", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_write_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / (rate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) > 0)", - "interval": "", - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk Average Wait Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Percentage of time the disk spent actively processing I/O operations, including general I/O, discards (TRIM), and write cache flushes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 39 - }, - "id": 36, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - General IO", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_discard_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - Discard/TRIM", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_flush_requests_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - Flush (write cache)", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Time Spent Doing I/Os", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Average queue length of the requests that were issued to the device", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 49 - }, - "id": 35, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_io_time_weighted_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Average Queue Size", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of in-progress I/O requests at the time of sampling (active requests in the disk queue)", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 49 - }, - "id": 34, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_disk_io_now{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "{{device}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Instantaneous Queue Size", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of read and write requests merged per second that were queued to the device", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "write (\u2013) / read (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "iops" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Write.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 59 - }, - "id": 133, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_reads_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "legendFormat": "{{device}} - Read", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_writes_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "legendFormat": "{{device}} - Write", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Disk R/W Merged", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Per-second rate of discard (TRIM) and flush (write cache) operations. Useful for monitoring low-level disk activity on SSDs and advanced storage", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "ops" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 59 - }, - "id": 301, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_discards_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - Discards completed", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_discards_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - Discards merged", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_disk_flush_requests_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}} - Flush", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Disk Ops Discards / Flush", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Shows how many disk sectors are discarded (TRIMed) per second. Useful for monitoring SSD behavior and storage efficiency", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/sda.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 59 - }, - "id": 326, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_disk_discarded_sectors_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{device}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Disk Sectors Discarded Successfully", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of free file nodes (inodes) available per mounted filesystem. A low count may prevent file creation even if disk space is available", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 69 - }, - "id": 41, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filesystem_files_free{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "legendFormat": "{{mountpoint}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "File Nodes Free", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Indicates filesystems mounted in read-only mode or reporting device-level I/O errors.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bool_yes_no" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 69 - }, - "id": 44, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filesystem_readonly{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "legendFormat": "{{mountpoint}} - ReadOnly", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_filesystem_device_error{instance=\"$node\",job=\"$job\",fstype!~'rootfs|tmpfs'}", - "format": "time_series", - "interval": "", - "legendFormat": "{{mountpoint}} - Device error", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Filesystem in ReadOnly / Error", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of file nodes (inodes) available per mounted filesystem. Reflects maximum file capacity regardless of disk size", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 69 - }, - "id": 219, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_filesystem_files{instance=\"$node\",job=\"$job\",fstype!~'rootfs'}", - "format": "time_series", - "legendFormat": "{{mountpoint}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "File Nodes Size", - "type": "timeseries" - } - ], - "title": "Storage", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 28 - }, - "id": 272, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of network packets received and transmitted per second, by interface.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 31 - }, - "id": 60, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic by Packets", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of packet-level errors for each network interface. Receive errors may indicate physical or driver issues; transmit errors may reflect collisions or hardware faults", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 31 - }, - "id": 142, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of dropped packets per network interface. Receive drops can indicate buffer overflow or driver issues; transmit drops may result from outbound congestion or queuing limits", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 41 - }, - "id": 143, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic Drop", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of received packets that could not be processed due to missing protocol or handler in the kernel. May indicate unsupported traffic or misconfiguration", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 41 - }, - "id": 327, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_nohandler_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Network Traffic NoHandler", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of frame errors on received packets, typically caused by physical layer issues such as bad cables, duplex mismatches, or hardware problems", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 51 - }, - "id": 145, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_frame_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Network Traffic Frame", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks FIFO buffer overrun errors on network interfaces. These occur when incoming or outgoing packets are dropped due to queue or buffer overflows, often indicating congestion or hardware limits", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 51 - }, - "id": 144, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic Fifo", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of packet collisions detected during transmission. Mostly relevant on half-duplex or legacy Ethernet networks", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 61 - }, - "id": 232, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_transmit_colls_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Network Traffic Collision", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of carrier errors during transmission. These typically indicate physical layer issues like faulty cabling or duplex mismatches", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 61 - }, - "id": 231, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_transmit_carrier_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Network Traffic Carrier Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of compressed network packets received and transmitted per interface. These are common in low-bandwidth or special interfaces like PPP or SLIP", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 71 - }, - "id": 141, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_network_transmit_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Traffic Compressed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of incoming multicast packets received per network interface. Multicast is used by protocols such as mDNS, SSDP, and some streaming or cluster services", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 71 - }, - "id": 146, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_network_receive_multicast_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Rx in", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Network Traffic Multicast", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of ARP entries per interface. Useful for detecting excessive ARP traffic or table growth due to scanning or misconfiguration", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 81 - }, - "id": 230, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_arp_entries{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "{{ device }} ARP Table", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "ARP Entries", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Current and maximum connection tracking entries used by Netfilter (nf_conntrack). High usage approaching the limit may cause packet drops or connection issues", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "NF conntrack limit" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 81 - }, - "id": 61, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_nf_conntrack_entries{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "NF conntrack entries", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_nf_conntrack_entries_limit{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "NF conntrack limit", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "NF Conntrack", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of link-down transitions (flaps) per interface. Repeated flaps usually indicate a faulty cable, SFP, or switch port. The negative series shows link-down state: 0 when the carrier is present and -1 when it is absent.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "down (-) / flaps (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "links": [], - "mappings": [], - "min": -1, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Down state.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - }, - { - "id": "custom.lineWidth", - "value": 2 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 91 - }, - "id": 343, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": true, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "increase(node_network_carrier_down_changes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "{{device}} - Link flaps", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_network_carrier{instance=\"$node\",job=\"$job\"} - 1", - "format": "time_series", - "legendFormat": "{{device}} - Down state", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Network Link Flaps", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Maximum speed of each network interface as reported by the operating system. This is a static hardware capability, not current throughput. A value of -1 means unknown speed", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "fieldMinMax": false, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 91 - }, - "id": 280, - "options": { - "displayMode": "basic", - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "maxVizHeight": 30, - "minVizHeight": 16, - "minVizWidth": 8, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "manual", - "valueMode": "color" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_network_speed_bytes{instance=\"$node\",job=\"$job\"} * 8", - "format": "time_series", - "legendFormat": "{{ device }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Speed", - "type": "bargauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "MTU (Maximum Transmission Unit) in bytes for each network interface. Affects packet size and transmission efficiency", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 18, - "y": 91 - }, - "id": 288, - "options": { - "displayMode": "basic", - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "maxVizHeight": 30, - "minVizHeight": 16, - "minVizWidth": 8, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "manual", - "valueMode": "color" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_network_mtu_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "{{ device }}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "MTU", - "type": "bargauge" - } - ], - "title": "Network Traffic", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 29 - }, - "id": 273, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks TCP socket usage per node", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 32 - }, - "id": 63, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_TCP_alloc{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 Allocated Sockets", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_TCP_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 In-Use Sockets", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_TCP_orphan{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 Orphaned Sockets", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_TCP_tw{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 TIME_WAIT Sockets", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_TCP6_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "IPv6 In-Use Sockets", - "range": true, - "refId": "E", - "step": 240 - } - ], - "title": "Sockstat TCP", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of UDP and UDPLite sockets currently in use", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 32 - }, - "id": 124, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_UDPLITE_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDPLite - In-Use Sockets", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDP_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP - In-Use Sockets", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDPLITE6_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "IPv6 UDPLite - In-Use Sockets", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDP6_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "IPv6 UDP - In-Use Sockets", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Sockstat UDP", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Total number of sockets currently in use across all protocols (TCP, UDP, UNIX, etc.), as reported by /proc/net/sockstat", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 42 - }, - "id": 126, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_sockets_used{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Total sockets", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Sockstat Used", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of FRAG and RAW sockets currently in use. RAW sockets are used for custom protocols or tools like ping; FRAG sockets are used internally for IP packet defragmentation", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 42 - }, - "id": 125, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_FRAG_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 FRAG - In-Use Sockets", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_RAW_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 RAW - In-Use Sockets", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_FRAG6_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "IPv6 FRAG - In-Use Sockets", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_RAW6_inuse{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "IPv6 RAW - In-Use Sockets", - "range": true, - "refId": "E", - "step": 240 - } - ], - "title": "Sockstat FRAG / RAW", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Kernel memory used by TCP, UDP, and IP fragmentation buffers", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 52 - }, - "id": 220, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_TCP_mem_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "TCP", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDP_mem_bytes{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "UDP", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_FRAG_memory{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Fragmentation", - "range": true, - "refId": "C" - } - ], - "title": "Sockstat Memory Size", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Average memory used per socket (TCP/UDP). Helps tune net.ipv4.tcp_rmem / tcp_wmem", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 52 - }, - "id": 339, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_TCP_mem_bytes{instance=\"$node\",job=\"$job\"} / (node_sockstat_TCP_inuse{instance=\"$node\",job=\"$job\"} > 0)", - "format": "time_series", - "interval": "", - "legendFormat": "TCP", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDP_mem_bytes{instance=\"$node\",job=\"$job\"} / (node_sockstat_UDP_inuse{instance=\"$node\",job=\"$job\"} > 0)", - "format": "time_series", - "interval": "", - "legendFormat": "UDP", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Sockstat Average Socket Memory", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "TCP/UDP socket memory usage in kernel (in pages)", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 52 - }, - "id": 336, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_sockstat_TCP_mem{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "TCP", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_sockstat_UDP_mem{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "UDP", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "TCP/UDP Kernel Buffer Memory Pages", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Packets processed and dropped by the softnet network stack per CPU. Drops may indicate CPU saturation or network driver limitations", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "drop (-) / process (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Dropped.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 62 - }, - "id": 290, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_softnet_processed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}} - Processed", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_softnet_dropped_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}} - Dropped", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Softnet Packets", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "How often the kernel was unable to process all packets in the softnet queue before time ran out. Frequent squeezes may indicate CPU contention or driver inefficiency", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 62 - }, - "id": 310, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_softnet_times_squeezed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}} - Times Squeezed", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Softnet Out of Quota", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Times each CPU was woken up by Receive Packet Steering (RPS) to process packets steered from other CPUs, and packets dropped for exceeding the flow limit", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Dropped.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 62 - }, - "id": 330, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_softnet_received_rps_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}} - RPS Wakeups", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_softnet_flow_limit_count_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "CPU {{cpu}} - Dropped", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Softnet RPS", - "type": "timeseries" - } - ], - "title": "Network Sockstat", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 30 - }, - "id": 274, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of octets sent and received at the IP layer, as reported by /proc/net/netstat", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 163 - }, - "id": 221, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "width": 300 - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_IpExt_InOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_IpExt_OutOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv4 Tx out", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Ip6_InOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 Rx in", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Ip6_OutOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 Tx out", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "Netstat IP In / Out Octets", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of TCP segments sent and received per second, including data and control segments", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 173 - }, - "id": 299, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_InSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "instant": false, - "interval": "", - "legendFormat": "TCP Rx in", - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_OutSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "TCP Tx out", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "TCP In / Out", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of UDP datagrams sent and received per second, based on /proc/net/snmp", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 183 - }, - "id": 55, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_InDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_OutDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Tx out", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_InDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP Rx in", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_OutDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP Tx out", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "UDP In / Out", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of ICMP messages sent and received per second, including error and control messages", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "out (-) / in (+)", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "pps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*out.*/" - }, - "properties": [ - { - "id": "custom.transform", - "value": "negative-Y" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 193 - }, - "id": 115, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp_InMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 ICMP Rx in", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp_OutMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 ICMP Tx out", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp6_InMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 ICMP Rx in", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp6_OutMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 ICMP Tx out", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "ICMP In / Out", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks various TCP error and congestion-related events, including retransmissions, timeouts, dropped connections, and buffer issues", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 173 - }, - "id": 104, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_ListenOverflows{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "Listen Overflows", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_ListenDrops{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "Listen Drops", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_TCPSynRetrans{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "SYN Retransmits", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_RetransSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "Segment Retransmits", - "range": true, - "refId": "D" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_InErrs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "Receive Errors", - "range": true, - "refId": "E" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_OutRsts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "RST Sent", - "range": true, - "refId": "F" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_TCPRcvQDrop{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "Receive Queue Drops", - "range": true, - "refId": "G" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_TCPOFOQueue{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "Out-of-order Queued", - "range": true, - "refId": "H" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_TCPTimeouts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "TCP Timeouts", - "range": true, - "refId": "I" - } - ], - "title": "TCP Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of UDP and UDPLite datagram delivery errors, including missing listeners, buffer overflows, and protocol-specific issues", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 183 - }, - "id": 109, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Rx in Errors", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_NoPorts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP No Listener", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_UdpLite_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "interval": "", - "legendFormat": "IPv4 UDPLite Rx in Errors", - "range": true, - "refId": "C" - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_RcvbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Rx in Buffer Errors", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp_SndbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Tx out Buffer Errors", - "range": true, - "refId": "E", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP Rx in Errors", - "range": true, - "refId": "F", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_NoPorts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP No Listener", - "range": true, - "refId": "G", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_UdpLite6_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDPLite Rx in Errors", - "range": true, - "refId": "H", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_RcvbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP Rx in Buffer Errors", - "range": true, - "refId": "I", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Udp6_SndbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 UDP Tx out Buffer Errors", - "range": true, - "refId": "J", - "step": 240 - } - ], - "title": "UDP Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of incoming ICMP messages that contained protocol-specific errors, such as bad checksums or invalid lengths", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 193 - }, - "id": 50, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 ICMP Rx In", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Icmp6_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "legendFormat": "IPv6 ICMP Rx In", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "ICMP Errors", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of TCP SYN cookies sent, validated, and failed. These are used to protect against SYN flood attacks and manage TCP handshake resources under load", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "eps" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Failed.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 203 - }, - "id": 91, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_SyncookiesFailed{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "SYN Cookies Failed", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_SyncookiesRecv{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "SYN Cookies Validated", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_TcpExt_SyncookiesSent{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "SYN Cookies Sent", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "TCP SynCookie", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of currently established TCP connections", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 163 - }, - "id": 85, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_netstat_Tcp_CurrEstab{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Current Connections", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "TCP Connections", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Memory currently queued in the UDP receive (RX) and transmit (TX) buffers. A growing queue may indicate a bottleneck", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 203 - }, - "id": 337, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_udp_queues{instance=\"$node\",job=\"$job\",ip=\"v4\",queue=\"rx\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Rx in Queue", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_udp_queues{instance=\"$node\",job=\"$job\",ip=\"v4\",queue=\"tx\"}", - "format": "time_series", - "interval": "", - "legendFormat": "IPv4 UDP Tx out Queue", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_udp_queues{instance=\"$node\",job=\"$job\",ip=\"v6\",queue=\"rx\"}", - "format": "time_series", - "legendFormat": "IPv6 UDP Rx in Queue", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_udp_queues{instance=\"$node\",job=\"$job\",ip=\"v6\",queue=\"tx\"}", - "format": "time_series", - "legendFormat": "IPv6 UDP Tx out Queue", - "range": true, - "refId": "D", - "step": 240 - } - ], - "title": "UDP Queue", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of TCP connection initiations per second. 'Active' opens are initiated by this host. 'Passive' opens are accepted from incoming connections", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 203 - }, - "id": 82, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_ActiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "Active Opens", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "rate(node_netstat_Tcp_PassiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "Passive Opens", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "TCP Direct Transition", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of TCP sockets in key connection states. Requires the --collector.tcpstat flag on node_exporter", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 213 - }, - "id": 320, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"established\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Established", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"fin_wait2\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "FIN_WAIT2", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"listen\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "Listen", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"time_wait\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "TIME_WAIT", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"close_wait\", instance=\"$node\", job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "CLOSE_WAIT", - "range": true, - "refId": "E", - "step": 240 - } - ], - "title": "TCP Stat Persistent", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Transient TCP connection states. These are typically short-lived during connection establishment and teardown", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 8, - "y": 213 - }, - "id": 341, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"syn_sent\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "SYN_SENT", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"syn_recv\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "SYN_RECV", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"fin_wait1\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "FIN_WAIT1", - "range": true, - "refId": "C", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"close\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "CLOSE", - "range": true, - "refId": "D", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"last_ack\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "LAST_ACK", - "range": true, - "refId": "E", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"closing\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "CLOSING", - "range": true, - "refId": "F", - "step": 240 - } - ], - "title": "TCP Stat Transient", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "TCP socket queue sizes. High rx_queued_bytes indicates application not reading fast enough. High tx_queued_bytes indicates network congestion or slow receiver", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 16, - "y": 213 - }, - "id": 340, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"rx_queued_bytes\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "RX Queued (waiting to be read)", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "node_tcp_connection_states{state=\"tx_queued_bytes\",instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "legendFormat": "TX Queued (waiting to be sent)", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "TCP Socket Queue", - "type": "timeseries" - } - ], - "title": "Network Netstat", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 31 - }, - "id": 279, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Duration of each individual collector executed during a Node Exporter scrape. Useful for identifying slow or failing collectors", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 164 - }, - "id": 40, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_scrape_collector_duration_seconds{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{collector}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Node Exporter Scrape Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Rate of CPU time used by the process exposing this metric (user + system mode)", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 164 - }, - "id": 308, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "rate(process_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", - "format": "time_series", - "interval": "", - "legendFormat": "Process CPU Usage", - "range": true, - "refId": "A", - "step": 240 - } - ], - "title": "Exporter Process CPU Usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Tracks the memory usage of the process exposing this metric (e.g., node_exporter), including resident memory (RSS), current virtual memory and maximum virtual memory limit. The limit is shown in the legend and tooltip but hidden from the graph to preserve scale.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Virtual Memory Limit" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - }, - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Virtual Memory Limit" - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 10, - "x": 0, - "y": 174 - }, - "id": 149, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "process_virtual_memory_bytes{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Virtual Memory", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "process_virtual_memory_max_bytes{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Virtual Memory Limit", - "range": true, - "refId": "B", - "step": 240 - }, - { - "editorMode": "code", - "expr": "process_resident_memory_bytes{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Resident Memory (RSS)", - "range": true, - "refId": "C", - "step": 240 - } - ], - "title": "Exporter Processes Memory", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Number of file descriptors used by the exporter process versus its configured limit. The limit is shown in the legend and tooltip but hidden from the graph to preserve scale.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Max.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Maximum open file descriptors" - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 10, - "x": 10, - "y": 174 - }, - "id": 64, - "options": { - "legend": { - "calcs": [ - "min", - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "process_max_fds{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Maximum open file descriptors", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "process_open_fds{instance=\"$node\",job=\"$job\"}", - "interval": "", - "legendFormat": "Open file descriptors", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Exporter File Descriptor Usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "description": "Shows whether each Node Exporter collector scraped successfully (1 = success, 0 = failure), and whether the textfile collector returned an error.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "dark-red", - "value": 0 - }, - { - "color": "green", - "value": 1 - } - ] - }, - "unit": "bool" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 4, - "x": 20, - "y": 174 - }, - "id": 157, - "options": { - "displayMode": "basic", - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "maxVizHeight": 300, - "minVizHeight": 16, - "minVizWidth": 8, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "auto", - "valueMode": "color" - }, - "pluginVersion": "11.6.1", - "targets": [ - { - "editorMode": "code", - "expr": "node_scrape_collector_success{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "{{collector}}", - "range": true, - "refId": "A", - "step": 240 - }, - { - "editorMode": "code", - "expr": "1 - node_textfile_scrape_error{instance=\"$node\",job=\"$job\"}", - "format": "time_series", - "interval": "", - "legendFormat": "textfile", - "range": true, - "refId": "B", - "step": 240 - } - ], - "title": "Node Exporter Scrape", - "type": "bargauge" - } - ], - "title": "Node Exporter", - "type": "row" - } - ], - "refresh": "1m", - "schemaVersion": 41, - "tags": [ - "linux" - ], - "templating": { - "list": [ - { - "current": {}, - "includeAll": false, - "label": "Datasource", - "name": "ds_prometheus", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "definition": "", - "includeAll": false, - "label": "Job", - "name": "job", - "options": [], - "query": { - "query": "label_values(node_uname_info, job)", - "refId": "Prometheus-job-Variable-Query" - }, - "refresh": 1, - "regex": "", - "sort": 1, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "definition": "label_values(node_uname_info{job=\"$job\"}, nodename)", - "includeAll": false, - "label": "Nodename", - "name": "nodename", - "options": [], - "query": { - "query": "label_values(node_uname_info{job=\"$job\"}, nodename)", - "refId": "Prometheus-nodename-Variable-Query" - }, - "refresh": 1, - "regex": "", - "sort": 1, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${ds_prometheus}" - }, - "definition": "label_values(node_uname_info{job=\"$job\", nodename=\"$nodename\"}, instance)", - "includeAll": false, - "label": "Instance", - "name": "node", - "options": [], - "query": { - "query": "label_values(node_uname_info{job=\"$job\", nodename=\"$nodename\"}, instance)", - "refId": "Prometheus-node-Variable-Query" - }, - "refresh": 1, - "regex": "", - "sort": 1, - "type": "query" - } - ] - }, - "time": { - "from": "now-24h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Node Exporter Full", - "uid": "gnet-1860", - "version": 105, - "weekStart": "", - "gnetId": 1860 -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/Logs/logs.json b/ansible/roles/monitoring/files/dashboards/Logs/logs.json deleted file mode 100644 index 5f78183..0000000 --- a/ansible/roles/monitoring/files/dashboards/Logs/logs.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "annotations": { - "list": [ - { - "$$hashKey": "object:75", - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Log Viewer Dashboard for Loki", - "editable": false, - "gnetId": 13639, - "graphTooltip": 0, - "id": null, - "iteration": 1608932746420, - "links": [ - { - "$$hashKey": "object:59", - "icon": "bolt", - "includeVars": true, - "keepTime": true, - "tags": [], - "targetBlank": true, - "title": "View In Explore", - "type": "link", - "url": "/explore?orgId=1&left=[\"now-1h\",\"now\",\"Loki\",{\"expr\":\"{job=\\\"$app\\\"}\"},{\"ui\":[true,true,true,\"none\"]}]" - }, - { - "$$hashKey": "object:61", - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "Learn LogQL", - "type": "link", - "url": "https://grafana.com/docs/loki/latest/logql/" - } - ], - "panels": [ - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": "loki", - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 3, - "w": 24, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.0", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(count_over_time({job=\"$app\"} |= \"$search\" [$__interval]))", - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:168", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - }, - { - "$$hashKey": "object:169", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "datasource": "loki", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "gridPos": { - "h": 25, - "w": 24, - "x": 0, - "y": 3 - }, - "id": 2, - "maxDataPoints": "", - "options": { - "showLabels": false, - "showTime": true, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "targets": [ - { - "expr": "{job=\"$app\"} |= \"$search\" | logfmt", - "hide": false, - "legendFormat": "", - "refId": "A" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "", - "transparent": true, - "type": "logs" - } - ], - "refresh": false, - "schemaVersion": 26, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": {}, - "datasource": "loki", - "definition": "label_values(job)", - "hide": 0, - "includeAll": false, - "label": "App", - "multi": false, - "name": "app", - "options": [], - "query": "label_values(job)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": { - "selected": false, - "text": "", - "value": "" - }, - "hide": 0, - "label": "String Match", - "name": "search", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "skipUrlSync": false, - "type": "textbox" - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "hidden": false, - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Logs / App", - "uid": "gnet-13639", - "version": 13 -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/Security/security.json b/ansible/roles/monitoring/files/dashboards/Security/security.json deleted file mode 100644 index 3e7fbe3..0000000 --- a/ansible/roles/monitoring/files/dashboards/Security/security.json +++ /dev/null @@ -1,2168 +0,0 @@ -{ - "uid": "asxpio-security", - "title": "Security", - "tags": [ - "asxpio", - "security" - ], - "timezone": "browser", - "editable": false, - "refresh": "1m", - "time": { - "from": "now-24h", - "to": "now" - }, - "schemaVersion": 39, - "graphTooltip": 1, - "links": [ - { - "title": "Dashboards", - "type": "dashboards", - "asDropdown": true, - "includeVars": false, - "keepTime": true, - "tags": [] - } - ], - "panels": [ - { - "type": "row", - "title": "Unexpected (each of these alerts)", - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "panels": [], - "id": 1 - }, - { - "type": "stat", - "title": "WireGuard peers", - "description": "Peers not in wireguard_clients", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "count(security_wg_peer_info{known=\"false\"}) or vector(0)", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 0, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 2 - }, - { - "type": "stat", - "title": "VPC devices, servers", - "description": "Addresses answering ping on the private network that are not in security_vpc_hosts, plus servers in the Hetzner project that are not in monitoring_hcloud_servers", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "(count(group by (ip) (security_vpc_host_info{known=\"false\"})) or vector(0)) + (count(up{job=\"hcloud\",known=\"false\"}) or vector(0))", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 3, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 3 - }, - { - "type": "stat", - "title": "Accounts", - "description": "Login accounts, and members of sudo or docker, outside the baseline", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "count(security_user_info{known=\"false\"} or security_group_member_info{known=\"false\"}) or vector(0)", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 6, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 4 - }, - { - "type": "stat", - "title": "Listening ports", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "count(security_listening_port_info{known=\"false\"}) or vector(0)", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 9, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 5 - }, - { - "type": "stat", - "title": "Containers", - "description": "Privileged, host network or PID, host root or the Docker socket, outside the baseline", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "count(security_container_privileged_info{known=\"false\"}) or vector(0)", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 12, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 6 - }, - { - "type": "stat", - "title": "File changes (24 h)", - "description": "accounts, sudoers, sshd, wireguard, authorized_keys", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(changes(security_fileset_hash[24h]))", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 15, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 7 - }, - { - "type": "stat", - "title": "SSH logins (24 h)", - "description": "", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum(count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Accepted \\S+ for ` [24h]))", - "refId": "A", - "instant": true, - "range": false, - "queryType": "instant" - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 18, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 8 - }, - { - "type": "stat", - "title": "Failed SSH (24 h)", - "description": "", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum(count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Failed \\S+ for |Invalid user |Connection closed by (authenticating|invalid) user ` [24h]))", - "refId": "A", - "instant": true, - "range": false, - "queryType": "instant" - } - ], - "gridPos": { - "h": 4, - "w": 3, - "x": 21, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "noValue": "0", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value" - }, - "id": 9 - }, - { - "type": "row", - "title": "Networks", - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 5 - }, - "panels": [], - "id": 10 - }, - { - "type": "table", - "title": "WireGuard peers", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_wg_peer_last_handshake_seconds * 1000 * on (host, interface, peer) group_left (allowed_ips, known) security_wg_peer_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 10, - "x": 0, - "y": 6 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "last handshake" - }, - { - "id": "unit", - "value": "dateTimeFromNow" - }, - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "0": { - "text": "never" - } - } - } - ] - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "interface": 1, - "peer": 2, - "allowed_ips": 3, - "known": 4, - "Value": 5 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 11 - }, - { - "type": "table", - "title": "WireGuard endpoints", - "description": "Where each peer last connected from. A network (/16) not seen for that peer in 14 days alerts.", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_wg_peer_endpoint_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 7, - "x": 10, - "y": 6 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "peer": 1, - "endpoint": 2, - "net": 3 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 12 - }, - { - "type": "table", - "title": "Private network (VPC) devices", - "description": "Ping sweep of the VPC from both hosts, every minute. A device that drops ICMP is not seen.", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "group by (ip, known) (security_vpc_host_info)", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 7, - "x": 17, - "y": 6 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "ip": 0, - "known": 1 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 13 - }, - { - "type": "table", - "title": "Hetzner project servers", - "description": "Servers the Hetzner API lists for the project, refreshed every minute. Catches a server that drops ping or is not attached to the VPC.", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "group by (server, type, status, public_ip, private_ip, known) (up{job=\"hcloud\"})", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 4, - "w": 24, - "x": 0, - "y": 14 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "server": 0, - "type": 1, - "status": 2, - "public_ip": 3, - "private_ip": 4, - "known": 5 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 31 - }, - { - "type": "table", - "title": "Listening ports", - "description": "Outside loopback. Known entries show the allowlist entry (a range or *), others the port.", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_listening_port_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 18 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "sockets" - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "scope": 1, - "proto": 2, - "port": 3, - "process": 4, - "known": 5, - "Value": 6 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 14 - }, - { - "type": "row", - "title": "Accounts and keys", - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 27 - }, - "panels": [], - "id": 15 - }, - { - "type": "table", - "title": "Login accounts", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_user_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 28 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "user": 1, - "uid": 2, - "shell": 3, - "known": 4 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 16 - }, - { - "type": "table", - "title": "sudo and docker members", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_group_member_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 6, - "x": 8, - "y": 28 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "group": 1, - "user": 2, - "known": 3 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 17 - }, - { - "type": "table", - "title": "authorized_keys", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_authorized_keys", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 8, - "w": 10, - "x": 14, - "y": 28 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "keys" - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "user": 1, - "file": 2, - "Value": 3 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 18 - }, - { - "type": "table", - "title": "Watched files: last change", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_fileset_mtime_seconds * 1000", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 36 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "changed" - }, - { - "id": "unit", - "value": "dateTimeFromNow" - }, - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "0": { - "text": "never" - } - } - } - ] - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "set": 1, - "Value": 2 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 19 - }, - { - "type": "table", - "title": "Open sessions", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_sessions", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 7, - "w": 6, - "x": 8, - "y": 36 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "sessions" - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "user": 1, - "origin": 2, - "Value": 3 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 20 - }, - { - "type": "table", - "title": "Containers with host access", - "description": "", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_container_privileged_info", - "refId": "A", - "instant": true, - "range": false, - "format": "table" - } - ], - "gridPos": { - "h": 7, - "w": 10, - "x": 14, - "y": 36 - }, - "fieldConfig": { - "defaults": { - "custom": { - "filterable": true - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "known" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "type": "value", - "options": { - "true": { - "text": "yes", - "color": "green" - }, - "false": { - "text": "NO", - "color": "red" - } - } - } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "__name__": true, - "instance": true, - "job": true - }, - "indexByName": { - "host": 0, - "name": 1, - "flags": 2, - "known": 3 - } - } - } - ], - "options": { - "showHeader": true, - "cellHeight": "sm" - }, - "id": 21 - }, - { - "type": "row", - "title": "SSH", - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 43 - }, - "panels": [], - "id": 22 - }, - { - "type": "timeseries", - "title": "Logins by user and source", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum by (host, user, src) (count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Accepted \\S+ for ` | regexp `Accepted \\S+ for (?P\\S+) from (?P\\S+)` [$__interval]))", - "legendFormat": "{{host}}: {{user}} from {{src}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "drawStyle": "bars", - "fillOpacity": 60, - "stacking": { - "mode": "normal" - } - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "id": 23 - }, - { - "type": "timeseries", - "title": "Failed logins", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum by (host) (count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Failed \\S+ for |Invalid user |Connection closed by (authenticating|invalid) user ` [$__interval]))", - "legendFormat": "{{host}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "drawStyle": "bars", - "fillOpacity": 60, - "stacking": { - "mode": "normal" - } - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "id": 24 - }, - { - "type": "logs", - "title": "Logins", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "{job=\"journal\", unit=\"ssh.service\"} |~ `Accepted \\S+ for `", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 51 - }, - "options": { - "showTime": true, - "showLabels": false, - "wrapLogMessage": true, - "sortOrder": "Descending", - "enableLogDetails": true - }, - "id": 25 - }, - { - "type": "logs", - "title": "sudo, su and account changes", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "{job=\"journal\"} |~ `sudo:.*COMMAND|su\\[\\d+\\]|useradd|usermod|userdel|groupadd|gpasswd|chpasswd|passwd\\[\\d+\\]`", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 51 - }, - "options": { - "showTime": true, - "showLabels": false, - "wrapLogMessage": true, - "sortOrder": "Descending", - "enableLogDetails": true - }, - "id": 26 - }, - { - "type": "row", - "title": "Forgejo and web logins", - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 60 - }, - "panels": [], - "id": 27 - }, - { - "type": "stat", - "title": "Forgejo", - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "Growth in users, admins, keys or runners alerts.", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "security_forgejo_objects", - "legendFormat": "{{kind}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 61 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "fixed", - "fixedColor": "blue" - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name" - }, - "id": 28 - }, - { - "type": "timeseries", - "title": "Failed web logins", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum(count_over_time({container=\"forgejo\"} |= `Failed authentication attempt` [$__interval]))", - "legendFormat": "Forgejo", - "refId": "A", - "instant": false, - "range": true - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum(count_over_time({job=\"traefik-access\"} |= `\"grafana@docker\"` |~ `\"POST /login HTTP/[0-9.]+\" 401 ` [$__interval]))", - "legendFormat": "Grafana", - "refId": "B", - "instant": false, - "range": true - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum(count_over_time({job=\"traefik-access\"} |= `\"asxpio@docker\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [$__interval]))", - "legendFormat": "asxp.io admin", - "refId": "C", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 7, - "w": 16, - "x": 8, - "y": 61 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "drawStyle": "bars", - "fillOpacity": 60, - "stacking": { - "mode": "normal" - } - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "id": 29 - }, - { - "type": "logs", - "title": "Failed web logins", - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "{container=\"forgejo\"} |= `Failed authentication attempt`", - "refId": "A", - "instant": false, - "range": true - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "{job=\"traefik-access\"} |~ `\"POST /(admin/)?login HTTP/[0-9.]+\" (401|429) `", - "refId": "B", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 68 - }, - "options": { - "showTime": true, - "showLabels": false, - "wrapLogMessage": true, - "sortOrder": "Descending", - "enableLogDetails": true - }, - "id": 30 - } - ] -} diff --git a/ansible/roles/monitoring/files/dashboards/Services/crawlers.json b/ansible/roles/monitoring/files/dashboards/Services/crawlers.json deleted file mode 100644 index 88a1783..0000000 --- a/ansible/roles/monitoring/files/dashboards/Services/crawlers.json +++ /dev/null @@ -1,1148 +0,0 @@ -{ - "uid": "asxpio-crawlers", - "title": "AI crawlers", - "tags": [ - "asxpio", - "traefik" - ], - "timezone": "browser", - "editable": false, - "refresh": "5m", - "time": { - "from": "now-24h", - "to": "now" - }, - "schemaVersion": 39, - "graphTooltip": 1, - "links": [ - { - "title": "Dashboards", - "type": "dashboards", - "asDropdown": true, - "includeVars": false, - "keepTime": true, - "tags": [] - } - ], - "panels": [ - { - "type": "piechart", - "title": "Who is asking (time range)", - "id": 1, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=\"verified\"}[$__range]))", - "legendFormat": "AI · verified", - "refId": "A", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=\"spoofed\"}[$__range]))", - "legendFormat": "AI · spoofed", - "refId": "B", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=~\"unknown|proxied|private\"}[$__range]))", - "legendFormat": "AI · unverifiable", - "refId": "C", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"other-bot\"}[$__range]))", - "legendFormat": "other bots", - "refId": "D", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"browser-like\"}[$__range]))", - "legendFormat": "browser-like", - "refId": "E", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"none\"}[$__range]))", - "legendFormat": "no user agent", - "refId": "F", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 8, - "w": 6, - "x": 0, - "y": 0 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "proxied" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "blue" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "unknown" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "private" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · unverifiable" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "other bots" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "orange" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "browser-like" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "no user agent" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "text" - } - } - ] - } - ] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "pieType": "donut", - "legend": { - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "value", - "percent" - ] - }, - "tooltip": { - "mode": "single" - } - }, - "description": "From the Traefik access log, every router (crawler-alert.py --metrics, 5-minute timer). A request naming an AI bot counts as verified only if its source IP is in the vendor's published ranges, or passes forward-confirmed reverse DNS, or (Meta) sits in the vendor's own ASN. spoofed = the claim failed that check; unverifiable = via Cloudflare, no PTR, or over the DNS budget." - }, - { - "type": "timeseries", - "title": "AI crawler requests by verdict (per minute)", - "id": 2, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (verdict) (rate(crawler_ai_requests_total[$__rate_interval])) * 60", - "legendFormat": "{{verdict}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 9, - "x": 6, - "y": 0 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short", - "custom": { - "stacking": { - "mode": "normal" - }, - "fillOpacity": 40, - "lineWidth": 1 - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "proxied" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "blue" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "unknown" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "private" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · unverifiable" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "other bots" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "orange" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "browser-like" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "no user agent" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "text" - } - } - ] - } - ] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "description": "From the Traefik access log, every router (crawler-alert.py --metrics, 5-minute timer). A request naming an AI bot counts as verified only if its source IP is in the vendor's published ranges, or passes forward-confirmed reverse DNS, or (Meta) sits in the vendor's own ASN. spoofed = the claim failed that check; unverifiable = via Cloudflare, no PTR, or over the DNS budget." - }, - { - "type": "bargauge", - "title": "Verified AI crawlers by vendor (time range)", - "id": 3, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sort_desc(sum by (vendor) (increase(crawler_ai_requests_total{verdict=\"verified\"}[$__range])))", - "legendFormat": "{{vendor}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 8, - "w": 9, - "x": 15, - "y": 0 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "unit": "short", - "decimals": 0, - "min": 0 - }, - "overrides": [] - }, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - } - }, - { - "type": "stat", - "title": "Spoofed share of AI claims", - "id": 4, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=\"spoofed\"}[$__range])) / sum(increase(crawler_ai_requests_total[$__range]))", - "legendFormat": "spoofed", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 5, - "w": 6, - "x": 0, - "y": 8 - }, - "fieldConfig": { - "defaults": { - "unit": "percentunit", - "decimals": 1, - "color": { - "mode": "thresholds" - }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 0.25 - }, - { - "color": "red", - "value": 0.5 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "stat", - "title": "Served to verified AI crawlers", - "id": 5, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_verified_bytes_total[$__range]))", - "legendFormat": "bytes", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 5, - "w": 6, - "x": 6, - "y": 8 - }, - "fieldConfig": { - "defaults": { - "unit": "bytes", - "color": { - "mode": "fixed", - "fixedColor": "green" - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "stat", - "title": "All requests (time range)", - "id": 6, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_requests_total[$__range]))", - "legendFormat": "requests", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 5, - "w": 6, - "x": 12, - "y": 8 - }, - "fieldConfig": { - "defaults": { - "unit": "short", - "decimals": 0, - "color": { - "mode": "fixed", - "fixedColor": "text" - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "stat", - "title": "Collector last ran", - "id": 7, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "time() - crawler_metrics_last_run_timestamp_seconds", - "legendFormat": "ago", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 5, - "w": 6, - "x": 18, - "y": 8 - }, - "fieldConfig": { - "defaults": { - "unit": "s", - "decimals": 0, - "color": { - "mode": "thresholds" - }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 900 - }, - { - "color": "red", - "value": 3600 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "timeseries", - "title": "Verified AI requests by vendor (per minute)", - "id": 8, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (vendor) (rate(crawler_ai_requests_total{verdict=\"verified\"}[$__rate_interval])) * 60", - "legendFormat": "{{vendor}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 13 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short", - "custom": { - "stacking": { - "mode": "normal" - }, - "fillOpacity": 40, - "lineWidth": 1 - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "timeseries", - "title": "Client classes (per minute)", - "id": 9, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(rate(crawler_ai_requests_total[$__rate_interval])) * 60", - "legendFormat": "AI-bot claims", - "refId": "A", - "instant": false, - "range": true - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (class) (rate(crawler_class_requests_total[$__rate_interval])) * 60", - "legendFormat": "{{class}}", - "refId": "B", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 13 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short", - "custom": { - "stacking": { - "mode": "normal" - }, - "fillOpacity": 40, - "lineWidth": 1 - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "table", - "title": "AI bots by verdict (time range)", - "id": 10, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (vendor, bot, verdict) (increase(crawler_ai_requests_total[$__range]))", - "legendFormat": "", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 11, - "w": 14, - "x": 0, - "y": 22 - }, - "fieldConfig": { - "defaults": { - "unit": "short", - "decimals": 0 - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "verified" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "spoofed" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "unknown" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "proxied" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "blue" - } - } - ] - } - ] - }, - "options": { - "showHeader": true, - "sortBy": [ - { - "displayName": "verified", - "desc": true - } - ], - "cellHeight": "sm" - }, - "transformations": [ - { - "id": "labelsToFields", - "options": {} - }, - { - "id": "groupingToMatrix", - "options": { - "columnField": "verdict", - "rowField": "bot", - "valueField": "Value" - } - }, - { - "id": "organize", - "options": { - "renameByName": { - "bot\\verdict": "bot" - } - } - } - ] - }, - { - "type": "bargauge", - "title": "Bandwidth to verified AI crawlers (time range)", - "id": 11, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sort_desc(sum by (vendor) (increase(crawler_ai_verified_bytes_total[$__range])))", - "legendFormat": "{{vendor}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 11, - "w": 10, - "x": 14, - "y": 22 - }, - "fieldConfig": { - "defaults": { - "unit": "bytes", - "color": { - "mode": "continuous-BlPu" - }, - "min": 0 - }, - "overrides": [] - }, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showUnfilled": true - } - } - ] -} diff --git a/ansible/roles/monitoring/files/dashboards/Services/postgres.json b/ansible/roles/monitoring/files/dashboards/Services/postgres.json deleted file mode 100644 index d54663d..0000000 --- a/ansible/roles/monitoring/files/dashboards/Services/postgres.json +++ /dev/null @@ -1,3131 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "This dashboard works with postgres_exporter for prometheus", - "editable": true, - "gnetId": 9628, - "graphTooltip": 0, - "id": null, - "iteration": 1568751813814, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 34, - "panels": [], - "title": "General Counters, CPU, Memory and File Descriptor Stats", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#299c46", - "#7eb26d", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 0, - "y": 1 - }, - "id": 36, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_static{release=\"$release\", instance=\"$instance\"}", - "format": "time_series", - "instant": true, - "intervalFactor": 1, - "legendFormat": "{{short_version}}", - "refId": "A" - } - ], - "thresholds": "", - "title": "Version", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "name" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "description": "start time of the process", - "format": "dateTimeFromNow", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 4, - "y": 1 - }, - "id": 28, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "110%", - "prefix": "", - "prefixFontSize": "110%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_postmaster_start_time_seconds{release=\"$release\", instance=\"$instance\"} * 1000", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "title": "Start Time", - "type": "singlestat", - "valueFontSize": "70%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "decbytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 8, - "y": 1 - }, - "height": "200px", - "id": 10, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "SUM(pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 4 - } - ], - "thresholds": "", - "title": "Current fetch data", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 12, - "y": 1 - }, - "height": "200px", - "id": 11, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "SUM(pg_stat_database_tup_inserted{release=\"$release\", datname=~\"$datname\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 4 - } - ], - "thresholds": "", - "title": "Current insert data", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "short", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 16, - "y": 1 - }, - "height": "200px", - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "SUM(pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "refId": "A", - "step": 4 - } - ], - "thresholds": "", - "title": "Current update data", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 20, - "y": 1 - }, - "id": 38, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_max_connections{release=\"$release\", instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Max Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "description": "Average user and system CPU time spent in seconds.", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 3 - }, - "id": 22, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(rate(process_cpu_seconds_total{release=\"$release\", instance=\"$instance\"}[5m]) * 1000)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "CPU Time", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Average CPU Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "description": "Virtual and Resident memory size in bytes, averages over 5 min interval", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 3 - }, - "id": 24, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(rate(process_resident_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Resident Mem", - "refId": "A" - }, - { - "expr": "avg(rate(process_virtual_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Virtual Mem", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Average Memory Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "description": "Number of open file descriptors", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 3 - }, - "id": 26, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "process_open_fds{release=\"$release\", instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "Open FD", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Open File Descriptors", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 32, - "panels": [], - "title": "Settings", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 0, - "y": 11 - }, - "id": 40, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_shared_buffers_bytes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Shared Buffers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 3, - "y": 11 - }, - "id": 42, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_effective_cache_size_bytes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Effective Cache", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 6, - "y": 11 - }, - "id": 44, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_maintenance_work_mem_bytes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Maintenance Work Mem", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 9, - "y": 11 - }, - "id": 46, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_work_mem_bytes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "", - "title": "Work Mem", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "decimals": 1, - "format": "bytes", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 12, - "y": 11 - }, - "id": 48, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_max_wal_size_bytes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Max WAL Size", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 3, - "x": 15, - "y": 11 - }, - "id": 50, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_random_page_cost{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Random Page Cost", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 2, - "x": 18, - "y": 11 - }, - "id": 52, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_seq_page_cost{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Seq Page Cost", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 2, - "x": 20, - "y": 11 - }, - "id": 54, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_max_worker_processes{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Max Worker Processes", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 2, - "x": 22, - "y": 11 - }, - "id": 56, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "pg_settings_max_parallel_workers{instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Max Parallel Workers", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 14 - }, - "id": 30, - "panels": [], - "title": "Database Stats", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 15 - }, - "id": 1, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "connected", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 3, - "points": true, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=\"active\"} !=0", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{datname}}, s: {{state}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Active sessions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "none", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 15 - }, - "id": 60, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(pg_stat_database_xact_commit{instance=\"$instance\", datname=~\"$datname\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}} commits", - "refId": "A" - }, - { - "expr": "irate(pg_stat_database_xact_rollback{instance=\"$instance\", datname=~\"$datname\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}} rollbacks", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Transactions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 15 - }, - "id": 8, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sideWidth": null, - "sort": "current", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Update data", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 22 - }, - "id": 5, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Fetch data (SELECT)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 22 - }, - "id": 6, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_tup_inserted{datname=~\"$datname\", instance=~\"$instance\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Insert data", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "decimals": 0, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 22 - }, - "id": 3, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "hideEmpty": false, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_locks_count{datname=~\"$datname\", instance=~\"$instance\", mode=~\"$mode\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}},{{mode}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Lock tables", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 29 - }, - "id": 14, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sort": "total", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_tup_returned{datname=~\"$datname\", instance=~\"$instance\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Return data", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 29 - }, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": false, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=~\"idle|idle in transaction|idle in transaction (aborted)\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}, s: {{state}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Idle sessions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 29 - }, - "id": 7, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "sort": "current", - "sortDesc": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_tup_deleted{datname=~\"$datname\", instance=~\"$instance\"} != 0", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{datname}}", - "refId": "A", - "step": 2 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Delete data", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "decimals": 2, - "fill": 1, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 36 - }, - "id": 62, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=~\"$datname\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{ datname }}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Cache Hit Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 4, - "format": "percentunit", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 36 - }, - "id": 64, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(pg_stat_bgwriter_buffers_backend_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "buffers_backend", - "refId": "A" - }, - { - "expr": "irate(pg_stat_bgwriter_buffers_alloc_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "buffers_alloc", - "refId": "B" - }, - { - "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "backend_fsync", - "refId": "C" - }, - { - "expr": "irate(pg_stat_bgwriter_buffers_checkpoint_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "buffers_checkpoint", - "refId": "D" - }, - { - "expr": "irate(pg_stat_bgwriter_buffers_clean_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "buffers_clean", - "refId": "E" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Buffers (bgwriter)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "decimals": 0, - "fill": 1, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 36 - }, - "id": 66, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(pg_stat_database_conflicts{instance=\"$instance\", datname=~\"$datname\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}} conflicts", - "refId": "B" - }, - { - "expr": "irate(pg_stat_database_deadlocks{instance=\"$instance\", datname=~\"$datname\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}} deadlocks", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Conflicts/Deadlocks", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "description": "Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.", - "fill": 1, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 43 - }, - "id": 68, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": true, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=~\"$datname\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{datname}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Temp File (Bytes)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 7, - "w": 16, - "x": 8, - "y": 43 - }, - "id": 70, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "irate(pg_stat_bgwriter_checkpoint_write_time_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "write_time - Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk.", - "refId": "B" - }, - { - "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time_total{instance=\"$instance\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "sync_time - Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk.", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Checkpoint Stats", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "10s", - "schemaVersion": 19, - "style": "dark", - "tags": [ - "postgres", - "db", - "stats" - ], - "templating": { - "list": [ - { - "hide": 0, - "label": "datasource", - "name": "DS_PROMETHEUS", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "auto": true, - "auto_count": 200, - "auto_min": "1s", - "current": { - "text": "auto", - "value": "$__auto_interval_interval" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": true, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "1s", - "value": "1s" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" - } - ], - "query": "1s,5s,1m,5m,1h,6h,1d", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - }, - { - "allValue": null, - "current": {}, - "datasource": "prometheus", - "definition": "", - "hide": 0, - "includeAll": false, - "label": "Namespace", - "multi": false, - "name": "namespace", - "options": [], - "query": "query_result(pg_exporter_last_scrape_duration_seconds)", - "refresh": 2, - "regex": "/.*kubernetes_namespace=\"([^\"]+).*/", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "prometheus", - "definition": "", - "hide": 0, - "includeAll": false, - "label": "Release", - "multi": false, - "name": "release", - "options": [], - "query": "query_result(pg_exporter_last_scrape_duration_seconds{kubernetes_namespace=\"$namespace\"})", - "refresh": 2, - "regex": "/.*release=\"([^\"]+)/", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "prometheus", - "definition": "", - "hide": 0, - "includeAll": false, - "label": "Instance", - "multi": false, - "name": "instance", - "options": [], - "query": "query_result(pg_up{release=\"$release\"})", - "refresh": 1, - "regex": "/.*instance=\"([^\"]+).*/", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "prometheus", - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Database", - "multi": true, - "name": "datname", - "options": [], - "query": "label_values(datname)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "prometheus", - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Lock table", - "multi": true, - "name": "mode", - "options": [], - "query": "label_values({mode=~\"accessexclusivelock|accesssharelock|exclusivelock|rowexclusivelock|rowsharelock|sharelock|sharerowexclusivelock|shareupdateexclusivelock\"}, mode)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "PostgreSQL Database", - "uid": "gnet-9628", - "version": 1 -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/Services/probes.json b/ansible/roles/monitoring/files/dashboards/Services/probes.json deleted file mode 100644 index 5b13374..0000000 --- a/ansible/roles/monitoring/files/dashboards/Services/probes.json +++ /dev/null @@ -1,1071 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Prometheus Blackbox Exporter Overview", - "editable": true, - "gnetId": 7587, - "graphTooltip": 0, - "id": null, - "iteration": 1534695504413, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "fill": 1, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 138, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "probe_duration_seconds{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "{{ instance }}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Global Probe Duration", - "tooltip": { - "shared": true, - "sort": 1, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 15, - "panels": [], - "repeat": "target", - "title": "$target status", - "type": "row" - }, - { - "cacheTimeout": null, - "colorBackground": true, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 0, - "y": 9 - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 3, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "probe_success{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "1,1", - "title": "Status", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - }, - { - "op": "=", - "text": "UP", - "value": "1" - }, - { - "op": "=", - "text": "DOWN", - "value": "0" - } - ], - "valueName": "current" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "fill": 1, - "gridPos": { - "h": 6, - "w": 10, - "x": 4, - "y": 9 - }, - "id": 25, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "probe_http_duration_seconds{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "{{ phase }}", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "HTTP Duration", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "fill": 1, - "gridPos": { - "h": 6, - "w": 10, - "x": 14, - "y": 9 - }, - "id": 17, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "repeat": null, - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "probe_duration_seconds{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "legendFormat": "seconds", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Probe Duration", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "decimals": 0, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 0, - "y": 11 - }, - "id": 20, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 3, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "probe_http_status_code{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "201, 399", - "title": "HTTP Status Code", - "transparent": false, - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - }, - { - "op": "=", - "text": "YES", - "value": "1" - }, - { - "op": "=", - "text": "N/A", - "value": "0" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 0, - "y": 13 - }, - "id": 27, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "probe_http_version{instance=~\"$target\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "HTTP Version", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 4, - "x": 0, - "y": 15 - }, - "id": 18, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 3, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "repeatDirection": "v", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "probe_http_ssl{instance=~\"$target\"}", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "0, 1", - "title": "SSL", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - }, - { - "op": "=", - "text": "YES", - "value": "1" - }, - { - "op": "=", - "text": "NO", - "value": "0" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "decimals": 2, - "format": "dtdurations", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 10, - "x": 4, - "y": 15 - }, - "id": 19, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "minSpan": 3, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "probe_ssl_earliest_cert_expiry{instance=~\"$target\"} - time()", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "0,1209600", - "timeFrom": null, - "title": "SSL Expiry", - "transparent": false, - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - }, - { - "op": "=", - "text": "YES", - "value": "1" - }, - { - "op": "=", - "text": "NO", - "value": "0" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "format": "s", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 5, - "x": 14, - "y": 15 - }, - "id": 23, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(probe_duration_seconds{instance=~\"$target\"})", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Average Probe Duration", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "format": "s", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 2, - "w": 5, - "x": 19, - "y": 15 - }, - "id": 24, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "repeat": null, - "repeatDirection": "h", - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(probe_dns_lookup_time_seconds{instance=~\"$target\"})", - "format": "time_series", - "interval": "$interval", - "intervalFactor": 1, - "refId": "A" - } - ], - "thresholds": "", - "title": "Average DNS Lookup", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - } - ], - "refresh": "10s", - "schemaVersion": 16, - "style": "dark", - "tags": [ - "blackbox", - "prometheus" - ], - "templating": { - "list": [ - { - "auto": true, - "auto_count": 10, - "auto_min": "10s", - "current": { - "text": "10s", - "value": "10s" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": true, - "text": "10s", - "value": "10s" - }, - { - "selected": false, - "text": "30s", - "value": "30s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "30m", - "value": "30m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" - }, - { - "selected": false, - "text": "7d", - "value": "7d" - }, - { - "selected": false, - "text": "14d", - "value": "14d" - }, - { - "selected": false, - "text": "30d", - "value": "30d" - } - ], - "query": "5s,10s,30s,1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", - "refresh": 2, - "type": "interval" - }, - { - "allValue": null, - "current": {}, - "datasource": "${DS_SIGNCL-PROMETHEUS}", - "hide": 0, - "includeAll": true, - "label": null, - "multi": true, - "name": "target", - "options": [], - "query": "label_values(probe_success, instance)", - "refresh": 1, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Prometheus Blackbox Exporter", - "uid": "gnet-7587", - "version": 2 -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/Services/traefik.json b/ansible/roles/monitoring/files/dashboards/Services/traefik.json deleted file mode 100644 index bde2f2a..0000000 --- a/ansible/roles/monitoring/files/dashboards/Services/traefik.json +++ /dev/null @@ -1,1527 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "description": "Official dashboard for Standalone Traefik", - "editable": false, - "fiscalYearStartMonth": 0, - "gnetId": 17346, - "graphTooltip": 0, - "id": null, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 9, - "panels": [], - "title": "General", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 5, - "x": 0, - "y": 1 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.3.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "count(traefik_config_reloads_total)", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Traefik Instances", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 7, - "x": 5, - "y": 1 - }, - "id": 7, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint=~\"$entrypoint\"}[$interval])) by (entrypoint)", - "legendFormat": "{{entrypoint}}", - "range": true, - "refId": "A" - } - ], - "title": "Requests per Entrypoint", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "https://medium.com/@tristan_96324/prometheus-apdex-alerting-d17a065e39d0", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "(sum(rate(traefik_entrypoint_request_duration_seconds_bucket{le=\"0.3\",code=\"200\",entrypoint=~\"$entrypoint\"}[$interval])) by (method) + \n sum(rate(traefik_entrypoint_request_duration_seconds_bucket{le=\"1.2\",code=\"200\",entrypoint=~\"$entrypoint\"}[$interval])) by (method)) / 2 / \n sum(rate(traefik_entrypoint_request_duration_seconds_count{code=\"200\",entrypoint=~\"$entrypoint\"}[$interval])) by (method)\n", - "legendFormat": "{{method}}", - "range": true, - "refId": "A" - } - ], - "title": "Apdex score", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "Mean Distribution", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 5, - "x": 0, - "y": 3 - }, - "id": 14, - "options": { - "legend": { - "displayMode": "list", - "placement": "right", - "showLegend": true, - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "multi", - "sort": "asc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_service_requests_total{service=~\"$service.*\",protocol=\"http\"}[$interval])) by (method, code)", - "legendFormat": "{{method}}[{{code}}]", - "range": true, - "refId": "A" - } - ], - "title": "Http Code ", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 23, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n traefik_service_request_duration_seconds_sum{service=~\"$service.*\",protocol=\"http\"} / \n traefik_service_request_duration_seconds_count{service=~\"$service.*\",protocol=\"http\"},\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)\n\n", - "legendFormat": "{{method}}[{{code}}] on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Top slow services", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 5, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,code) \n (rate(traefik_service_requests_total{service=~\"$service.*\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "[{{code}}] on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Most requested services", - "type": "timeseries" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 11, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 18 - }, - "id": 3, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "label_replace(\n 1 - (sum by (service)\n (rate(traefik_service_request_duration_seconds_bucket{le=\"1.2\",service=~\"$service.*\"}[$interval])) / sum by (service) \n (rate(traefik_service_request_duration_seconds_count{service=~\"$service.*\"}[$interval]))\n ) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\"\n)", - "legendFormat": "{{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Services failing SLO of 1200ms", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 18 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "label_replace(\n 1 - (sum by (service)\n (rate(traefik_service_request_duration_seconds_bucket{le=\"0.3\",service=~\"$service.*\"}[$interval])) / sum by (service) \n (rate(traefik_service_request_duration_seconds_count{service=~\"$service.*\"}[$interval]))\n ) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\"\n)", - "legendFormat": "{{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Services failing SLO of 300ms", - "type": "timeseries" - } - ], - "title": "SLO", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 18 - }, - "id": 16, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 8, - "x": 0, - "y": 19 - }, - "id": 17, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,method,code) \n (rate(traefik_service_requests_total{service=~\"$service.*\",code=~\"2..\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "{{method}}[{{code}}] on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "2xx over $interval", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 8, - "x": 8, - "y": 19 - }, - "id": 18, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,method,code) \n (rate(traefik_service_requests_total{service=~\"$service.*\",code=~\"5..\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "{{method}}[{{code}}] on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "5xx over $interval", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 8, - "x": 16, - "y": 19 - }, - "id": 19, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,method,code) \n (rate(traefik_service_requests_total{service=~\"$service.*\",code!~\"2..|5..\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "{{method}}[{{code}}] on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Other codes over $interval", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 31 - }, - "id": 20, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,method) \n (rate(traefik_service_requests_bytes_total{service=~\"$service.*\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "{{method}} on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Requests Size", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 31 - }, - "id": 24, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Mean", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "topk(15,\n label_replace(\n sum by (service,method) \n (rate(traefik_service_responses_bytes_total{service=~\"$service.*\",protocol=\"http\"}[$interval])) > 0,\n \"service\", \"$1\", \"service\", \"([^-]+-[^-]+).*\")\n)", - "legendFormat": "{{method}} on {{service}}", - "range": true, - "refId": "A" - } - ], - "title": "Responses Size", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 39 - }, - "id": 21, - "options": { - "legend": { - "calcs": [ - "mean", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "sortBy": "Max", - "sortDesc": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(traefik_open_connections{entrypoint=~\"$entrypoint\"}) by (entrypoint)\n", - "legendFormat": "{{entrypoint}}", - "range": true, - "refId": "A" - } - ], - "title": "Connections per Entrypoint", - "type": "timeseries" - } - ], - "title": "HTTP Details", - "type": "row" - } - ], - "refresh": false, - "schemaVersion": 37, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "multi": false, - "name": "DS_PROMETHEUS", - "label": "datasource", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "1m", - "current": { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - "hide": 0, - "name": "interval", - "options": [ - { - "selected": true, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "30m", - "value": "30m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "2h", - "value": "2h" - }, - { - "selected": false, - "text": "4h", - "value": "4h" - }, - { - "selected": false, - "text": "8h", - "value": "8h" - } - ], - "query": "1m,5m,10m,30m,1h,2h,4h,8h", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "definition": "label_values(traefik_open_connections, entrypoint)", - "hide": 0, - "includeAll": true, - "multi": false, - "name": "entrypoint", - "options": [], - "query": { - "query": "label_values(traefik_open_connections, entrypoint)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "definition": "label_values(traefik_service_requests_total, service)", - "hide": 0, - "includeAll": true, - "multi": false, - "name": "service", - "options": [], - "query": { - "query": "label_values(traefik_service_requests_total, service)", - "refId": "StandardVariableQuery" - }, - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "type": "query" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Traefik Official Standalone Dashboard", - "uid": "gnet-17346", - "version": 7, - "weekStart": "" -} \ No newline at end of file diff --git a/ansible/roles/monitoring/files/dashboards/overview.json b/ansible/roles/monitoring/files/dashboards/overview.json deleted file mode 100644 index 29758ec..0000000 --- a/ansible/roles/monitoring/files/dashboards/overview.json +++ /dev/null @@ -1,2077 +0,0 @@ -{ - "uid": "asxpio-overview", - "title": "asxpio overview", - "tags": [ - "asxpio" - ], - "timezone": "browser", - "editable": false, - "refresh": "1m", - "time": { - "from": "now-6h", - "to": "now" - }, - "schemaVersion": 39, - "panels": [ - { - "type": "row", - "title": "Status", - "id": 1, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "panels": [] - }, - { - "type": "stat", - "title": "Services (outside-in)", - "id": 2, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "probe_success", - "legendFormat": "{{probe}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 7, - "w": 16, - "x": 0, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 1 - } - ] - }, - "mappings": [ - { - "type": "value", - "options": { - "0": { - "text": "DOWN", - "color": "red" - }, - "1": { - "text": "UP", - "color": "green" - } - } - } - ] - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto", - "text": { - "titleSize": 12, - "valueSize": 16 - } - }, - "description": "blackbox_exporter probes from asxpio-ops: HTTPS sites, XMPP, TURN, Xray, Minecraft, SillyTavern" - }, - { - "type": "bargauge", - "title": "Certificates: days left", - "id": 3, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "(probe_ssl_earliest_cert_expiry - time()) / 86400", - "legendFormat": "{{probe}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 1 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "d", - "decimals": 0, - "min": 0, - "max": 90, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 14 - }, - { - "color": "green", - "value": 30 - } - ] - } - }, - "overrides": [] - }, - "options": { - "displayMode": "basic", - "orientation": "horizontal", - "showUnfilled": true, - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "minVizHeight": 10 - } - }, - { - "type": "row", - "title": "Hosts", - "id": 4, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "panels": [] - }, - { - "type": "gauge", - "title": "CPU", - "id": 5, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "100 - avg by (host) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 0, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "percent", - "decimals": 0, - "min": 0, - "max": 100, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 75 - }, - { - "color": "red", - "value": 90 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showThresholdMarkers": true - } - }, - { - "type": "gauge", - "title": "Memory", - "id": 6, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "100 * (1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 4, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "percent", - "decimals": 0, - "min": 0, - "max": 100, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 75 - }, - { - "color": "red", - "value": 90 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showThresholdMarkers": true - } - }, - { - "type": "gauge", - "title": "Disk /", - "id": 7, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "100 * (1 - node_filesystem_avail_bytes{mountpoint=\"/\"} / node_filesystem_size_bytes{mountpoint=\"/\"})", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 8, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "percent", - "decimals": 0, - "min": 0, - "max": 100, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 75 - }, - { - "color": "red", - "value": 90 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showThresholdMarkers": true - } - }, - { - "type": "gauge", - "title": "Load (1m) per CPU", - "id": 8, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (host) (node_load1) / count by (host) (node_cpu_seconds_total{mode=\"idle\"})", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 12, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "percentunit", - "decimals": 0, - "min": 0, - "max": 2, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 0.8 - }, - { - "color": "red", - "value": 1.2 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showThresholdMarkers": true - } - }, - { - "type": "stat", - "title": "Uptime", - "id": 9, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "time() - node_boot_time_seconds", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 16, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "s", - "decimals": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "stat", - "title": "Swap used", - "id": 10, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "node_memory_SwapTotal_bytes - node_memory_SwapFree_bytes", - "legendFormat": "{{host}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 20, - "y": 9 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "bytes", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 524288000 - }, - { - "color": "red", - "value": 1572864000 - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "timeseries", - "title": "CPU by host", - "id": 11, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "100 - avg by (host) (rate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval])) * 100", - "legendFormat": "{{host}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 15 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "percent", - "min": 0, - "max": 100 - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "timeseries", - "title": "Memory used by host", - "id": 12, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes", - "legendFormat": "{{host}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 15 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "bytes" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "timeseries", - "title": "Network by host (in +, out -)", - "id": 13, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (host) (rate(node_network_receive_bytes_total{device!~\"lo|veth.*|br-.*|docker.*\"}[$__rate_interval]))", - "legendFormat": "{{host}} in", - "refId": "A", - "instant": false, - "range": true - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "-sum by (host) (rate(node_network_transmit_bytes_total{device!~\"lo|veth.*|br-.*|docker.*\"}[$__rate_interval]))", - "legendFormat": "{{host}} out", - "refId": "B", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 15 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "Bps" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "row", - "title": "Containers", - "id": 14, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 23 - }, - "panels": [] - }, - { - "type": "bargauge", - "title": "Memory (top 12)", - "id": 15, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "topk(12, container_memory_working_set_bytes{name!=\"\"})", - "legendFormat": "{{host}} · {{name}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 24 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "bytes", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - } - ] - } - }, - "overrides": [] - }, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "minVizHeight": 10 - } - }, - { - "type": "timeseries", - "title": "CPU (top 8)", - "id": 16, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "topk(8, sum by (host, name) (rate(container_cpu_usage_seconds_total{name!=\"\"}[$__rate_interval])))", - "legendFormat": "{{host}} · {{name}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 10, - "w": 10, - "x": 8, - "y": 24 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "table", - "placement": "right", - "calcs": [ - "mean", - "max" - ], - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "table", - "title": "Restarts (24 h)", - "id": 17, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sort_desc(sum by (host, name) (changes(container_start_time_seconds{name!=\"\"}[24h])) > 0)", - "legendFormat": "", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 10, - "w": 6, - "x": 18, - "y": 24 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 1 - }, - { - "color": "red", - "value": 3 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "displayName", - "value": "restarts" - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ - { - "id": "custom.hidden", - "value": true - } - ] - } - ] - }, - "options": { - "showHeader": true, - "cellHeight": "sm" - } - }, - { - "type": "row", - "title": "Web traffic (Traefik)", - "id": 18, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 34 - }, - "panels": [] - }, - { - "type": "timeseries", - "title": "Requests by router", - "id": 19, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (router) (rate(traefik_router_requests_total[$__rate_interval]))", - "legendFormat": "{{router}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 35 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "reqps" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "timeseries", - "title": "5xx by router", - "id": 20, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (router) (rate(traefik_router_requests_total{code=~\"5..\"}[$__rate_interval]))", - "legendFormat": "{{router}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 35 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "reqps" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "timeseries", - "title": "Latency p95 by router", - "id": 21, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "histogram_quantile(0.95, sum by (le, router) (rate(traefik_router_request_duration_seconds_bucket[$__rate_interval])))", - "legendFormat": "{{router}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 35 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "s" - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "row", - "title": "Data and backups", - "id": 22, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 43 - }, - "panels": [] - }, - { - "type": "stat", - "title": "Postgres", - "id": 23, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "pg_up", - "legendFormat": "up", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 0, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 1 - } - ] - }, - "mappings": [ - { - "type": "value", - "options": { - "0": { - "text": "DOWN", - "color": "red" - }, - "1": { - "text": "UP", - "color": "green" - } - } - } - ] - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "background", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "stat", - "title": "asxpio DB size", - "id": 24, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "pg_database_size_bytes{datname=\"asxpio\"}", - "legendFormat": "asxpio", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 4, - "x": 4, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "bytes", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - } - ] - } - }, - "overrides": [] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "colorMode": "value", - "graphMode": "none", - "textMode": "value_and_name", - "justifyMode": "center", - "orientation": "auto" - } - }, - { - "type": "timeseries", - "title": "Postgres connections", - "id": 25, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (datname) (pg_stat_activity_count)", - "legendFormat": "{{datname}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 6, - "w": 6, - "x": 8, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - } - }, - { - "type": "bargauge", - "title": "Last good backup / replica (hours ago)", - "id": 26, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "(time() - restic_backup_last_success_timestamp_seconds) / 3600", - "legendFormat": "restic · {{host}} · {{repo}}", - "refId": "A", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "(time() - s3_replicate_last_success_timestamp_seconds) / 3600", - "legendFormat": "replica hel1 → fsn1", - "refId": "B", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 6, - "w": 10, - "x": 14, - "y": 44 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "unit": "h", - "decimals": 1, - "min": 0, - "max": 48, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 26 - }, - { - "color": "red", - "value": 48 - } - ] - } - }, - "overrides": [] - }, - "options": { - "displayMode": "basic", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showUnfilled": true - } - }, - { - "type": "row", - "title": "Logs", - "id": 27, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 50 - }, - "panels": [] - }, - { - "type": "timeseries", - "title": "Log lines by host", - "id": 28, - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "sum by (host) (count_over_time({job=~\"docker|journal\"}[$__interval]))", - "legendFormat": "{{host}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 51 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - } - }, - "overrides": [] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - }, - "drawStyle": "bars" - } - }, - { - "type": "logs", - "title": "Errors (all containers)", - "id": 29, - "datasource": { - "type": "loki", - "uid": "loki" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "expr": "{job=\"docker\"} |~ \"(?i)(error|fatal|panic|exception|traceback)\" != \"level=info\"", - "legendFormat": "", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 16, - "x": 8, - "y": 51 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - } - }, - "overrides": [] - }, - "options": { - "showTime": true, - "wrapLogMessage": true, - "sortOrder": "Descending", - "enableLogDetails": true, - "dedupStrategy": "signature" - } - }, - { - "type": "row", - "title": "AI crawlers", - "id": 30, - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 59 - }, - "panels": [] - }, - { - "type": "piechart", - "title": "Who is asking (time range)", - "id": 31, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=\"verified\"}[$__range]))", - "legendFormat": "AI · verified", - "refId": "A", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=\"spoofed\"}[$__range]))", - "legendFormat": "AI · spoofed", - "refId": "B", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_ai_requests_total{verdict=~\"unknown|proxied|private\"}[$__range]))", - "legendFormat": "AI · unverifiable", - "refId": "C", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"other-bot\"}[$__range]))", - "legendFormat": "other bots", - "refId": "D", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"browser-like\"}[$__range]))", - "legendFormat": "browser-like", - "refId": "E", - "instant": true, - "range": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum(increase(crawler_class_requests_total{class=\"none\"}[$__range]))", - "legendFormat": "no user agent", - "refId": "F", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 8, - "w": 6, - "x": 0, - "y": 60 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "proxied" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "blue" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "unknown" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "private" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · unverifiable" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "other bots" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "orange" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "browser-like" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "no user agent" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "text" - } - } - ] - } - ] - }, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "pieType": "donut", - "legend": { - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "value", - "percent" - ] - }, - "tooltip": { - "mode": "single" - } - }, - "description": "From the Traefik access log, every router (crawler-alert.py --metrics, 5-minute timer). A request naming an AI bot counts as verified only if its source IP is in the vendor's published ranges, or passes forward-confirmed reverse DNS, or (Meta) sits in the vendor's own ASN. spoofed = the claim failed that check; unverifiable = via Cloudflare, no PTR, or over the DNS budget.", - "links": [ - { - "title": "Crawler details", - "url": "/d/asxpio-crawlers?${__url_time_range}" - } - ] - }, - { - "type": "timeseries", - "title": "AI crawler requests by verdict (per minute)", - "id": 32, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sum by (verdict) (rate(crawler_ai_requests_total[$__rate_interval])) * 60", - "legendFormat": "{{verdict}}", - "refId": "A", - "instant": false, - "range": true - } - ], - "gridPos": { - "h": 8, - "w": 9, - "x": 6, - "y": 60 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "unit": "short", - "custom": { - "stacking": { - "mode": "normal" - }, - "fillOpacity": 40, - "lineWidth": 1 - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "proxied" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "blue" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "unknown" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "private" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · verified" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "green" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · spoofed" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "red" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "AI · unverifiable" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "yellow" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "other bots" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "orange" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "browser-like" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "purple" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "no user agent" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed", - "fixedColor": "text" - } - } - ] - } - ] - }, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "description": "From the Traefik access log, every router (crawler-alert.py --metrics, 5-minute timer). A request naming an AI bot counts as verified only if its source IP is in the vendor's published ranges, or passes forward-confirmed reverse DNS, or (Meta) sits in the vendor's own ASN. spoofed = the claim failed that check; unverifiable = via Cloudflare, no PTR, or over the DNS budget." - }, - { - "type": "bargauge", - "title": "Verified AI crawlers by vendor (time range)", - "id": 33, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "expr": "sort_desc(sum by (vendor) (increase(crawler_ai_requests_total{verdict=\"verified\"}[$__range])))", - "legendFormat": "{{vendor}}", - "refId": "A", - "instant": true, - "range": false - } - ], - "gridPos": { - "h": 8, - "w": 9, - "x": 15, - "y": 60 - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "unit": "short", - "decimals": 0, - "min": 0 - }, - "overrides": [] - }, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "values": false - }, - "showUnfilled": true, - "valueMode": "color" - } - } - ], - "graphTooltip": 1, - "links": [ - { - "title": "Dashboards", - "type": "dashboards", - "asDropdown": true, - "includeVars": false, - "keepTime": true, - "tags": [] - } - ] -} diff --git a/ansible/roles/monitoring/tasks/main.yaml b/ansible/roles/monitoring/tasks/main.yaml deleted file mode 100644 index 5e8f643..0000000 --- a/ansible/roles/monitoring/tasks/main.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# Prometheus, Loki, Grafana, blackbox_exporter and postgres_exporter on -# asxpio-ops. Grafana: https://gf.asxp.io, WireGuard only. -- name: Create the provisioning directories - ansible.builtin.file: - path: "{{ monitoring_base_path }}/{{ item }}" - state: directory - mode: "0755" - loop: - - grafana/provisioning/datasources - - grafana/provisioning/dashboards - - grafana/provisioning/alerting - - grafana/dashboards - -- name: Deploy the dashboards - ansible.builtin.copy: - src: dashboards/ - dest: "{{ monitoring_base_path }}/grafana/dashboards/" - mode: "0644" - -- name: Deploy the monitoring stack - ansible.builtin.include_role: - name: docker_service - vars: - service_name: monitoring - service_base_path: "{{ monitoring_base_path }}" - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: prometheus.yml.j2, dest: prometheus.yml } - - { src: blackbox.yml.j2, dest: blackbox.yml } - - { src: loki.yml.j2, dest: loki.yml } - - { src: grafana.env.j2, dest: grafana.env, mode: "0600" } - - { src: loki.env.j2, dest: loki.env, mode: "0600" } - - { src: datasources.yaml.j2, dest: grafana/provisioning/datasources/datasources.yaml } - - { src: dashboards.yaml.j2, dest: grafana/provisioning/dashboards/dashboards.yaml } - - { src: alerting.yaml.j2, dest: grafana/provisioning/alerting/alerting.yaml } - - { src: alert-rules.yaml.j2, dest: grafana/provisioning/alerting/rules.yaml } - health_check_url: "http://{{ asxpio_ops_vpc_ip }}:{{ monitoring_loki_port }}/ready" diff --git a/ansible/roles/monitoring/templates/alert-rules.yaml.j2 b/ansible/roles/monitoring/templates/alert-rules.yaml.j2 deleted file mode 100644 index f55e790..0000000 --- a/ansible/roles/monitoring/templates/alert-rules.yaml.j2 +++ /dev/null @@ -1,546 +0,0 @@ -# Managed by Ansible (role monitoring). -{% raw %} -apiVersion: 1 -groups: - - orgId: 1 - name: asxpio - folder: Alerts - interval: 1m - rules: - - uid: host-down - title: "Host down" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "1 - up{job=\"node\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 2m - labels: { severity: critical } - annotations: { summary: "{{ $labels.host }} stopped answering (node_exporter over the VPC)" } - - uid: target-down - title: "Scrape target down" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "up{job!~\"node|probe_.*\"} == 0", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [-1] } } ] } - noDataState: OK - execErrState: Error - for: 5m - labels: { severity: warning } - annotations: { summary: "{{ $labels.job }} on {{ $labels.instance }} is not answering metrics scrapes" } - - uid: probe-down - title: "Service down (outside-in probe)" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "1 - probe_success", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 2m - labels: { severity: critical } - annotations: { summary: "{{ $labels.probe }} ({{ $labels.instance }}) is not reachable" } - - uid: cert-expiry - title: "Certificate expires soon" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "(probe_ssl_earliest_cert_expiry - time()) / 86400", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: lt, params: [14] } } ] } - noDataState: OK - execErrState: Error - for: 1h - labels: { severity: warning } - annotations: { summary: "{{ $labels.probe }}: certificate expires in {{ $values.A.Value | printf \"%.0f\" }} days" } - - uid: disk-full - title: "Disk almost full" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "100 * (1 - node_filesystem_avail_bytes{fstype!~\"tmpfs|overlay|squashfs|fuse.*\"} / node_filesystem_size_bytes{fstype!~\"tmpfs|overlay|squashfs|fuse.*\"})", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [85] } } ] } - noDataState: OK - execErrState: Error - for: 10m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }} {{ $labels.mountpoint }} is {{ $values.A.Value | printf \"%.0f\" }}% full" } - - uid: memory-low - title: "Memory almost exhausted" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "100 * (1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [92] } } ] } - noDataState: OK - execErrState: Error - for: 10m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }} memory is {{ $values.A.Value | printf \"%.0f\" }}% used" } - - uid: container-restarting - title: "Container restart-looping" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "changes(container_start_time_seconds{name!=\"\"}[15m])", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [2] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "{{ $labels.name }} on {{ $labels.host }} restarted {{ $values.A.Value | printf \"%.0f\" }} times in 15 minutes" } - - uid: postgres-down - title: "Postgres down" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "pg_up", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: lt, params: [1] } } ] } - noDataState: OK - execErrState: Error - for: 1m - labels: { severity: critical } - annotations: { summary: "Postgres (storage) is not answering" } - - uid: backup-stale - title: "Backup stale" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "(time() - restic_backup_last_success_timestamp_seconds) / 3600", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [26] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "restic on {{ $labels.host }}: last good backup {{ $values.A.Value | printf \"%.0f\" }} hours ago" } - - uid: xmpp-cert-sync-stale - title: "XMPP certificate sync stale" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "(time() - xmpp_cert_sync_last_success_timestamp_seconds) / 3600", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [50] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "xmpp-cert-sync on asxpio-ops last succeeded {{ $values.A.Value | printf \"%.0f\" }} hours ago (journalctl -u xmpp-cert-sync)" } - - uid: xmpp-cert-outdated - title: "XMPP serves an older certificate than Traefik has" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "((max(xmpp_cert_source_not_after_timestamp_seconds{cert=\"asxp.io\"}) - min(probe_ssl_earliest_cert_expiry{probe=\"xmpp c2s tls asxp.io\"})) / 86400 > 1) or ((max(xmpp_cert_source_not_after_timestamp_seconds{cert=\"xmpp.asxp.io\"}) - min(probe_ssl_earliest_cert_expiry{probe=\"xmpp c2s tls\"})) / 86400 > 1)", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [1] } } ] } - noDataState: OK - execErrState: Error - for: 6h - labels: { severity: warning } - annotations: { summary: "ejabberd's certificate expires {{ $values.A.Value | printf \"%.0f\" }} days before the one Traefik holds: the push or the reload failed" } - - uid: replica-stale - title: "Bucket replica stale" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "(time() - s3_replicate_last_success_timestamp_seconds) / 3600", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [26] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "hel1 -> fsn1 bucket replica: last good run {{ $values.A.Value | printf \"%.0f\" }} hours ago" } - # Security: unexpected peers, devices, accounts, ports and containers - # (metrics from security-metrics, role monitoring_agent) and logins - # (Loki). The baseline lives in that role's defaults and in host_vars. - - orgId: 1 - name: security - folder: Alerts - interval: 1m - rules: - - uid: sec-wg-peer-unknown - title: "Unknown WireGuard peer" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_wg_peer_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "WireGuard peer {{ $labels.peer }} ({{ $labels.allowed_ips }}) on {{ $labels.host }} is not in wireguard_clients" } - - uid: sec-wg-endpoint-new - title: "WireGuard peer on a new network" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_wg_peer_endpoint_info unless on (host, interface, peer, net) max_over_time(security_wg_peer_endpoint_info[14d] offset 30m) and on (host) (security_audit_last_run_timestamp_seconds offset 1d)", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "{{ $labels.peer }} connected to {{ $labels.host }} from {{ $labels.endpoint }}: no address in {{ $labels.net }} was seen for it in 14 days" } - - uid: sec-vpc-host-unknown - title: "Unknown device on the private network" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_vpc_host_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 2m - labels: { severity: critical } - annotations: { summary: "{{ $labels.ip }} answers on the VPC (seen from {{ $labels.host }}) and is not in security_vpc_hosts" } - - uid: sec-hcloud-server-unknown - title: "Unknown server in the Hetzner project" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "up{job=\"hcloud\",known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 2m - labels: { severity: critical } - annotations: { summary: "Server {{ $labels.server }} ({{ $labels.type }}, {{ $labels.public_ip }}, private {{ $labels.private_ip }}) exists in the Hetzner project and is not in monitoring_hcloud_servers" } - - uid: sec-hcloud-inventory-stale - title: "Hetzner server list not updating" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "absent(up{job=\"hcloud\"}) or increase(prometheus_sd_refresh_failures_total{mechanism=\"hetzner\"}[30m]) > 3", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 10m - labels: { severity: critical } - annotations: { summary: "Prometheus cannot list the servers of the Hetzner project (token revoked or API unreachable): new servers go unnoticed" } - - uid: sec-user-unknown - title: "Unknown login account" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_user_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "{{ $labels.host }}: account {{ $labels.user }} (uid {{ $labels.uid }}, {{ $labels.shell }}) is not in security_login_users" } - - uid: sec-group-member-unknown - title: "Unknown member of sudo or docker" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_group_member_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "{{ $labels.host }}: {{ $labels.user }} is in group {{ $labels.group }}" } - - uid: sec-files-changed - title: "Access files changed" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "changes(security_fileset_hash[15m])", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }}: a file in set {{ $labels.set }} changed (accounts, sudoers, sshd, wireguard or authorized_keys)" } - - uid: sec-port-unknown - title: "Unexpected listening port" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_listening_port_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 3m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }}: {{ $labels.process }} listens on {{ $labels.proto }}/{{ $labels.port }} ({{ $labels.scope }}), not in security_ports" } - - uid: sec-container-privileged - title: "Container with unexpected host access" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_container_privileged_info{known=\"false\"}", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "{{ $labels.host }}: container {{ $labels.name }} runs with {{ $labels.flags }}" } - - uid: sec-container-new - title: "New container" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "group by (host, name) (container_last_seen{name!=\"\", name!~\"[a-z]+_[a-z]+\"}) unless on (host, name) group by (host, name) (max_over_time(container_last_seen{name!=\"\"}[7d] offset 30m))", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }}: container {{ $labels.name }} was not seen in the last 7 days" } - - uid: sec-forgejo-new - title: "Forgejo: new user, key or runner" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "security_forgejo_objects{kind=~\"users|admins|ssh_keys|deploy_keys|runners\"} - security_forgejo_objects offset 15m", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "Forgejo: {{ $labels.kind }} grew by {{ $values.A.Value | printf \"%.0f\" }}" } - - uid: sec-ssh-outside - title: "SSH login from outside WireGuard" - condition: C - data: - - refId: A - relativeTimeRange: { from: 300, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum by (host, user, src) (count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Accepted \\S+ for ` !~ `Accepted \\S+ for git from ` | regexp `Accepted \\S+ for (?P\\S+) from (?P\\S+)` | src !~ `10\\.20\\.0\\.\\d+|10\\.10\\.(\\d|1[0-5])\\.\\d+` [5m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: critical } - annotations: { summary: "{{ $labels.host }}: {{ $labels.user }} logged in over SSH from {{ $labels.src }}" } - - uid: sec-ssh-failed-internal - title: "Failed SSH logins from inside" - condition: C - data: - - refId: A - relativeTimeRange: { from: 600, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum by (host) (count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Failed \\S+ for |Invalid user |Connection closed by (authenticating|invalid) user ` |~ ` (10\\.20\\.0\\.\\d+|10\\.10\\.(\\d|1[0-5])\\.\\d+) port ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [2] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }}: {{ $values.A.Value | printf \"%.0f\" }} failed SSH logins from WireGuard or VPC addresses in 10 minutes" } - - uid: sec-ssh-failed-burst - title: "Failed SSH logins spike" - condition: C - data: - - refId: A - relativeTimeRange: { from: 600, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum by (host) (count_over_time({job=\"journal\", unit=\"ssh.service\"} |~ `Failed \\S+ for |Invalid user |Connection closed by (authenticating|invalid) user ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [150] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "{{ $labels.host }}: {{ $values.A.Value | printf \"%.0f\" }} failed SSH logins in 10 minutes (usual: about 10)" } - - uid: sec-login-failed-forgejo - title: "Failed logins: Forgejo" - condition: C - data: - - refId: A - relativeTimeRange: { from: 600, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum(count_over_time({container=\"forgejo\"} |= `Failed authentication attempt` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [10] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "Forgejo: {{ $values.A.Value | printf \"%.0f\" }} failed logins in 10 minutes" } - - uid: sec-login-failed-grafana - title: "Failed logins: Grafana" - condition: C - data: - - refId: A - relativeTimeRange: { from: 600, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum(count_over_time({job=\"traefik-access\"} |= `\"grafana@docker\"` |~ `\"POST /login HTTP/[0-9.]+\" 401 ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [4] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "Grafana: {{ $values.A.Value | printf \"%.0f\" }} failed logins in 10 minutes" } - - uid: sec-login-failed-asxpio - title: "Failed logins: asxp.io admin" - condition: C - data: - - refId: A - relativeTimeRange: { from: 600, to: 0 } - datasourceUid: loki - model: { refId: A, expr: "sum(count_over_time({job=\"traefik-access\"} |= `\"asxpio@docker\"` |~ `\"POST /admin/login HTTP/[0-9.]+\" (401|429) ` [10m]))", queryType: instant, intervalMs: 60000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [4] } } ] } - noDataState: OK - execErrState: Error - for: 0m - labels: { severity: warning } - annotations: { summary: "asxp.io admin: {{ $values.A.Value | printf \"%.0f\" }} failed or rate-limited logins in 10 minutes" } - - uid: sec-logs-stopped - title: "Logs stopped arriving" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "sum by (host) (rate(loki_write_sent_entries_total[10m]))", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: lt, params: [0.001] } } ] } - noDataState: OK - execErrState: Error - for: 5m - labels: { severity: critical } - annotations: { summary: "Alloy on {{ $labels.host }} has sent Loki nothing for 10 minutes: every log-based alert is blind" } - - uid: sec-audit-stale - title: "Security metrics stale" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "(time() - security_audit_last_run_timestamp_seconds > 600) or on (host) (up{job=\"node\"} == 1 unless on (host) security_audit_last_run_timestamp_seconds)", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 5m - labels: { severity: critical } - annotations: { summary: "security-metrics on {{ $labels.host }} has not written its file for 10 minutes, or the file is gone" } - - uid: sec-audit-check-failed - title: "Security check failing" - condition: C - data: - - refId: A - relativeTimeRange: { from: 900, to: 0 } - datasourceUid: prometheus - model: { refId: A, expr: "1 - security_audit_check_ok", instant: true, intervalMs: 30000, maxDataPoints: 43200 } - - refId: C - datasourceUid: __expr__ - model: { refId: C, type: threshold, expression: A, conditions: [ { evaluator: { type: gt, params: [0] } } ] } - noDataState: OK - execErrState: Error - for: 5m - labels: { severity: warning } - annotations: { summary: "security-metrics on {{ $labels.host }}: check {{ $labels.check }} fails (journalctl -u security-metrics)" } -{% endraw %} diff --git a/ansible/roles/monitoring/templates/alerting.yaml.j2 b/ansible/roles/monitoring/templates/alerting.yaml.j2 deleted file mode 100644 index 1f79203..0000000 --- a/ansible/roles/monitoring/templates/alerting.yaml.j2 +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: 1 -contactPoints: - - orgId: 1 - name: email - receivers: - - uid: email-me - type: email - settings: - addresses: {{ monitoring_alert_email }} - singleEmail: true -policies: - - orgId: 1 - receiver: email - group_by: [alertname, host] - group_wait: 1m - group_interval: 5m - repeat_interval: 4h diff --git a/ansible/roles/monitoring/templates/blackbox.yml.j2 b/ansible/roles/monitoring/templates/blackbox.yml.j2 deleted file mode 100644 index 27ad3f6..0000000 --- a/ansible/roles/monitoring/templates/blackbox.yml.j2 +++ /dev/null @@ -1,35 +0,0 @@ -# Managed by Ansible (role monitoring). -modules: - http_2xx: - prober: http - timeout: 10s - http: - preferred_ip_protocol: ip4 - follow_redirects: true - # Up means "answers": 401/403/404 are fine (s3 root, allowlisted UIs) - http_up: - prober: http - timeout: 10s - http: - preferred_ip_protocol: ip4 - valid_status_codes: [200, 301, 302, 401, 403, 404] - tls_connect: - prober: tcp - timeout: 10s - tcp: - preferred_ip_protocol: ip4 - tls: true - # XMPP clients name the XMPP domain (asxp.io), not the SRV host, in SNI - tls_connect_asxpio: - prober: tcp - timeout: 10s - tcp: - preferred_ip_protocol: ip4 - tls: true - tls_config: - server_name: asxp.io - tcp_connect: - prober: tcp - timeout: 10s - tcp: - preferred_ip_protocol: ip4 diff --git a/ansible/roles/monitoring/templates/dashboards.yaml.j2 b/ansible/roles/monitoring/templates/dashboards.yaml.j2 deleted file mode 100644 index 5102060..0000000 --- a/ansible/roles/monitoring/templates/dashboards.yaml.j2 +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: 1 -providers: - - name: asxpio - type: file - disableDeletion: true - allowUiUpdates: false - options: - path: /var/lib/grafana/dashboards - foldersFromFilesStructure: true diff --git a/ansible/roles/monitoring/templates/datasources.yaml.j2 b/ansible/roles/monitoring/templates/datasources.yaml.j2 deleted file mode 100644 index cab4cdf..0000000 --- a/ansible/roles/monitoring/templates/datasources.yaml.j2 +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: 1 -datasources: - - name: Prometheus - uid: prometheus - type: prometheus - access: proxy - url: http://prometheus:9090 - isDefault: true - jsonData: { timeInterval: 30s } - - name: Loki - uid: loki - type: loki - access: proxy - url: http://loki:3100 diff --git a/ansible/roles/monitoring/templates/docker-compose.yml.j2 b/ansible/roles/monitoring/templates/docker-compose.yml.j2 deleted file mode 100644 index e6374ea..0000000 --- a/ansible/roles/monitoring/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,89 +0,0 @@ -# Managed by Ansible (role monitoring). -services: - prometheus: - image: prom/prometheus:{{ monitoring_prometheus_version }} - container_name: prometheus - command: - - --config.file=/etc/prometheus/prometheus.yml - - --storage.tsdb.path=/prometheus - - --storage.tsdb.retention.time={{ monitoring_metrics_retention }} - - --web.enable-lifecycle - volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - - prometheus-data:/prometheus - networks: [monitoring, traefik, storage] - restart: unless-stopped - mem_limit: 640m - - loki: - image: grafana/loki:{{ monitoring_loki_version }} - container_name: loki - # S3 keys come from loki.env, expanded into the config at start - command: ["-config.file=/etc/loki/loki.yml", "-config.expand-env=true"] - env_file: [loki.env] - ports: - # Alloy on both hosts pushes here over the VPC - - "{{ asxpio_ops_vpc_ip }}:{{ monitoring_loki_port }}:3100" - volumes: - - ./loki.yml:/etc/loki/loki.yml:ro - - loki-data:/loki - networks: [monitoring] - restart: unless-stopped - mem_limit: 512m - - grafana: - image: grafana/grafana:{{ monitoring_grafana_version }} - container_name: grafana - env_file: [grafana.env] - volumes: - - grafana-data:/var/lib/grafana - - ./grafana/provisioning:/etc/grafana/provisioning:ro - - ./grafana/dashboards:/var/lib/grafana/dashboards:ro - networks: [monitoring, traefik] - restart: unless-stopped - mem_limit: 384m - labels: - - traefik.enable=true - - traefik.docker.network=traefik - - traefik.http.routers.grafana.rule=Host(`{{ monitoring_grafana_host }}`) - - traefik.http.routers.grafana.entrypoints=websecure - - traefik.http.routers.grafana.tls=true - - traefik.http.routers.grafana.tls.certresolver=letsencrypt - - traefik.http.routers.grafana.middlewares=grafana-wireguard-only - - traefik.http.middlewares.grafana-wireguard-only.ipallowlist.sourcerange={{ wireguard_network_cidr }} - - traefik.http.services.grafana.loadbalancer.server.port=3000 - - blackbox: - image: prom/blackbox-exporter:{{ monitoring_blackbox_version }} - container_name: blackbox - command: ["--config.file=/etc/blackbox/blackbox.yml"] - volumes: - - ./blackbox.yml:/etc/blackbox/blackbox.yml:ro - networks: [monitoring] - restart: unless-stopped - mem_limit: 64m - - postgres-exporter: - image: quay.io/prometheuscommunity/postgres-exporter:{{ monitoring_postgres_exporter_version }} - container_name: postgres-exporter - # The password comes from the storage stack's own .env (same host) - env_file: [{{ services_base_path }}/storage/.env] - environment: - DATA_SOURCE_URI: storage-postgres:5432/postgres?sslmode=disable - DATA_SOURCE_USER: postgres - entrypoint: ["/bin/sh", "-c", "DATA_SOURCE_PASS=\"$$POSTGRES_PASSWORD\" exec /bin/postgres_exporter"] - networks: [monitoring, storage] - restart: unless-stopped - mem_limit: 64m - -volumes: - prometheus-data: - loki-data: - grafana-data: - -networks: - monitoring: - traefik: - external: true - storage: - external: true diff --git a/ansible/roles/monitoring/templates/grafana.env.j2 b/ansible/roles/monitoring/templates/grafana.env.j2 deleted file mode 100644 index c9bf30f..0000000 --- a/ansible/roles/monitoring/templates/grafana.env.j2 +++ /dev/null @@ -1,17 +0,0 @@ -GF_SERVER_ROOT_URL=https://{{ monitoring_grafana_host }}/ -GF_SECURITY_ADMIN_USER=admin -GF_SECURITY_ADMIN_PASSWORD={{ monitoring_grafana_admin_password }} -GF_SECURITY_COOKIE_SECURE=true -GF_USERS_ALLOW_SIGN_UP=false -GF_AUTH_ANONYMOUS_ENABLED=false -GF_ANALYTICS_REPORTING_ENABLED=false -GF_ANALYTICS_CHECK_FOR_UPDATES=false -GF_NEWS_NEWS_FEED_ENABLED=false -GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/var/lib/grafana/dashboards/overview.json -GF_SMTP_ENABLED=true -GF_SMTP_HOST=smtp.fastmail.com:587 -GF_SMTP_USER={{ vault_forgejo_smtp_user }} -GF_SMTP_PASSWORD={{ vault_forgejo_smtp_password }} -GF_SMTP_FROM_ADDRESS={{ vault_forgejo_smtp_user }} -GF_SMTP_FROM_NAME=asxpio monitoring -GF_SMTP_STARTTLS_POLICY=MandatoryStartTLS diff --git a/ansible/roles/monitoring/templates/loki.env.j2 b/ansible/roles/monitoring/templates/loki.env.j2 deleted file mode 100644 index ca8e610..0000000 --- a/ansible/roles/monitoring/templates/loki.env.j2 +++ /dev/null @@ -1,3 +0,0 @@ -# Managed by Ansible (role monitoring). -S3_ACCESS_KEY={{ s3_access_key }} -S3_SECRET_KEY={{ s3_secret_key }} diff --git a/ansible/roles/monitoring/templates/loki.yml.j2 b/ansible/roles/monitoring/templates/loki.yml.j2 deleted file mode 100644 index e47ee45..0000000 --- a/ansible/roles/monitoring/templates/loki.yml.j2 +++ /dev/null @@ -1,53 +0,0 @@ -# Managed by Ansible (role monitoring). -auth_enabled: false -server: - http_listen_port: 3100 - log_level: warn -common: - path_prefix: /loki - replication_factor: 1 - ring: - kvstore: - store: inmemory - storage: - filesystem: - chunks_directory: /loki/chunks - rules_directory: /loki/rules -schema_config: - configs: - - from: "2026-11-01" - store: tsdb - object_store: filesystem - schema: v13 - index: - prefix: index_ - period: 24h - # From here on chunks and index live in Hetzner Object Storage, not on - # ops' small disk. The filesystem period above ages out with retention. - - from: "2026-11-14" - store: tsdb - object_store: aws - schema: v13 - index: - prefix: index_ - period: 24h -storage_config: - aws: - endpoint: {{ s3_region }}.your-objectstorage.com - region: {{ s3_region }} - bucketnames: {{ s3_bucket_loki }} - access_key_id: ${S3_ACCESS_KEY} - secret_access_key: ${S3_SECRET_KEY} -limits_config: - retention_period: {{ monitoring_logs_retention }} - reject_old_samples: true - reject_old_samples_max_age: 168h - ingestion_rate_mb: 8 - ingestion_burst_size_mb: 16 - volume_enabled: true -compactor: - working_directory: /loki/compactor - retention_enabled: true - delete_request_store: aws -analytics: - reporting_enabled: false diff --git a/ansible/roles/monitoring/templates/prometheus.yml.j2 b/ansible/roles/monitoring/templates/prometheus.yml.j2 deleted file mode 100644 index 2e0071a..0000000 --- a/ansible/roles/monitoring/templates/prometheus.yml.j2 +++ /dev/null @@ -1,109 +0,0 @@ -# Managed by Ansible (role monitoring). -global: - scrape_interval: 30s - evaluation_interval: 30s - -scrape_configs: - - job_name: node - static_configs: -{% for h in monitoring_hosts %} - - targets: ["{{ h.address }}:{{ monitoring_node_exporter_port }}"] - labels: { host: {{ h.name }} } -{% endfor %} - - - job_name: cadvisor - scrape_interval: 60s - static_configs: -{% for h in monitoring_hosts %} - - targets: ["{{ h.address }}:{{ monitoring_cadvisor_port }}"] - labels: { host: {{ h.name }} } -{% endfor %} - metric_relabel_configs: - # Short-lived CI job containers would bloat the series count - - source_labels: [name] - regex: FORGEJO-ACTIONS-TASK-.* - action: drop - - - job_name: alloy - static_configs: -{% for h in monitoring_hosts %} - - targets: ["{{ h.address }}:12345"] - labels: { host: {{ h.name }} } -{% endfor %} - - - job_name: traefik - static_configs: - - targets: ["traefik:8082"] - labels: { host: asxpio-ops } - - - job_name: forgejo - metrics_path: /metrics - authorization: - credentials: "{{ monitoring_forgejo_metrics_token }}" - static_configs: - - targets: ["forgejo:3000"] - labels: { host: asxpio-ops } - - - job_name: postgres - static_configs: - - targets: ["postgres-exporter:9187"] - labels: { host: asxpio-ops } - - - job_name: monitoring - static_configs: - - targets: ["localhost:9090", "loki:3100", "grafana:3000", "blackbox:9115"] - labels: { host: asxpio-ops } - - # Servers in the Hetzner project, from the API (read-only token). Nothing - # is scraped from them: every target is Prometheus itself with all - # samples dropped, which leaves one `up` series per server. - - job_name: hcloud - scrape_interval: 60s - hetzner_sd_configs: - - role: hcloud - authorization: - credentials: "{{ monitoring_hcloud_token }}" - relabel_configs: - - source_labels: [__meta_hetzner_server_name] - target_label: server - - source_labels: [__meta_hetzner_server_name] - target_label: instance - - source_labels: [__meta_hetzner_public_ipv4] - target_label: public_ip - - regex: __meta_hetzner_hcloud_private_ipv4_.+ - action: labelmap - replacement: private_ip - - source_labels: [__meta_hetzner_hcloud_server_type] - target_label: type - - source_labels: [__meta_hetzner_server_status] - target_label: status - - target_label: known - replacement: "false" - - source_labels: [__meta_hetzner_server_name] - regex: '{{ monitoring_hcloud_servers | map("regex_escape") | join("|") }}' - target_label: known - replacement: "true" - - target_label: __address__ - replacement: localhost:9090 - metric_relabel_configs: - - action: drop - -{% for module in monitoring_probes | map(attribute='module') | unique %} - - job_name: probe_{{ module }} - metrics_path: /probe - params: - module: [{{ module }}] - static_configs: -{% for p in monitoring_probes if p.module == module %} - - targets: ["{{ p.target }}"] - labels: { probe: "{{ p.name }}" } -{% endfor %} - relabel_configs: - - source_labels: [__address__] - target_label: __param_target - - source_labels: [__param_target] - target_label: instance - - target_label: __address__ - replacement: blackbox:9115 - -{% endfor %} diff --git a/ansible/roles/monitoring_agent/defaults/main.yaml b/ansible/roles/monitoring_agent/defaults/main.yaml deleted file mode 100644 index b5cdc8a..0000000 --- a/ansible/roles/monitoring_agent/defaults/main.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -# Security baseline for security-metrics: what each host is expected to -# have. Anything else is exported with known="false" and alerts (rules in -# role monitoring). Per-host additions go in host_vars as *_extra. - -# Accounts with a login shell -security_login_users: [root, asxpi, deploy, zerrtika] -security_login_users_extra: [] - -# Members of groups that amount to root -security_sudo_users: [asxpi, deploy, zerrtika] -security_docker_users: [asxpi, deploy, zerrtika] -security_docker_users_extra: [] - -# Addresses expected on the private network (.1 is Hetzner's gateway) -security_vpc_hosts: - - "{{ vpc_network.split('/')[0].rsplit('.', 1)[0] }}.1" - - "{{ asxpio_ops_vpc_ip }}" - - "{{ asxpio_services_vpc_ip }}" - -# WireGuard peers: by the "### Client " comment in the interface's -# conf (the server), or by public key -> name (a client) -security_wg_peer_names: [] -security_wg_peer_keys: {} - -# Listening sockets outside loopback: proto/port/process. port is a number, -# a range or *; process is the owner `ss -p` shows (empty for the kernel). -security_ports: - - tcp/22/sshd - - udp/68/dhclient - - "tcp/12345/alloy" - - "tcp/{{ monitoring_node_exporter_port }}/node_exporter" - - "tcp/{{ monitoring_cadvisor_port }}/cadvisor" -security_ports_extra: [] - -# Containers allowed host-level access: name (regex) -> flags, out of -# privileged, host-net, host-pid, host-root, docker-sock, cap- -security_containers: - cadvisor: [privileged, host-net, host-root] - node-exporter: [host-net, host-pid, host-root] - alloy: [host-net, docker-sock] -security_containers_extra: {} - -# Files whose change alerts, by set. authorized_keys files of every -# account are always watched (set ssh_keys). -security_filesets: - accounts: [/etc/passwd, /etc/shadow, /etc/group, /etc/gshadow] - sudoers: [/etc/sudoers, "/etc/sudoers.d/*"] - sshd: [/etc/ssh/sshd_config, "/etc/ssh/sshd_config.d/*"] - wireguard: ["/etc/wireguard/*.conf"] - -# Forgejo's SQLite database, where this host runs Forgejo -security_forgejo_db: "" diff --git a/ansible/roles/monitoring_agent/files/security-metrics.py b/ansible/roles/monitoring_agent/files/security-metrics.py deleted file mode 100755 index 8e03f99..0000000 --- a/ansible/roles/monitoring_agent/files/security-metrics.py +++ /dev/null @@ -1,395 +0,0 @@ -#!/usr/bin/env python3 -"""Security state of this host as Prometheus metrics. - -Run every minute by security-metrics.timer; writes a node_exporter -textfile. What is expected (peers, hosts, users, ports, containers) comes -from /etc/security-metrics.json, written by Ansible: anything else is -exported with known="false" and Grafana alerts on that. - -Never reads `wg show dump`: it prints private and preshared keys. -""" -import glob -import grp -import hashlib -import ipaddress -import json -import os -import pwd -import re -import select -import socket -import sqlite3 -import struct -import subprocess -import sys -import time - -CONFIG = sys.argv[1] if len(sys.argv) > 1 else "/etc/security-metrics.json" -NO_LOGIN = {"nologin", "false", "sync", "shutdown", "halt"} - - -class Metrics: - def __init__(self): - self.families = {} - - def add(self, name, text, value, /, **labels): - self.families.setdefault(name, (text, []))[1].append((labels, value)) - - def render(self): - out = [] - for name, (text, samples) in self.families.items(): - out.append(f"# HELP {name} {text}\n# TYPE {name} gauge\n") - for labels, value in samples: - body = ",".join(f'{k}="{escape(v)}"' for k, v in labels.items()) - out.append(f"{name}{{{body}}} {value}\n" if body else f"{name} {value}\n") - return "".join(out) - - -def escape(value): - return str(value).replace("\\", "\\\\").replace('"', '\\"').replace("\n", " ") - - -def run(*cmd): - return subprocess.run(cmd, capture_output=True, text=True, timeout=20, check=True).stdout - - -def flag(known): - return "true" if known else "false" - - -# --- WireGuard ----------------------------------------------------------- - -def conf_peer_names(interface): - """Public key -> name, from the '### Client ' comments in the conf.""" - names, name = {}, None - try: - with open(f"/etc/wireguard/{interface}.conf") as f: - for line in f: - line = line.strip() - m = re.match(r"#+\s*Client\s+(\S+)", line) - if m: - name = m.group(1) - elif line.startswith("[Peer]") and name is None: - name = "" - elif line.replace(" ", "").startswith("PublicKey=") and name is not None: - key = line.split("=", 1)[1].strip() - if name: - names[key] = name - name = None - except OSError: - pass - return names - - -def wg_table(interface, what): - rows = {} - for line in run("wg", "show", interface, what).splitlines(): - key, _, value = line.partition("\t") - rows[key] = value.strip() - return rows - - -def endpoint_net(endpoint): - host = endpoint.rsplit(":", 1)[0].strip("[]").split("%")[0] - ip = ipaddress.ip_address(host) - prefix = 16 if ip.version == 4 else 32 - return str(ip), str(ipaddress.ip_network(f"{ip}/{prefix}", strict=False)) - - -def wireguard(m, cfg): - known_names = set(cfg.get("wg_peer_names", [])) - known_keys = cfg.get("wg_peer_keys", {}) - for interface in run("wg", "show", "interfaces").split(): - names = conf_peer_names(interface) - used = list(names.values()) - allowed = wg_table(interface, "allowed-ips") - endpoints = wg_table(interface, "endpoints") - handshakes = wg_table(interface, "latest-handshakes") - for key, ips in allowed.items(): - name = known_keys.get(key) or names.get(key) or f"key:{key[:8]}" - # A name used twice is a hand-added peer hiding behind a known one - known = key in known_keys or ( - names.get(key) in known_names and used.count(names[key]) == 1) - m.add("security_wg_peer_info", "WireGuard peer configured on this host.", 1, - interface=interface, peer=name, allowed_ips=ips.replace(" ", ","), - known=flag(known)) - m.add("security_wg_peer_last_handshake_seconds", - "Unix time of the peer's last handshake (0: never).", - int(handshakes.get(key) or 0), interface=interface, peer=name) - endpoint = endpoints.get(key, "(none)") - if endpoint != "(none)": - ip, net = endpoint_net(endpoint) - m.add("security_wg_peer_endpoint_info", - "Address the peer last connected from; net is its /16 (IPv6: /32).", - 1, interface=interface, peer=name, endpoint=ip, net=net) - - -# --- Private network ----------------------------------------------------- - -def checksum(data): - total = sum(struct.unpack(f"!{len(data) // 2}H", data)) - total = (total >> 16) + (total & 0xFFFF) - total += total >> 16 - return ~total & 0xFFFF - - -def ping_sweep(network, passes=2, wait=1.5): - """Addresses in the network that answer an ICMP echo.""" - ident = os.getpid() & 0xFFFF - header = struct.pack("!BBHHH", 8, 0, 0, ident, 1) - packet = struct.pack("!BBHHH", 8, 0, checksum(header), ident, 1) - alive = set() - sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP) - sock.setblocking(False) - - def drain(timeout): - deadline = time.monotonic() + timeout - while True: - left = deadline - time.monotonic() - if left < 0 or not select.select([sock], [], [], left)[0]: - return - try: - data, (src, _) = sock.recvfrom(1024) - except BlockingIOError: - continue - ihl = (data[0] & 0x0F) * 4 - if len(data) >= ihl + 8: - kind, _, _, reply_id, _ = struct.unpack("!BBHHH", data[ihl:ihl + 8]) - if kind == 0 and reply_id == ident and ipaddress.ip_address(src) in network: - alive.add(src) - - try: - for _ in range(passes): - for n, host in enumerate(network.hosts()): - try: - sock.sendto(packet, (str(host), 0)) - except OSError: - pass - if n % 64 == 63: - drain(0.005) - drain(wait) - finally: - sock.close() - return alive - - -def vpc(m, cfg): - network = ipaddress.ip_network(cfg["vpc_network"]) - known = set(cfg.get("vpc_hosts", [])) - for ip in sorted(ping_sweep(network), key=ipaddress.ip_address): - m.add("security_vpc_host_info", "Address answering ping on the private network.", - 1, ip=ip, known=flag(ip in known)) - - -# --- Users, groups, keys ------------------------------------------------- - -def users(m, cfg): - known = set(cfg.get("login_users", [])) - for u in pwd.getpwall(): - can_login = os.path.basename(u.pw_shell) not in NO_LOGIN - if not (can_login or u.pw_uid == 0): - continue - ok = u.pw_name in known and (u.pw_uid != 0 or u.pw_name == "root") - m.add("security_user_info", "Account with a login shell, or uid 0.", 1, - user=u.pw_name, uid=u.pw_uid, shell=u.pw_shell, known=flag(ok)) - - for group, members in cfg.get("groups", {}).items(): - try: - g = grp.getgrnam(group) - except KeyError: - continue - found = set(g.gr_mem) | {u.pw_name for u in pwd.getpwall() if u.pw_gid == g.gr_gid} - for user in sorted(found): - m.add("security_group_member_info", "Member of a group that grants root.", 1, - group=group, user=user, known=flag(user in members)) - - -def authorized_keys_files(): - files = {} - for u in pwd.getpwall(): - for path in glob.glob(os.path.join(u.pw_dir, ".ssh", "authorized_keys*")): - files[os.path.realpath(path)] = u.pw_name - return files - - -def filesets(m, cfg): - key_files = authorized_keys_files() - for path, user in sorted(key_files.items()): - try: - with open(path, errors="replace") as f: - count = sum(1 for line in f if line.strip() and not line.lstrip().startswith("#")) - except OSError: - continue - m.add("security_authorized_keys", "Keys in an authorized_keys file.", count, - user=user, file=path) - - sets = {name: [p for pattern in patterns for p in glob.glob(pattern, recursive=True)] - for name, patterns in cfg.get("filesets", {}).items()} - sets["ssh_keys"] = list(key_files) - for name, paths in sets.items(): - digest, newest, count = hashlib.sha256(), 0, 0 - for path in sorted(set(paths)): - try: - st = os.stat(path) - if not os.path.isfile(path): - continue - with open(path, "rb") as f: - content = hashlib.sha256(f.read()).hexdigest() - except OSError: - continue - digest.update(f"{path}\0{content}\0{st.st_mode:o}\0{st.st_uid}\n".encode()) - newest = max(newest, int(st.st_mtime)) - count += 1 - # 48 bits: exact as a float, and says nothing about the contents - m.add("security_fileset_hash", "Fingerprint of a set of files; changes when one does.", - int(digest.hexdigest()[:12], 16), set=name) - m.add("security_fileset_files", "Files in the set.", count, set=name) - m.add("security_fileset_mtime_seconds", "Newest modification time in the set.", - newest, set=name) - - -# --- Listening ports ----------------------------------------------------- - -def port_matches(spec, port): - if spec == "*": - return True - low, _, high = spec.partition("-") - return int(low) <= port <= int(high or low) - - -def ports(m, cfg): - allowed = [entry.split("/", 2) for entry in cfg.get("ports", [])] - seen = {} - for line in run("ss", "-Htlnup").splitlines(): - fields = line.split() - if len(fields) < 5: - continue - proto = fields[0] - addr, _, port = fields[4].rpartition(":") - addr = addr.strip("[]").split("%")[0] - process = re.search(r'users:\(\("([^"]+)"', line) - process = process.group(1) if process else "" - if addr in ("*", "0.0.0.0", "::"): - scope = "public" - else: - ip = ipaddress.ip_address(addr) - if ip.is_loopback: - continue - scope = "internal" if ip.is_private else "public" - port = int(port) - for a_proto, a_port, a_process in allowed: - if a_proto == proto and a_process in ("*", process) and port_matches(a_port, port): - key = (proto, a_port, process, scope, True) - break - else: - key = (proto, str(port), process, scope, False) - seen[key] = seen.get(key, 0) + 1 - for (proto, port, process, scope, known), count in sorted(seen.items()): - m.add("security_listening_port_info", - "Listening sockets outside loopback; port is the allowlist entry when known.", - count, proto=proto, port=port, process=process, scope=scope, known=flag(known)) - - -# --- Containers ---------------------------------------------------------- - -def containers(m, cfg): - allowed = cfg.get("containers", {}) - ids = run("docker", "ps", "-q").split() - if not ids: - return - for c in json.loads(run("docker", "inspect", *ids)): - host = c["HostConfig"] - flags = [] - if host.get("Privileged"): - flags.append("privileged") - if host.get("NetworkMode") == "host": - flags.append("host-net") - if host.get("PidMode") == "host": - flags.append("host-pid") - mounts = [mnt.get("Source", "") for mnt in c.get("Mounts", [])] - if any(src.endswith("docker.sock") for src in mounts): - flags.append("docker-sock") - if "/" in mounts: - flags.append("host-root") - for cap in host.get("CapAdd") or []: - cap = cap.upper().removeprefix("CAP_") - if cap != "NET_BIND_SERVICE": - flags.append(f"cap-{cap}") - if not flags: - continue - name = c["Name"].lstrip("/") - known = any(re.fullmatch(pattern, name) and set(flags) <= set(ok) - for pattern, ok in allowed.items()) - m.add("security_container_privileged_info", - "Running container with host-level access.", 1, - name=name, flags=",".join(flags), known=flag(known)) - - -# --- Sessions and Forgejo ------------------------------------------------ - -def sessions(m, cfg): - counts = {} - for line in run("who").splitlines(): - fields = line.split() - if not fields: - continue - origin = re.search(r"\(([^)]+)\)\s*$", line) - key = (fields[0], origin.group(1) if origin else "local") - counts[key] = counts.get(key, 0) + 1 - for (user, origin), count in sorted(counts.items()): - m.add("security_sessions", "Open login sessions.", count, user=user, origin=origin) - - -FORGEJO_COUNTS = { - "users": "SELECT count(*) FROM user WHERE type = 0", - "admins": "SELECT count(*) FROM user WHERE is_admin = 1", - "ssh_keys": "SELECT count(*) FROM public_key", - "deploy_keys": "SELECT count(*) FROM deploy_key", - "access_tokens": "SELECT count(*) FROM access_token", - "oauth_apps": "SELECT count(*) FROM oauth2_application", - "runners": "SELECT count(*) FROM action_runner WHERE coalesce(deleted, 0) = 0", -} - - -def forgejo(m, cfg): - path = cfg.get("forgejo_db") - if not path: - return - db = sqlite3.connect(f"file:{path}?mode=ro", uri=True, timeout=5) - try: - for kind, query in FORGEJO_COUNTS.items(): - m.add("security_forgejo_objects", "Rows in Forgejo's database, by kind.", - db.execute(query).fetchone()[0], kind=kind) - finally: - db.close() - - -CHECKS = [wireguard, vpc, users, filesets, ports, containers, sessions, forgejo] - - -def main(): - with open(CONFIG) as f: - cfg = json.load(f) - m = Metrics() - failed = 0 - for check in CHECKS: - try: - check(m, cfg) - ok = 1 - except Exception as e: # one broken check must not hide the others - print(f"security-metrics: {check.__name__}: {e!r}", file=sys.stderr) - ok, failed = 0, failed + 1 - m.add("security_audit_check_ok", "Whether the check ran (0: it failed, see the journal).", - ok, check=check.__name__) - m.add("security_audit_last_run_timestamp_seconds", "When this file was written.", - int(time.time())) - target = cfg["textfile"] - with open(f"{target}.tmp", "w") as f: - f.write(m.render()) - os.chmod(f"{target}.tmp", 0o644) - os.replace(f"{target}.tmp", target) - return 1 if failed else 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/ansible/roles/monitoring_agent/files/security-metrics.service b/ansible/roles/monitoring_agent/files/security-metrics.service deleted file mode 100644 index 2c8f864..0000000 --- a/ansible/roles/monitoring_agent/files/security-metrics.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Security state for Prometheus (node_exporter textfile) -After=docker.service - -[Service] -Type=oneshot -ExecStart=/usr/local/sbin/security-metrics -# Runs every minute: keep "Starting/Finished" out of the journal -LogLevelMax=notice diff --git a/ansible/roles/monitoring_agent/files/security-metrics.timer b/ansible/roles/monitoring_agent/files/security-metrics.timer deleted file mode 100644 index 1a245ec..0000000 --- a/ansible/roles/monitoring_agent/files/security-metrics.timer +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Security state for Prometheus, every minute - -[Timer] -OnBootSec=1min -OnUnitActiveSec=1min -AccuracySec=5s - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/monitoring_agent/handlers/main.yaml b/ansible/roles/monitoring_agent/handlers/main.yaml deleted file mode 100644 index c28484f..0000000 --- a/ansible/roles/monitoring_agent/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Reload systemd - ansible.builtin.systemd: - daemon_reload: true diff --git a/ansible/roles/monitoring_agent/tasks/main.yaml b/ansible/roles/monitoring_agent/tasks/main.yaml deleted file mode 100644 index f38bf71..0000000 --- a/ansible/roles/monitoring_agent/tasks/main.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -# node_exporter, cAdvisor and Alloy on every host. Metrics listen on the -# host's VPC address only; Alloy ships Docker logs and the journal to Loki -# on asxpio-ops over the VPC. -- name: Create the node_exporter textfile directory - ansible.builtin.file: - path: "{{ monitoring_textfile_dir }}" - state: directory - mode: "0755" - -- name: Deploy the monitoring agents - ansible.builtin.include_role: - name: docker_service - vars: - service_name: monitoring-agent - service_base_path: "{{ services_base_path }}/monitoring-agent" - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: config.alloy.j2, dest: config.alloy } - health_check_enabled: true - health_check_host: "{{ vpc_ip }}" - health_check_port: "{{ monitoring_node_exporter_port }}" - -# Security state (WireGuard peers, private network, users, keys, ports, -# containers) as metrics; the baseline is in defaults and host_vars. -- name: Install security-metrics - ansible.builtin.copy: - src: security-metrics.py - dest: /usr/local/sbin/security-metrics - mode: "0700" - -- name: Write the security baseline - ansible.builtin.template: - src: security-metrics.json.j2 - dest: /etc/security-metrics.json - mode: "0600" - -- name: Install the security-metrics units - ansible.builtin.copy: - src: "{{ item }}" - dest: "/etc/systemd/system/{{ item }}" - mode: "0644" - loop: [security-metrics.service, security-metrics.timer] - notify: Reload systemd - -- name: Flush handlers - ansible.builtin.meta: flush_handlers - -- name: Enable the security-metrics timer - ansible.builtin.systemd: - name: security-metrics.timer - enabled: true - state: started - # A dry run has not installed the unit yet - ignore_errors: "{{ ansible_check_mode }}" diff --git a/ansible/roles/monitoring_agent/templates/config.alloy.j2 b/ansible/roles/monitoring_agent/templates/config.alloy.j2 deleted file mode 100644 index 8ed946b..0000000 --- a/ansible/roles/monitoring_agent/templates/config.alloy.j2 +++ /dev/null @@ -1,86 +0,0 @@ -// Managed by Ansible (role monitoring_agent): logs of {{ inventory_hostname }} to Loki. - -discovery.docker "containers" { - host = "unix:///var/run/docker.sock" -} - -discovery.relabel "containers" { - targets = discovery.docker.containers.targets - - rule { - source_labels = ["__meta_docker_container_name"] - regex = "/(.*)" - target_label = "container" - } - rule { - source_labels = ["__meta_docker_container_label_com_docker_compose_project"] - target_label = "compose_project" - } - rule { - source_labels = ["__meta_docker_container_label_com_docker_compose_service"] - target_label = "compose_service" - } -} - -loki.source.docker "containers" { - host = "unix:///var/run/docker.sock" - targets = discovery.docker.containers.targets - relabel_rules = discovery.relabel.containers.rules - labels = { job = "docker" } - forward_to = [loki.process.containers.receiver] -} - -loki.process "containers" { - // CI job containers are many, short-lived and noisy: the runner logs suffice - stage.match { - selector = "{container=~\"FORGEJO-ACTIONS-TASK-.*\"}" - action = "drop" - } - forward_to = [loki.write.default.receiver] -} - -loki.relabel "journal" { - forward_to = [] - - rule { - source_labels = ["__journal__systemd_unit"] - target_label = "unit" - } - // Every SSH login (Ansible, CI deploys) gets its own session-N.scope: - // one stream each blew Loki's active stream limit. - rule { - source_labels = ["unit"] - regex = "session-\\d+\\.scope" - target_label = "unit" - replacement = "session.scope" - } - rule { - source_labels = ["__journal_priority_keyword"] - target_label = "level" - } -} - -loki.source.journal "journal" { - max_age = "12h" - relabel_rules = loki.relabel.journal.rules - labels = { job = "journal" } - forward_to = [loki.write.default.receiver] -} -{% if inventory_hostname == 'asxpio-ops' %} - -local.file_match "traefik" { - path_targets = [{ "__path__" = "/traefik-logs/access.log", job = "traefik-access" }] -} - -loki.source.file "traefik" { - targets = local.file_match.traefik.targets - forward_to = [loki.write.default.receiver] -} -{% endif %} - -loki.write "default" { - endpoint { - url = "http://{{ asxpio_ops_vpc_ip }}:{{ monitoring_loki_port }}/loki/api/v1/push" - } - external_labels = { host = "{{ inventory_hostname }}" } -} diff --git a/ansible/roles/monitoring_agent/templates/docker-compose.yml.j2 b/ansible/roles/monitoring_agent/templates/docker-compose.yml.j2 deleted file mode 100644 index eb0524b..0000000 --- a/ansible/roles/monitoring_agent/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,72 +0,0 @@ -# Managed by Ansible (role monitoring_agent). -services: - node-exporter: - image: prom/node-exporter:{{ monitoring_node_exporter_version }} - container_name: node-exporter - command: - - --path.rootfs=/host - - --web.listen-address={{ vpc_ip }}:{{ monitoring_node_exporter_port }} - - --collector.textfile.directory=/textfile - - --collector.filesystem.mount-points-exclude=^/(dev|proc|run|sys|var/lib/docker/.+)($|/) - network_mode: host - pid: host - volumes: - - /:/host:ro,rslave - - {{ monitoring_textfile_dir }}:/textfile:ro - restart: unless-stopped - mem_limit: 64m - - cadvisor: - image: ghcr.io/google/cadvisor:{{ monitoring_cadvisor_version }} - container_name: cadvisor - command: - - --listen_ip={{ vpc_ip }} - - --port={{ monitoring_cadvisor_port }} - - --docker_only=true - - --housekeeping_interval=30s - - --store_container_labels=false - - --whitelisted_container_labels=com.docker.compose.project,com.docker.compose.service - - --disable_metrics=percpu,sched,tcp,udp,hugetlb,referenced_memory,cpu_topology,resctrl,advtcp,process - network_mode: host - privileged: true - devices: - - /dev/kmsg - volumes: - - /:/rootfs:ro - - /var/run:/var/run:ro - - /sys:/sys:ro - - /var/lib/docker/:/var/lib/docker:ro - - /dev/disk/:/dev/disk:ro - healthcheck: - # The image probes localhost:8080; we listen on the VPC address only. - test: ["CMD", "wget", "-q", "--tries=1", "--spider", "http://{{ vpc_ip }}:{{ monitoring_cadvisor_port }}/healthz"] - interval: 30s - timeout: 3s - retries: 3 - restart: unless-stopped - mem_limit: 192m - - alloy: - image: grafana/alloy:{{ monitoring_alloy_version }} - container_name: alloy - command: - - run - - --server.http.listen-addr={{ vpc_ip }}:12345 - - --storage.path=/var/lib/alloy/data - - /etc/alloy/config.alloy - network_mode: host - volumes: - - ./config.alloy:/etc/alloy/config.alloy:ro - - /var/run/docker.sock:/var/run/docker.sock:ro - - /var/log/journal:/var/log/journal:ro - - /run/log/journal:/run/log/journal:ro - - /etc/machine-id:/etc/machine-id:ro -{% if inventory_hostname == 'asxpio-ops' %} - - /opt/traefik/logs:/traefik-logs:ro -{% endif %} - - alloy-data:/var/lib/alloy/data - restart: unless-stopped - mem_limit: 256m - -volumes: - alloy-data: diff --git a/ansible/roles/monitoring_agent/templates/security-metrics.json.j2 b/ansible/roles/monitoring_agent/templates/security-metrics.json.j2 deleted file mode 100644 index 89b8853..0000000 --- a/ansible/roles/monitoring_agent/templates/security-metrics.json.j2 +++ /dev/null @@ -1,16 +0,0 @@ -{{ { - 'textfile': monitoring_textfile_dir ~ '/security.prom', - 'vpc_network': vpc_network, - 'vpc_hosts': security_vpc_hosts, - 'wg_peer_names': security_wg_peer_names, - 'wg_peer_keys': security_wg_peer_keys, - 'login_users': security_login_users + security_login_users_extra, - 'groups': { - 'sudo': security_sudo_users, - 'docker': security_docker_users + security_docker_users_extra, - }, - 'ports': security_ports + security_ports_extra, - 'containers': security_containers | combine(security_containers_extra), - 'filesets': security_filesets, - 'forgejo_db': security_forgejo_db, -} | to_nice_json }} diff --git a/ansible/roles/restic_backup/defaults/main.yaml b/ansible/roles/restic_backup/defaults/main.yaml deleted file mode 100644 index 9fb0ef1..0000000 --- a/ansible/roles/restic_backup/defaults/main.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# Nightly restic backup of the host to Hetzner Object Storage, one -# repository per region, written independently: losing one region or one -# repository leaves the other complete. - -# renovate: datasource=github-releases depName=restic/restic -restic_version: "0.19.1" - -restic_password: "{{ vault_restic_password }}" -restic_s3_access_key: "{{ s3_access_key }}" -restic_s3_secret_key: "{{ s3_secret_key }}" - -restic_repositories: - hel1: "s3:https://hel1.your-objectstorage.com/{{ s3_bucket_backups_main }}/restic/{{ inventory_hostname }}" - fsn1: "s3:https://fsn1.your-objectstorage.com/{{ s3_bucket_backups_repl }}/restic/{{ inventory_hostname }}" - -# Dumps and snapshots taken by the hooks land here and are backed up too -restic_stage_dir: /var/backups/restic-stage - -restic_paths: [/etc, /opt] -restic_excludes: [] -# Shell lines run in order before the backup, with $STAGE set. A failing -# hook marks the run as failed but the backup still runs. -restic_pre_hooks: [] - -restic_keep: "--keep-daily 7 --keep-weekly 4 --keep-monthly 6" -restic_schedule: "*-*-* 03:30:00" -# Prune (rewrites pack files, so costs S3 requests) once a week only -restic_prune_weekday: Sun - -# Failure mail, through Forgejo's SMTP account -restic_alert_smtp_host: smtp.fastmail.com -restic_alert_smtp_port: 587 -restic_alert_smtp_user: "{{ vault_forgejo_smtp_user }}" -restic_alert_smtp_password: "{{ vault_forgejo_smtp_password }}" -restic_alert_recipient: "{{ vault_crawler_recipient }}" diff --git a/ansible/roles/restic_backup/files/restic-alert b/ansible/roles/restic_backup/files/restic-alert deleted file mode 100644 index 096bfd3..0000000 --- a/ansible/roles/restic_backup/files/restic-alert +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python3 -# Mail the tail of a failed unit's journal. Usage: restic-alert -import os, smtplib, socket, subprocess, sys -from email.message import EmailMessage - -unit = sys.argv[1] -env = dict(l.rstrip("\n").split("=", 1) for l in open("/etc/restic/env") if "=" in l) -log = subprocess.run(["journalctl", "-u", unit, "-n", "60", "--no-pager", "-o", "cat"], - capture_output=True, text=True).stdout - -msg = EmailMessage() -msg["Subject"] = f"[{socket.gethostname()}] {unit} failed" -msg["From"] = env["ALERT_SMTP_USER"] -msg["To"] = env["ALERT_RECIPIENT"] -msg.set_content(log) - -with smtplib.SMTP(env["ALERT_SMTP_HOST"], int(env["ALERT_SMTP_PORT"]), timeout=30) as s: - s.starttls() - s.login(env["ALERT_SMTP_USER"], env["ALERT_SMTP_PASSWORD"]) - s.send_message(msg) diff --git a/ansible/roles/restic_backup/files/restic-alert@.service b/ansible/roles/restic_backup/files/restic-alert@.service deleted file mode 100644 index 498970e..0000000 --- a/ansible/roles/restic_backup/files/restic-alert@.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Mail the failure of %i - -[Service] -Type=oneshot -ExecStart=/usr/local/sbin/restic-alert %i diff --git a/ansible/roles/restic_backup/handlers/main.yaml b/ansible/roles/restic_backup/handlers/main.yaml deleted file mode 100644 index c28484f..0000000 --- a/ansible/roles/restic_backup/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Reload systemd - ansible.builtin.systemd: - daemon_reload: true diff --git a/ansible/roles/restic_backup/tasks/main.yaml b/ansible/roles/restic_backup/tasks/main.yaml deleted file mode 100644 index dc2048e..0000000 --- a/ansible/roles/restic_backup/tasks/main.yaml +++ /dev/null @@ -1,88 +0,0 @@ ---- -- name: Install sqlite3 for consistent copies of live databases - ansible.builtin.apt: - name: [sqlite3, bzip2] - state: present - -- name: Check the installed restic version - ansible.builtin.command: /usr/local/bin/restic version - register: restic_installed - changed_when: false - failed_when: false - check_mode: false - -- name: Install restic {{ restic_version }} - when: ("restic " ~ restic_version ~ " ") not in (restic_installed.stdout | default('')) - block: - - name: Download the release - ansible.builtin.get_url: - url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_amd64.bz2" - dest: "/tmp/restic_{{ restic_version }}.bz2" - checksum: "sha256:https://github.com/restic/restic/releases/download/v{{ restic_version }}/SHA256SUMS" - mode: "0600" - - - name: Unpack it - ansible.builtin.shell: > - bunzip2 -c /tmp/restic_{{ restic_version }}.bz2 > /usr/local/bin/restic.new && - chmod 755 /usr/local/bin/restic.new && - mv /usr/local/bin/restic.new /usr/local/bin/restic && - rm /tmp/restic_{{ restic_version }}.bz2 - changed_when: true - -- name: Create config and cache directories - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: "0700" - loop: [/etc/restic, /var/cache/restic] - -- name: Write credentials - ansible.builtin.template: - src: env.j2 - dest: /etc/restic/env - mode: "0600" - diff: false - -- name: Install the scripts - ansible.builtin.template: - src: restic-backup.j2 - dest: /usr/local/sbin/restic-backup - mode: "0700" - -- name: Install the alert script - ansible.builtin.copy: - src: restic-alert - dest: /usr/local/sbin/restic-alert - mode: "0700" - -- name: Install the systemd units - ansible.builtin.template: - src: "{{ item }}.j2" - dest: "/etc/systemd/system/{{ item }}" - mode: "0644" - loop: [restic-backup.service, restic-backup.timer] - notify: Reload systemd - -- name: Install the alert unit - ansible.builtin.copy: - src: restic-alert@.service - dest: /etc/systemd/system/restic-alert@.service - mode: "0644" - notify: Reload systemd - -- name: Flush handlers - ansible.builtin.meta: flush_handlers - -- name: Create the repositories - ansible.builtin.command: /usr/local/sbin/restic-backup init - register: restic_init - changed_when: "'created' in restic_init.stdout" - when: not ansible_check_mode - -- name: Enable the nightly timer - ansible.builtin.systemd: - name: restic-backup.timer - enabled: true - state: started - # On a first dry run the unit is not installed yet - ignore_errors: "{{ ansible_check_mode }}" diff --git a/ansible/roles/restic_backup/templates/env.j2 b/ansible/roles/restic_backup/templates/env.j2 deleted file mode 100644 index 9b36af8..0000000 --- a/ansible/roles/restic_backup/templates/env.j2 +++ /dev/null @@ -1,8 +0,0 @@ -RESTIC_PASSWORD={{ restic_password }} -AWS_ACCESS_KEY_ID={{ restic_s3_access_key }} -AWS_SECRET_ACCESS_KEY={{ restic_s3_secret_key }} -ALERT_SMTP_HOST={{ restic_alert_smtp_host }} -ALERT_SMTP_PORT={{ restic_alert_smtp_port }} -ALERT_SMTP_USER={{ restic_alert_smtp_user }} -ALERT_SMTP_PASSWORD={{ restic_alert_smtp_password }} -ALERT_RECIPIENT={{ restic_alert_recipient }} diff --git a/ansible/roles/restic_backup/templates/restic-backup.j2 b/ansible/roles/restic_backup/templates/restic-backup.j2 deleted file mode 100644 index 975035b..0000000 --- a/ansible/roles/restic_backup/templates/restic-backup.j2 +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# Managed by Ansible (role restic_backup). -# -# restic-backup run hooks, then backup + forget to every repository -# restic-backup init create the repositories that do not exist yet -# restic-backup plain restic against one repository, e.g. -# restic-backup hel1 snapshots -# restic-backup fsn1 restore latest --target /tmp/r -# -# Repositories: {{ restic_repositories.keys() | join(', ') }} -set -uo pipefail - -set -a; . /etc/restic/env; set +a -export RESTIC_CACHE_DIR=/var/cache/restic -STAGE={{ restic_stage_dir }} - -declare -A REPOS=( -{% for name, url in restic_repositories.items() %} - [{{ name }}]="{{ url }}" -{% endfor %} -) - -log() { echo "restic-backup: $*"; } - -# Last good backup per repository, for Prometheus (node_exporter textfile) -metric() { - local f={{ monitoring_textfile_dir }}/restic_$1.prom - printf '# HELP restic_backup_last_success_timestamp_seconds Last successful restic backup.\n# TYPE restic_backup_last_success_timestamp_seconds gauge\nrestic_backup_last_success_timestamp_seconds{repo="%s"} %s\n' "$1" "$(date +%s)" > "$f.tmp" && mv "$f.tmp" "$f" -} - -case "${1:-}" in -init) - for name in "${!REPOS[@]}"; do - if RESTIC_REPOSITORY="${REPOS[$name]}" restic cat config >/dev/null 2>&1; then - log "$name: exists" - else - RESTIC_REPOSITORY="${REPOS[$name]}" restic init || exit 1 - log "$name: created" - fi - done - ;; - -run) - failed=0 - rm -rf "$STAGE"; install -d -m 700 "$STAGE" - export STAGE -{% for hook in restic_pre_hooks %} - log "hook {{ loop.index }}/{{ restic_pre_hooks | length }}" - ( set -e; {{ hook }} ) || { log "hook failed"; failed=1; } -{% endfor %} - - for name in "${!REPOS[@]}"; do - export RESTIC_REPOSITORY="${REPOS[$name]}" - log "$name: backup" - restic backup --host {{ inventory_hostname }} --one-file-system --exclude-caches \ -{% for e in restic_excludes %} - --exclude '{{ e }}' \ -{% endfor %} - {{ (restic_paths + [restic_stage_dir]) | join(' ') }} || { failed=1; continue; } - - prune="" - [ "$(date +%a)" = "{{ restic_prune_weekday }}" ] && prune="--prune" - log "$name: forget $prune" - restic forget --host {{ inventory_hostname }} {{ restic_keep }} $prune || failed=1 - metric "$name" - done - - rm -rf "$STAGE" - exit $failed - ;; - -*) - [ -n "${1:-}" ] && [ -n "${REPOS[$1]:-}" ] || { sed -n '4,10p' "$0"; exit 2; } - export RESTIC_REPOSITORY="${REPOS[$1]}"; shift - exec restic "$@" - ;; -esac diff --git a/ansible/roles/restic_backup/templates/restic-backup.service.j2 b/ansible/roles/restic_backup/templates/restic-backup.service.j2 deleted file mode 100644 index b7d2384..0000000 --- a/ansible/roles/restic_backup/templates/restic-backup.service.j2 +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=restic backup to Hetzner Object Storage ({{ restic_repositories.keys() | join(', ') }}) -Wants=network-online.target -After=network-online.target docker.service -OnFailure=restic-alert@%n.service - -[Service] -Type=oneshot -ExecStart=/usr/local/sbin/restic-backup run -Nice=10 -IOSchedulingClass=idle -TimeoutStartSec=6h diff --git a/ansible/roles/restic_backup/templates/restic-backup.timer.j2 b/ansible/roles/restic_backup/templates/restic-backup.timer.j2 deleted file mode 100644 index 42fae04..0000000 --- a/ansible/roles/restic_backup/templates/restic-backup.timer.j2 +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Nightly restic backup - -[Timer] -OnCalendar={{ restic_schedule }} -RandomizedDelaySec=10m -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/s3_replicate/defaults/main.yaml b/ansible/roles/s3_replicate/defaults/main.yaml deleted file mode 100644 index a818885..0000000 --- a/ansible/roles/s3_replicate/defaults/main.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Daily one-way replica of the hel1 buckets into their fsn1 twins. -# restic/ is excluded: restic writes its own, independent fsn1 repository. - -# renovate: datasource=docker depName=rclone/rclone -s3_replicate_rclone_version: "1.76.0" - -s3_replicate_pairs: - - { src: asxpio-backups-main, dst: asxpio-backups-repl, exclude: ["restic/**"] } - - { src: asxpio-terraform-main, dst: asxpio-terraform-repl } - - { src: k8s-asxpio-main, dst: k8s-asxpio-repl } - -# A run that would delete more than this stops and fails (and mails): -# a mistake on the hel1 side must not empty the replica the next morning -s3_replicate_max_delete: 1000 -s3_replicate_schedule: "*-*-* 06:00:00" diff --git a/ansible/roles/s3_replicate/handlers/main.yaml b/ansible/roles/s3_replicate/handlers/main.yaml deleted file mode 100644 index c28484f..0000000 --- a/ansible/roles/s3_replicate/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Reload systemd - ansible.builtin.systemd: - daemon_reload: true diff --git a/ansible/roles/s3_replicate/tasks/main.yaml b/ansible/roles/s3_replicate/tasks/main.yaml deleted file mode 100644 index df00c5d..0000000 --- a/ansible/roles/s3_replicate/tasks/main.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: Create the config directory - ansible.builtin.file: - path: /etc/s3-replicate - state: directory - mode: "0700" - -- name: Write credentials - ansible.builtin.template: - src: env.j2 - dest: /etc/s3-replicate/env - mode: "0600" - diff: false - -- name: Install the script - ansible.builtin.template: - src: s3-replicate.j2 - dest: /usr/local/sbin/s3-replicate - mode: "0700" - -- name: Install the systemd units - ansible.builtin.template: - src: "{{ item }}.j2" - dest: "/etc/systemd/system/{{ item }}" - mode: "0644" - loop: [s3-replicate.service, s3-replicate.timer] - notify: Reload systemd - -- name: Flush handlers - ansible.builtin.meta: flush_handlers - -- name: Enable the daily timer - ansible.builtin.systemd: - name: s3-replicate.timer - enabled: true - state: started - # On a first dry run the unit is not installed yet - ignore_errors: "{{ ansible_check_mode }}" diff --git a/ansible/roles/s3_replicate/templates/env.j2 b/ansible/roles/s3_replicate/templates/env.j2 deleted file mode 100644 index b98e812..0000000 --- a/ansible/roles/s3_replicate/templates/env.j2 +++ /dev/null @@ -1,13 +0,0 @@ -RCLONE_CONFIG_HEL1_TYPE=s3 -RCLONE_CONFIG_HEL1_PROVIDER=Other -RCLONE_CONFIG_HEL1_ENDPOINT=https://hel1.your-objectstorage.com -RCLONE_CONFIG_HEL1_REGION=hel1 -RCLONE_CONFIG_HEL1_ACCESS_KEY_ID={{ s3_access_key }} -RCLONE_CONFIG_HEL1_SECRET_ACCESS_KEY={{ s3_secret_key }} -RCLONE_CONFIG_FSN1_TYPE=s3 -RCLONE_CONFIG_FSN1_PROVIDER=Other -RCLONE_CONFIG_FSN1_ENDPOINT=https://fsn1.your-objectstorage.com -RCLONE_CONFIG_FSN1_REGION=fsn1 -RCLONE_CONFIG_FSN1_ACCESS_KEY_ID={{ s3_access_key }} -RCLONE_CONFIG_FSN1_SECRET_ACCESS_KEY={{ s3_secret_key }} -RCLONE_CONFIG_FSN1_NO_CHECK_BUCKET=true diff --git a/ansible/roles/s3_replicate/templates/s3-replicate.j2 b/ansible/roles/s3_replicate/templates/s3-replicate.j2 deleted file mode 100644 index 39126c1..0000000 --- a/ansible/roles/s3_replicate/templates/s3-replicate.j2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Managed by Ansible (role s3_replicate). hel1 -> fsn1, one bucket at a time; -# a failing pair does not stop the others, but fails the run. -set -uo pipefail -failed=0 -rclone() { - docker run --rm --env-file /etc/s3-replicate/env \ - rclone/rclone:{{ s3_replicate_rclone_version }} "$@" -} -{% for p in s3_replicate_pairs %} -echo "s3-replicate: {{ p.src }} -> {{ p.dst }}" -rclone sync hel1:{{ p.src }} fsn1:{{ p.dst }} \ - --fast-list --checkers 16 --transfers 8 --max-delete {{ s3_replicate_max_delete }} \ -{% for e in p.exclude | default([]) %} - --exclude '{{ e }}' \ -{% endfor %} - --stats-one-line -v || failed=1 -{% endfor %} -if [ $failed = 0 ]; then - f={{ monitoring_textfile_dir }}/s3_replicate.prom - printf '# HELP s3_replicate_last_success_timestamp_seconds Last fully successful hel1 to fsn1 replica.\n# TYPE s3_replicate_last_success_timestamp_seconds gauge\ns3_replicate_last_success_timestamp_seconds %s\n' "$(date +%s)" > "$f.tmp" && mv "$f.tmp" "$f" -fi -exit $failed diff --git a/ansible/roles/s3_replicate/templates/s3-replicate.service.j2 b/ansible/roles/s3_replicate/templates/s3-replicate.service.j2 deleted file mode 100644 index 96d63a8..0000000 --- a/ansible/roles/s3_replicate/templates/s3-replicate.service.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Replicate the hel1 buckets to fsn1 -Wants=network-online.target -After=network-online.target docker.service -# Mailer from the restic_backup role -OnFailure=restic-alert@%n.service - -[Service] -Type=oneshot -ExecStart=/usr/local/sbin/s3-replicate -TimeoutStartSec=12h diff --git a/ansible/roles/s3_replicate/templates/s3-replicate.timer.j2 b/ansible/roles/s3_replicate/templates/s3-replicate.timer.j2 deleted file mode 100644 index caedb38..0000000 --- a/ansible/roles/s3_replicate/templates/s3-replicate.timer.j2 +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Daily hel1 -> fsn1 bucket replica - -[Timer] -OnCalendar={{ s3_replicate_schedule }} -RandomizedDelaySec=15m -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/s3fs/defaults/main.yaml b/ansible/roles/s3fs/defaults/main.yaml deleted file mode 100644 index dbcdfd1..0000000 --- a/ansible/roles/s3fs/defaults/main.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -# S3FS role defaults - -# S3 Configuration -s3_endpoint: "https://{{ s3_region }}.your-objectstorage.com" -s3_region: "hel1" - -# S3 Credentials (should be overridden in group_vars or vault) -s3_access_key: "" -s3_secret_key: "" - -# false: no mounts. Unmounts and drops the fstab entries; the credentials -# file stays (backups use it with rclone, /root/backups/rclone-hetzner.sh). -s3fs_enabled: true - -# S3 Buckets to mount (non-replication buckets only) -s3_buckets: - - name: asxpio-terraform-main - mount_point: /mnt/s3/terraform - owner: root - group: root - mode: "0755" - - name: asxpio-backups-main - mount_point: /mnt/s3/backups - owner: root - group: root - mode: "0755" - - name: asxpio-immich-main - mount_point: /mnt/s3/immich - owner: root - group: docker - mode: "0775" - -# S3FS mount options -# Note: s3fs_ensure_diskfree is defined per-host in host_vars/ -s3fs_options: - - "passwd_file=/etc/s3fs/.passwd-s3fs" - - "use_path_request_style" - - "url={{ s3_endpoint }}" - - "allow_other" - - "umask=0022" - - "uid={{ s3fs_uid | default('0') }}" - - "gid={{ s3fs_gid | default('0') }}" - - "use_cache=/var/cache/s3fs" - - "ensure_diskfree={{ s3fs_ensure_diskfree | default(81920) }}" - - "max_stat_cache_size=10000" - - "stat_cache_expire=900" - - "parallel_count=15" - - "multipart_size=52" - - "nocopyapi" - - "enable_noobj_cache" - -# Package dependencies -s3fs_packages: - - s3fs - - fuse3 diff --git a/ansible/roles/s3fs/tasks/main.yaml b/ansible/roles/s3fs/tasks/main.yaml deleted file mode 100644 index ac1aa66..0000000 --- a/ansible/roles/s3fs/tasks/main.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -# S3FS role tasks - Mount S3 buckets using s3fs - -- name: Install s3fs and dependencies - ansible.builtin.apt: - name: "{{ s3fs_packages }}" - state: present - update_cache: true - -- name: Create s3fs credentials directory - ansible.builtin.file: - path: /etc/s3fs - state: directory - mode: '0700' - owner: root - group: root - -- name: Create s3fs password file - ansible.builtin.template: - src: passwd-s3fs.j2 - dest: /etc/s3fs/.passwd-s3fs - mode: '0600' - owner: root - group: root - no_log: true - -- name: Create S3 cache directory - ansible.builtin.file: - path: /var/cache/s3fs - state: directory - mode: '0755' - owner: root - group: root - -- name: Mount S3 buckets - when: s3fs_enabled | bool - block: - - name: Create mount points for S3 buckets - ansible.builtin.file: - path: "{{ item.mount_point }}" - state: directory - mode: "{{ item.mode }}" - owner: "{{ item.owner }}" - group: "{{ item.group }}" - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.name }} -> {{ item.mount_point }}" - - - name: Add S3 buckets to /etc/fstab - ansible.builtin.lineinfile: - path: /etc/fstab - line: "{{ item.name }} {{ item.mount_point }} fuse.s3fs _netdev,{{ s3fs_options | join(',') }} 0 0" - regexp: "^{{ item.name }}\\s+{{ item.mount_point }}" - state: present - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.name }} -> {{ item.mount_point }}" - - - name: Mount all S3 buckets - ansible.builtin.command: - cmd: "mount {{ item.mount_point }}" - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.name }} -> {{ item.mount_point }}" - register: mount_result - changed_when: mount_result.rc == 0 - failed_when: false - - - name: Verify S3 buckets are mounted - ansible.builtin.command: - cmd: "mountpoint -q {{ item.mount_point }}" - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.name }} -> {{ item.mount_point }}" - register: verify_mount - changed_when: false - failed_when: verify_mount.rc != 0 - - - name: Display mounted S3 buckets - ansible.builtin.debug: - msg: | - ✅ S3 Buckets mounted successfully: - {% for bucket in s3_buckets %} - - {{ bucket.name }} -> {{ bucket.mount_point }} - {% endfor %} - - - name: Test write access to Immich bucket - ansible.builtin.copy: - content: "S3FS test file created on {{ ansible_date_time.iso8601 }}" - dest: "{{ s3_buckets | selectattr('name', 'equalto', 'asxpio-immich-main') | map(attribute='mount_point') | first }}/.s3fs-test" - mode: '0644' - when: "'asxpio-immich-main' in s3_buckets | map(attribute='name')" - register: write_test - - - name: Remove test file - ansible.builtin.file: - path: "{{ s3_buckets | selectattr('name', 'equalto', 'asxpio-immich-main') | map(attribute='mount_point') | first }}/.s3fs-test" - state: absent - when: write_test is changed - -- name: Unmount S3 buckets - ansible.builtin.command: - cmd: "umount {{ item.mount_point }}" - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.mount_point }}" - register: umount_result - changed_when: umount_result.rc == 0 - failed_when: false - when: not (s3fs_enabled | bool) - -- name: Remove S3 buckets from /etc/fstab - ansible.builtin.lineinfile: - path: /etc/fstab - regexp: "^{{ item.name }}\\s+{{ item.mount_point }}\\s" - state: absent - loop: "{{ s3_buckets }}" - loop_control: - label: "{{ item.name }} -> {{ item.mount_point }}" - when: not (s3fs_enabled | bool) diff --git a/ansible/roles/s3fs/templates/passwd-s3fs.j2 b/ansible/roles/s3fs/templates/passwd-s3fs.j2 deleted file mode 100644 index 11f3ec7..0000000 --- a/ansible/roles/s3fs/templates/passwd-s3fs.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ s3_access_key }}:{{ s3_secret_key }} diff --git a/ansible/roles/sillytavern/files/docker-compose.yml b/ansible/roles/sillytavern/files/docker-compose.yml deleted file mode 100644 index b2453d6..0000000 --- a/ansible/roles/sillytavern/files/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - sillytavern: - image: ghcr.io/sillytavern/sillytavern:1.19.0 - container_name: sillytavern - restart: unless-stopped - ports: - - "10.20.0.20:8000:8000" - volumes: - - ./config:/home/node/app/config - - ./data:/home/node/app/data - - ./plugins:/home/node/app/plugins diff --git a/ansible/roles/sillytavern/tasks/main.yaml b/ansible/roles/sillytavern/tasks/main.yaml deleted file mode 100644 index b616e77..0000000 --- a/ansible/roles/sillytavern/tasks/main.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Reachable on the WireGuard address only. Bump the image tag in -# files/docker-compose.yml to upgrade. -- name: Deploy SillyTavern - ansible.builtin.include_role: - name: docker_service - vars: - service_name: "sillytavern" - service_base_path: "{{ services_base_path }}/sillytavern" - service_directories: - - { path: "config" } - - { path: "data" } - - { path: "plugins" } - service_files: - - { src: "docker-compose.yml", dest: "docker-compose.yml" } - health_check_enabled: false diff --git a/ansible/roles/ssh_hardening/defaults/main.yaml b/ansible/roles/ssh_hardening/defaults/main.yaml deleted file mode 100644 index b3bb26c..0000000 --- a/ansible/roles/ssh_hardening/defaults/main.yaml +++ /dev/null @@ -1,62 +0,0 @@ ---- -# SSH Hardening Role Default Variables - -# Networks allowed to access SSH (VPC and WireGuard) -# These reference the centralized network variables from group_vars/network.yaml -ssh_allowed_networks: - - "{{ wireguard_network }}" # WireGuard VPN - - "{{ vpc_network }}" # Internal VPC - -# Whether to allow public SSH access for git operations (Forgejo) -# Set to true on Forgejo host, false on other servers -ssh_allow_public_git: false - -# Shell users that require network restrictions -ssh_shell_users: - - asxpi - - zerrtika - - deploy - - root - -# Git user for Forgejo (allowed from anywhere when ssh_allow_public_git is true) -ssh_git_user: git - -# SSH hardening settings -ssh_max_auth_tries: 3 -ssh_max_sessions: 5 -ssh_client_alive_interval: 300 -ssh_client_alive_count_max: 2 - -# Strong cryptography settings -ssh_ciphers: - - chacha20-poly1305@openssh.com - - aes256-gcm@openssh.com - - aes128-gcm@openssh.com - - aes256-ctr - - aes192-ctr - - aes128-ctr - -ssh_macs: - - hmac-sha2-512-etm@openssh.com - - hmac-sha2-256-etm@openssh.com - - hmac-sha2-512 - - hmac-sha2-256 - -ssh_kex_algorithms: - - sntrup761x25519-sha512@openssh.com # Post-quantum hybrid (OpenSSH 9.0+) - - curve25519-sha256 - - curve25519-sha256@libssh.org - - diffie-hellman-group-exchange-sha256 - - diffie-hellman-group16-sha512 - - diffie-hellman-group18-sha512 - -# Public key algorithms (includes RSA-SHA2 for existing keys) -ssh_pubkey_accepted_algorithms: - - ssh-ed25519 - - ssh-ed25519-cert-v01@openssh.com - - sk-ssh-ed25519@openssh.com - - ecdsa-sha2-nistp256 - - ecdsa-sha2-nistp384 - - ecdsa-sha2-nistp521 - - rsa-sha2-512 - - rsa-sha2-256 diff --git a/ansible/roles/ssh_hardening/handlers/main.yaml b/ansible/roles/ssh_hardening/handlers/main.yaml deleted file mode 100644 index c4bd317..0000000 --- a/ansible/roles/ssh_hardening/handlers/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: restart sshd - ansible.builtin.systemd: - name: sshd - state: restarted - enabled: true diff --git a/ansible/roles/ssh_hardening/tasks/main.yaml b/ansible/roles/ssh_hardening/tasks/main.yaml deleted file mode 100644 index 2caa134..0000000 --- a/ansible/roles/ssh_hardening/tasks/main.yaml +++ /dev/null @@ -1,104 +0,0 @@ ---- -- name: Install iptables and iptables-persistent - ansible.builtin.apt: - name: - - iptables - - iptables-persistent - - netfilter-persistent - state: present - update_cache: true - -- name: Deploy SSH hardening configuration - ansible.builtin.template: - src: 99-ssh-hardening.conf.j2 - dest: /etc/ssh/sshd_config.d/99-ssh-hardening.conf - mode: '0644' - owner: root - group: root - validate: 'sshd -t -f %s' - register: ssh_config_changed - -- name: Restart SSH daemon asynchronously (to maintain connection) - ansible.builtin.shell: "nohup systemctl restart sshd &" - when: ssh_config_changed.changed - changed_when: true - -- name: Wait for SSH port to become available - ansible.builtin.wait_for: - host: "{{ ansible_host | default(inventory_hostname) }}" - port: 22 - delay: 2 - timeout: 30 - state: started - when: ssh_config_changed.changed - delegate_to: localhost - -- name: Reset SSH connection to pick up new configuration - ansible.builtin.meta: reset_connection - when: ssh_config_changed.changed - -- name: Verify SSH connection after restart - ansible.builtin.ping: - when: ssh_config_changed.changed - -- name: Configure iptables for SSH restrictions (non-Forgejo servers) - block: - - name: Accept SSH from WireGuard network - ansible.builtin.iptables: - chain: INPUT - protocol: tcp - destination_port: '22' - source: "{{ wireguard_network }}" - jump: ACCEPT - comment: Allow SSH from WireGuard VPN - - - name: Accept SSH from VPC network - ansible.builtin.iptables: - chain: INPUT - protocol: tcp - destination_port: '22' - source: "{{ vpc_network }}" - jump: ACCEPT - comment: Allow SSH from internal VPC - - - name: Accept established SSH connections - ansible.builtin.iptables: - chain: INPUT - protocol: tcp - destination_port: '22' - ctstate: ESTABLISHED,RELATED - jump: ACCEPT - comment: Allow established SSH connections - - - name: Drop all other SSH connections - ansible.builtin.iptables: - chain: INPUT - protocol: tcp - destination_port: '22' - jump: DROP - comment: Drop SSH from untrusted networks - - when: not ssh_allow_public_git - -- name: Save iptables rules - ansible.builtin.shell: | - iptables-save > /etc/iptables/rules.v4 - netfilter-persistent save - args: - executable: /bin/bash - changed_when: true - when: not ssh_allow_public_git - -- name: Display SSH access information - ansible.builtin.debug: - msg: | - SSH hardening applied to {{ inventory_hostname }}: - - Shell users ({{ ssh_shell_users | join(', ') }}): Only from {{ ssh_allowed_networks | join(', ') }} - {% if ssh_allow_public_git %} - - Git user ({{ ssh_git_user }}): Public access allowed for Forgejo - - No iptables restrictions (sshd AllowUsers controls access) - {% else %} - - iptables rules: SSH blocked except from trusted networks - {% endif %} - - Strong cryptography enforced (RSA-SHA2, Ed25519, ChaCha20, AES-GCM) - - Authorized keys files: .ssh/authorized_keys (manual), .ssh/authorized_keys.forgejo (git-managed) diff --git a/ansible/roles/ssh_hardening/templates/99-ssh-hardening.conf.j2 b/ansible/roles/ssh_hardening/templates/99-ssh-hardening.conf.j2 deleted file mode 100644 index e8c1a87..0000000 --- a/ansible/roles/ssh_hardening/templates/99-ssh-hardening.conf.j2 +++ /dev/null @@ -1,34 +0,0 @@ -# SSH Hardening Configuration -# Generated by Ansible on {{ ansible_date_time.iso8601 }} -# Server: {{ inventory_hostname }} - -# Connection settings -MaxAuthTries {{ ssh_max_auth_tries }} -MaxSessions {{ ssh_max_sessions }} -ClientAliveInterval {{ ssh_client_alive_interval }} -ClientAliveCountMax {{ ssh_client_alive_count_max }} - -# Security hardening -StrictModes yes -X11Forwarding no -PrintMotd no - -# Multiple authorized_keys files -# - .ssh/authorized_keys: Manual/emergency keys -# - .ssh/authorized_keys.forgejo: Git-managed keys (deployed via Forgejo Actions) -AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.forgejo - -# Strong cryptography only -Ciphers {{ ssh_ciphers | join(',') }} -MACs {{ ssh_macs | join(',') }} -KexAlgorithms {{ ssh_kex_algorithms | join(',') }} -PubkeyAcceptedAlgorithms {{ ssh_pubkey_accepted_algorithms | join(',') }} - -# Access control - restrict shell users to trusted networks only -{% if ssh_shell_users | length > 0 and ssh_allowed_networks | length > 0 %} -AllowUsers {% for user in ssh_shell_users %}{% for network in ssh_allowed_networks %}{{ user }}@{{ network }} {% endfor %}{% endfor %}{% if ssh_allow_public_git %}{{ ssh_git_user }}{% endif %} - -{% elif ssh_allow_public_git %} -# Allow Forgejo git user from anywhere for git operations -AllowUsers {{ ssh_git_user }} -{% endif %} diff --git a/ansible/roles/swap/defaults/main.yaml b/ansible/roles/swap/defaults/main.yaml deleted file mode 100644 index 00936a2..0000000 --- a/ansible/roles/swap/defaults/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Swapfile so a memory spike pages out instead of OOM-killing a service. -swap_file: /swapfile -swap_size_mb: 2048 -# Low: only swap under real pressure, keep the page cache for the apps. -swap_swappiness: 10 diff --git a/ansible/roles/swap/tasks/main.yaml b/ansible/roles/swap/tasks/main.yaml deleted file mode 100644 index fcb84f4..0000000 --- a/ansible/roles/swap/tasks/main.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- name: Check for an existing swapfile - ansible.builtin.stat: - path: "{{ swap_file }}" - register: swap_stat - -- name: Create swapfile - ansible.builtin.command: - cmd: "dd if=/dev/zero of={{ swap_file }} bs=1M count={{ swap_size_mb }} status=none" - when: not swap_stat.stat.exists or (swap_stat.stat.size != swap_size_mb * 1024 * 1024) - register: swap_created - -- name: Restrict swapfile permissions - ansible.builtin.file: - path: "{{ swap_file }}" - mode: '0600' - owner: root - group: root - when: not ansible_check_mode or swap_stat.stat.exists - -- name: Format swapfile - ansible.builtin.command: - cmd: "mkswap {{ swap_file }}" - when: swap_created is changed - -- name: Add swapfile to /etc/fstab - ansible.builtin.lineinfile: - path: /etc/fstab - regexp: "^{{ swap_file }}\\s" - line: "{{ swap_file }} none swap sw 0 0" - -- name: Enable swap - ansible.builtin.command: - cmd: "swapon {{ swap_file }}" - register: swapon_result - changed_when: swapon_result.rc == 0 - failed_when: swapon_result.rc != 0 and 'busy' not in swapon_result.stderr - -- name: Set swappiness - ansible.builtin.copy: - dest: /etc/sysctl.d/90-swap.conf - content: "vm.swappiness = {{ swap_swappiness }}\n" - mode: '0644' - register: swappiness_conf - -- name: Apply swappiness - ansible.builtin.command: - cmd: sysctl -p /etc/sysctl.d/90-swap.conf - when: swappiness_conf is changed diff --git a/ansible/roles/traefik/handlers/main.yaml b/ansible/roles/traefik/handlers/main.yaml deleted file mode 100644 index 3bebae5..0000000 --- a/ansible/roles/traefik/handlers/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Restart Traefik - community.docker.docker_compose_v2: - project_src: /opt/traefik - state: restarted diff --git a/ansible/roles/traefik/tasks/main.yaml b/ansible/roles/traefik/tasks/main.yaml deleted file mode 100644 index 2178bce..0000000 --- a/ansible/roles/traefik/tasks/main.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Validate Traefik variables - ansible.builtin.import_tasks: validate.yaml - -- name: Create Traefik Docker network - community.docker.docker_network: - name: "{{ traefik_network }}" - driver: bridge - state: present - -- name: Deploy Traefik - ansible.builtin.include_role: - name: docker_service - vars: - service_name: "traefik" - service_base_path: "{{ traefik_base_path }}" - service_directories: - - { path: "config" } - - { path: "letsencrypt" } - - { path: "logs" } - service_templates: - - { src: "traefik.yml.j2", dest: "traefik.yml" } - - { src: "dynamic.yml.j2", dest: "config/dynamic.yml" } - - { src: "env.j2", dest: ".env" } - - { src: "docker-compose.yml.j2", dest: "docker-compose.yml" } - # The Coraza WAF middlewares were never wired to a router - service_absent: - - config/waf-middleware.yml - - config/waf-wp.yml - health_check_host: "{{ wireguard_ip }}" # dashboard listens on WireGuard only - health_check_port: "{{ traefik_dashboard_port }}" - health_check_delay: 3 diff --git a/ansible/roles/traefik/tasks/validate.yaml b/ansible/roles/traefik/tasks/validate.yaml deleted file mode 100644 index 01e6c26..0000000 --- a/ansible/roles/traefik/tasks/validate.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# Variable validation for traefik role - -- name: Validate Traefik required variables - ansible.builtin.assert: - that: - - traefik_base_path is defined - - traefik_base_path | length > 0 - - traefik_network is defined - - traefik_network | length > 0 - - traefik_dashboard_port is defined - - traefik_dashboard_port | int > 0 - - traefik_dashboard_port | int < 65536 - - letsencrypt_email is defined - - letsencrypt_email | length > 0 - - letsencrypt_email is match("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$") - fail_msg: | - Traefik role requires: - - traefik_base_path (installation directory) - - traefik_network (Docker network name) - - traefik_dashboard_port (1-65535) - - letsencrypt_email (valid email address) - success_msg: "Traefik variables validated successfully" diff --git a/ansible/roles/traefik/templates/docker-compose.yml.j2 b/ansible/roles/traefik/templates/docker-compose.yml.j2 deleted file mode 100644 index 1f238d2..0000000 --- a/ansible/roles/traefik/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,44 +0,0 @@ -name: traefik - -services: - traefik: - container_name: traefik - image: traefik:{{ traefik_version }} - restart: unless-stopped - security_opt: - - no-new-privileges:true - ports: - - "80:80" - - "443:443" - - "{{ wireguard_ip }}:{{ traefik_dashboard_port }}:8080" # Dashboard on WireGuard IP only - volumes: - - /etc/localtime:/etc/localtime:ro - - /var/run/docker.sock:/var/run/docker.sock:ro - - ./traefik.yml:/traefik.yml:ro - - ./config:/config:ro - - ./letsencrypt:/letsencrypt - - ./logs:/var/log/traefik - networks: - - {{ traefik_network }} - env_file: - - .env - environment: - - TZ=UTC - labels: - - "traefik.enable=true" - - "traefik.docker.network={{ traefik_network }}" - - # Dashboard Router with IP Whitelist - - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.asxp.io`)" - - "traefik.http.routers.traefik-dashboard.entrypoints=websecure" - - "traefik.http.routers.traefik-dashboard.tls=true" - - "traefik.http.routers.traefik-dashboard.tls.certresolver=letsencrypt" - - "traefik.http.routers.traefik-dashboard.service=api@internal" - - # IP Whitelist Middleware (VPC + WireGuard) - - "traefik.http.middlewares.traefik-ipwhitelist.ipwhitelist.sourcerange=10.10.0.0/20,10.20.0.0/24" - - "traefik.http.routers.traefik-dashboard.middlewares=traefik-ipwhitelist" - -networks: - {{ traefik_network }}: - external: true diff --git a/ansible/roles/traefik/templates/dynamic.yml.j2 b/ansible/roles/traefik/templates/dynamic.yml.j2 deleted file mode 100644 index 6a9c394..0000000 --- a/ansible/roles/traefik/templates/dynamic.yml.j2 +++ /dev/null @@ -1,38 +0,0 @@ -# Traefik Dynamic Configuration - -http: - middlewares: - # Security Headers Middleware - secure-headers: - headers: - sslRedirect: true - stsSeconds: 31536000 - stsIncludeSubdomains: true - stsPreload: true - forceSTSHeader: true - frameDeny: true - contentTypeNosniff: true - browserXssFilter: true - - # Rate Limiting Middleware - rate-limit: - rateLimit: - average: 100 - burst: 50 - period: 1s - - routers: - # Exists only to obtain the XMPP certificate (ejabberd on services); - # role xmpp_cert_sync pushes it there on every renewal. No traffic - # reaches it: these names point at services. asxp.io is pushed from - # the site's own certificate. - xmpp-cert: - rule: "Host(`{{ xmpp_cert_main }}`)" - entryPoints: [websecure] - priority: 1 - service: noop@internal - tls: - certResolver: letsencrypt - domains: - - main: {{ xmpp_cert_main }} - sans: {{ xmpp_cert_sans | to_json }} diff --git a/ansible/roles/traefik/templates/env.j2 b/ansible/roles/traefik/templates/env.j2 deleted file mode 100644 index 0c40b58..0000000 --- a/ansible/roles/traefik/templates/env.j2 +++ /dev/null @@ -1,8 +0,0 @@ -# Traefik Configuration - -# Let's Encrypt Email (required for SSL certificates) -LETSENCRYPT_EMAIL= - -# Timezone -TZ=UTC -LETSENCRYPT_EMAIL={{ letsencrypt_email }} diff --git a/ansible/roles/traefik/templates/traefik.yml.j2 b/ansible/roles/traefik/templates/traefik.yml.j2 deleted file mode 100644 index 1792ef1..0000000 --- a/ansible/roles/traefik/templates/traefik.yml.j2 +++ /dev/null @@ -1,61 +0,0 @@ -# Traefik Static Configuration - -# API and Dashboard -api: - dashboard: true - insecure: true # Dashboard accessible on :8080 without auth (restricted by network) - -# Entry Points -entryPoints: - web: - address: ":80" - http: - redirections: - entryPoint: - to: websecure - scheme: https - websecure: - address: ":443" - # Prometheus metrics, reached on the traefik network only (not published) - metrics: - address: ":8082" - -metrics: - prometheus: - entryPoint: metrics - addRoutersLabels: true - addServicesLabels: true - -# Docker Provider -providers: - docker: - endpoint: "unix:///var/run/docker.sock" - exposedByDefault: false - network: {{ traefik_network }} - file: - directory: /config - watch: true - -# Let's Encrypt Certificate Resolver -certificatesResolvers: - letsencrypt: - acme: - email: {{ letsencrypt_email | default('admin@asxp.io') }} - storage: /letsencrypt/acme.json - httpChallenge: - entryPoint: web - -# Logging -log: - level: INFO - filePath: /var/log/traefik/traefik.log - -accessLog: - filePath: /var/log/traefik/access.log - bufferingSize: 100 - fields: - headers: - defaultMode: drop - names: - User-Agent: keep - Referer: keep diff --git a/ansible/roles/wireguard/defaults/main.yaml b/ansible/roles/wireguard/defaults/main.yaml deleted file mode 100644 index f6ac1e5..0000000 --- a/ansible/roles/wireguard/defaults/main.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# WireGuard default configuration -wireguard_interface: wg0 -wireguard_port: 60101 -wireguard_ipv4: 10.20.0.10 -wireguard_ipv6: fd69:69:69::1 -wireguard_ipv4_network: 10.20.0.0/24 -wireguard_ipv6_network: fd69:69:69::/64 - -# Directory paths -wireguard_config_dir: /etc/wireguard -wireguard_keys_dir: "{{ wireguard_config_dir }}/keys" -wireguard_clients_dir: "{{ wireguard_config_dir }}/clients" - -# Enable IPv4 forwarding -wireguard_enable_forwarding: true - -# UFW configuration (if false, will use iptables rules in PostUp/PostDown) -# Default to false since most Debian servers don't have UFW enabled by default -wireguard_enable_ufw: false - -# Client configurations -wireguard_clients: [] -# Example client structure: -# wireguard_clients: -# - name: laptop -# ipv4: 10.20.0.2 -# ipv6: fd69:69:69::2 -# preshared_key: true # Optional: generate preshared key for extra security -# - name: phone -# ipv4: 10.20.0.3 -# ipv6: fd69:69:69::3 -# preshared_key: true - -# DNS servers for clients (optional) -wireguard_dns_servers: [] - -# Additional routes for split tunneling (optional) -wireguard_additional_routes: [] diff --git a/ansible/roles/wireguard/handlers/main.yaml b/ansible/roles/wireguard/handlers/main.yaml deleted file mode 100644 index 362fd15..0000000 --- a/ansible/roles/wireguard/handlers/main.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: restart wireguard - ansible.builtin.shell: | - wg syncconf {{ wireguard_interface }} <(wg-quick strip {{ wireguard_interface }}) - args: - executable: /bin/bash - ignore_errors: true - register: wg_sync_result - -- name: restart wireguard (fallback) - ansible.builtin.systemd: - name: "wg-quick@{{ wireguard_interface }}" - state: restarted - enabled: true - when: wg_sync_result is failed - -- name: reload wireguard - ansible.builtin.shell: | - wg syncconf {{ wireguard_interface }} <(wg-quick strip {{ wireguard_interface }}) - args: - executable: /bin/bash diff --git a/ansible/roles/wireguard/tasks/main.yaml b/ansible/roles/wireguard/tasks/main.yaml deleted file mode 100644 index c66949c..0000000 --- a/ansible/roles/wireguard/tasks/main.yaml +++ /dev/null @@ -1,222 +0,0 @@ ---- -- name: Validate WireGuard variables - ansible.builtin.import_tasks: validate.yaml - -- name: Install WireGuard - ansible.builtin.apt: - name: - - wireguard - - wireguard-tools - state: present - update_cache: true - -- name: Install UFW (if needed) - ansible.builtin.apt: - name: ufw - state: present - when: wireguard_enable_ufw - -- name: Create WireGuard directories - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: '0700' - owner: root - group: root - loop: - - "{{ wireguard_config_dir }}" - - "{{ wireguard_keys_dir }}" - - "{{ wireguard_clients_dir }}" - -- name: Check if server private key exists - ansible.builtin.stat: - path: "{{ wireguard_keys_dir }}/server_private.key" - register: server_private_key_stat - -- name: Generate server private key - ansible.builtin.shell: | - wg genkey > {{ wireguard_keys_dir }}/server_private.key - chmod 600 {{ wireguard_keys_dir }}/server_private.key - when: not server_private_key_stat.stat.exists - -- name: Generate server public key - ansible.builtin.shell: | - wg pubkey < {{ wireguard_keys_dir }}/server_private.key > {{ wireguard_keys_dir }}/server_public.key - chmod 600 {{ wireguard_keys_dir }}/server_public.key - when: not server_private_key_stat.stat.exists - -- name: Read server private key - ansible.builtin.slurp: - src: "{{ wireguard_keys_dir }}/server_private.key" - register: server_private_key_content - -- name: Read server public key - ansible.builtin.slurp: - src: "{{ wireguard_keys_dir }}/server_public.key" - register: server_public_key_content - -- name: Set server key facts - ansible.builtin.set_fact: - wireguard_server_private_key: "{{ server_private_key_content.content | b64decode | trim }}" - wireguard_server_public_key: "{{ server_public_key_content.content | b64decode | trim }}" - -- name: Generate client keys - block: - - name: Check if client private key exists - ansible.builtin.stat: - path: "{{ wireguard_keys_dir }}/{{ item.name }}_private.key" - register: client_private_key_stats - loop: "{{ wireguard_clients }}" - - - name: Generate client private keys - ansible.builtin.shell: | - wg genkey > {{ wireguard_keys_dir }}/{{ item.item.name }}_private.key - chmod 600 {{ wireguard_keys_dir }}/{{ item.item.name }}_private.key - loop: "{{ client_private_key_stats.results }}" - when: not item.stat.exists - - - name: Check if client public key exists - ansible.builtin.stat: - path: "{{ wireguard_keys_dir }}/{{ item.name }}_public.key" - register: client_public_key_stats - loop: "{{ wireguard_clients }}" - - - name: Generate client public keys - ansible.builtin.shell: | - wg pubkey < {{ wireguard_keys_dir }}/{{ item.item.name }}_private.key > {{ wireguard_keys_dir }}/{{ item.item.name }}_public.key - chmod 600 {{ wireguard_keys_dir }}/{{ item.item.name }}_public.key - loop: "{{ client_public_key_stats.results }}" - when: not item.stat.exists - - - name: Check if client preshared key exists - ansible.builtin.stat: - path: "{{ wireguard_keys_dir }}/{{ item.name }}_preshared.key" - register: client_preshared_key_stats - loop: "{{ wireguard_clients }}" - when: item.preshared_key | default(false) - - - name: Generate client preshared keys (if enabled) - ansible.builtin.shell: | - wg genpsk > {{ wireguard_keys_dir }}/{{ item.item.name }}_preshared.key - chmod 600 {{ wireguard_keys_dir }}/{{ item.item.name }}_preshared.key - loop: "{{ client_preshared_key_stats.results | default([]) }}" - when: - - client_preshared_key_stats.results is defined - - not item.stat.exists - - - name: Read client private keys - ansible.builtin.slurp: - src: "{{ wireguard_keys_dir }}/{{ item.name }}_private.key" - register: client_private_keys - loop: "{{ wireguard_clients }}" - - - name: Read client public keys - ansible.builtin.slurp: - src: "{{ wireguard_keys_dir }}/{{ item.name }}_public.key" - register: client_public_keys - loop: "{{ wireguard_clients }}" - - - name: Read client preshared keys - ansible.builtin.slurp: - src: "{{ wireguard_keys_dir }}/{{ item.name }}_preshared.key" - register: client_preshared_keys - loop: "{{ wireguard_clients }}" - when: item.preshared_key | default(false) - ignore_errors: true - - when: wireguard_clients | length > 0 - -- name: Process client keys into structured data - ansible.builtin.set_fact: - wireguard_client_configs: "{{ wireguard_client_configs | default([]) + [client_config] }}" - loop: "{{ wireguard_clients }}" - loop_control: - index_var: client_index - vars: - private_key: "{{ client_private_keys.results[client_index].content | b64decode | trim }}" - public_key: "{{ client_public_keys.results[client_index].content | b64decode | trim }}" - preshared_key: "{{ client_preshared_keys.results[client_index].content | b64decode | trim if (item.preshared_key | default(false) and client_preshared_keys.results[client_index] is defined and not client_preshared_keys.results[client_index].failed | default(false)) else '' }}" - client_config: - name: "{{ item.name }}" - ipv4: "{{ item.ipv4 }}" - ipv6: "{{ item.ipv6 }}" - private_key: "{{ private_key }}" - public_key: "{{ public_key }}" - preshared_key: "{{ preshared_key }}" - persistent_keepalive: "{{ item.persistent_keepalive | default(25) }}" - when: wireguard_clients | length > 0 - -- name: Enable IPv4 forwarding - ansible.posix.sysctl: - name: net.ipv4.ip_forward - value: '1' - sysctl_set: true - state: present - reload: true - when: wireguard_enable_forwarding - -- name: Enable IPv6 forwarding - ansible.posix.sysctl: - name: net.ipv6.conf.all.forwarding - value: '1' - sysctl_set: true - state: present - reload: true - when: wireguard_enable_forwarding - -- name: Get default network interface - ansible.builtin.shell: ip route | grep default | awk '{print $5}' | head -n1 - register: default_interface - changed_when: false - -- name: Set default interface fact - ansible.builtin.set_fact: - wireguard_default_interface: "{{ default_interface.stdout }}" - -- name: Deploy WireGuard server configuration - ansible.builtin.template: - src: wg0.conf.j2 - dest: "{{ wireguard_config_dir }}/{{ wireguard_interface }}.conf" - mode: '0600' - owner: root - group: root - notify: restart wireguard - -- name: Configure UFW for WireGuard - block: - - name: Allow WireGuard port through UFW - community.general.ufw: - rule: allow - port: "{{ wireguard_port }}" - proto: udp - - - name: Allow forwarding on WireGuard interface - community.general.ufw: - rule: allow - route: true - interface_in: "{{ wireguard_interface }}" - when: wireguard_enable_ufw - -- name: Enable and start WireGuard service - ansible.builtin.systemd: - name: "wg-quick@{{ wireguard_interface }}" - enabled: true - state: started - -- name: Generate client configuration files - ansible.builtin.template: - src: client.conf.j2 - dest: "{{ wireguard_clients_dir }}/{{ item.name }}.conf" - mode: '0600' - owner: root - group: root - loop: "{{ wireguard_client_configs | default([]) }}" - when: wireguard_clients | length > 0 - -- name: Fetch client configuration files to local machine - ansible.builtin.fetch: - src: "{{ wireguard_clients_dir }}/{{ item.name }}.conf" - dest: "./wireguard-configs/{{ inventory_hostname }}/{{ item.name }}.conf" - flat: true - loop: "{{ wireguard_clients }}" - when: wireguard_clients | length > 0 diff --git a/ansible/roles/wireguard/tasks/validate.yaml b/ansible/roles/wireguard/tasks/validate.yaml deleted file mode 100644 index c690037..0000000 --- a/ansible/roles/wireguard/tasks/validate.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# Variable validation for wireguard role - -- name: Validate WireGuard required variables - ansible.builtin.assert: - that: - - wireguard_network is defined - - wireguard_network | length > 0 - - wireguard_port is defined - - wireguard_port | int > 0 - - wireguard_port | int < 65536 - - wireguard_interface is defined - - wireguard_interface | length > 0 - fail_msg: | - WireGuard role requires: - - wireguard_network (CIDR notation, e.g., 10.20.0.0/24) - - wireguard_port (1-65535) - - wireguard_interface (e.g., wg0) - success_msg: "WireGuard variables validated successfully" diff --git a/ansible/roles/wireguard/templates/client.conf.j2 b/ansible/roles/wireguard/templates/client.conf.j2 deleted file mode 100644 index 22c481e..0000000 --- a/ansible/roles/wireguard/templates/client.conf.j2 +++ /dev/null @@ -1,21 +0,0 @@ -# WireGuard Client Configuration - {{ item.name }} -# Generated by Ansible on {{ ansible_date_time.iso8601 }} -# Server: {{ inventory_hostname }} - -[Interface] -PrivateKey = {{ item.private_key }} -Address = {{ item.ipv4 }}/32,{{ item.ipv6 }}/128 -{% if wireguard_dns_servers | length > 0 %} -DNS = {{ wireguard_dns_servers | join(', ') }} -{% endif %} - -[Peer] -PublicKey = {{ wireguard_server_public_key }} -{% if item.preshared_key %} -PresharedKey = {{ item.preshared_key }} -{% endif %} -Endpoint = {{ public_ip }}:{{ wireguard_port }} -# Allow all VPN traffic (peer-to-peer connectivity) -AllowedIPs = {{ wireguard_ipv4_network }},{{ wireguard_ipv6_network }}{% if wireguard_additional_routes | length > 0 %},{{ wireguard_additional_routes | join(',') }}{% endif %} - -PersistentKeepalive = {{ item.persistent_keepalive | default(25) }} diff --git a/ansible/roles/wireguard/templates/wg0.conf.j2 b/ansible/roles/wireguard/templates/wg0.conf.j2 deleted file mode 100644 index ce7bf91..0000000 --- a/ansible/roles/wireguard/templates/wg0.conf.j2 +++ /dev/null @@ -1,39 +0,0 @@ -# WireGuard Server Configuration - {{ wireguard_interface }} -# Generated by Ansible on {{ ansible_date_time.iso8601 }} - -[Interface] -Address = {{ wireguard_ipv4 }}/{{ wireguard_ipv4_network.split('/')[-1] }},{{ wireguard_ipv6 }}/{{ wireguard_ipv6_network.split('/')[-1] }} -ListenPort = {{ wireguard_port }} -PrivateKey = {{ wireguard_server_private_key }} - -{% if wireguard_enable_ufw %} -# UFW handles firewall rules -{% else %} -# Firewall rules for iptables -PostUp = iptables -I INPUT -p udp --dport {{ wireguard_port }} -j ACCEPT -PostUp = iptables -I FORWARD -i {{ wireguard_default_interface }} -o {{ wireguard_interface }} -j ACCEPT -PostUp = iptables -I FORWARD -i {{ wireguard_interface }} -j ACCEPT -PostUp = iptables -t nat -A POSTROUTING -o {{ wireguard_default_interface }} -j MASQUERADE -PostUp = ip6tables -I FORWARD -i {{ wireguard_interface }} -j ACCEPT -PostUp = ip6tables -t nat -A POSTROUTING -o {{ wireguard_default_interface }} -j MASQUERADE -PostDown = iptables -D INPUT -p udp --dport {{ wireguard_port }} -j ACCEPT -PostDown = iptables -D FORWARD -i {{ wireguard_default_interface }} -o {{ wireguard_interface }} -j ACCEPT -PostDown = iptables -D FORWARD -i {{ wireguard_interface }} -j ACCEPT -PostDown = iptables -t nat -D POSTROUTING -o {{ wireguard_default_interface }} -j MASQUERADE -PostDown = ip6tables -D FORWARD -i {{ wireguard_interface }} -j ACCEPT -PostDown = ip6tables -t nat -D POSTROUTING -o {{ wireguard_default_interface }} -j MASQUERADE -{% endif %} - -{% for client in wireguard_client_configs | default([]) %} -### Client {{ client.name }} -[Peer] -PublicKey = {{ client.public_key }} -{% if client.preshared_key %} -PresharedKey = {{ client.preshared_key }} -{% endif %} -AllowedIPs = {{ client.ipv4 }}/32,{{ client.ipv6 }}/128 -{% if client.persistent_keepalive | default(25) %} -PersistentKeepalive = {{ client.persistent_keepalive }} -{% endif %} - -{% endfor %} diff --git a/ansible/roles/xmpp/tasks/main.yaml b/ansible/roles/xmpp/tasks/main.yaml deleted file mode 100644 index 248c3d9..0000000 --- a/ansible/roles/xmpp/tasks/main.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Compose and settings are managed here. The secrets and keys stay on the -# host as data, like a game world, and are covered by the restic backup: -# state/secrets.env ejabberd secrets -# state/certs/server.pem TLS certificate (asxp.io, conference., xmpp.), issued by -# Traefik on ops and pushed by role xmpp_cert_sync -# state/apushd/ push settings and VAPID key -# state/tackygram/{env,key} gateway credentials and master key -# Data: volumes xmpp_database, xmpp_tackygram. -- name: Deploy XMPP - ansible.builtin.include_role: - name: docker_service - vars: - service_name: xmpp - service_base_path: "{{ services_base_path }}/xmpp" - service_directories: - - { path: state, mode: "0700" } - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: settings.env.j2, dest: settings.env } - health_check_port: 5222 diff --git a/ansible/roles/xmpp/templates/docker-compose.yml.j2 b/ansible/roles/xmpp/templates/docker-compose.yml.j2 deleted file mode 100644 index cc0c148..0000000 --- a/ansible/roles/xmpp/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,54 +0,0 @@ -# Managed by Ansible (role xmpp). After compose.yaml and -# compose.tackygram.yaml of anotherim-server, CERTS=files. -services: - ejabberd: - image: dev.another.im/another-im/anotherim-server:{{ xmpp_ejabberd_version }} - env_file: - - settings.env - - state/secrets.env - ports: - - "5222:5222" # clients, STARTTLS - - "5223:5223" # clients, direct TLS - - "5269:5269" # other servers - - "5443:5443" # WebSocket, host-meta - - "8448:8448" # Matrix federation - - "3478:3478/udp" # STUN and TURN - - "3478:3478/tcp" - - "49160-49199:49160-49199/udp" # TURN relay - - "7777:7777" # SOCKS5 bytestreams proxy - - "{{ xmpp_tackygram_call_ports }}:{{ xmpp_tackygram_call_ports }}/udp" # gateway calls - volumes: - - database:/opt/ejabberd/database - - logs:/opt/ejabberd/logs - - ./state/certs:/opt/ejabberd/conf/certs:ro - restart: unless-stopped - - # Push App Server and Telegram gateway share ejabberd's network - # namespace: they reach its component port on 127.0.0.1 only. - apushd: - image: dev.another.im/another-im/apushd:{{ xmpp_apushd_version }} - network_mode: service:ejabberd - depends_on: [ejabberd] - volumes: - - ./state/apushd:/etc/apushd:ro - restart: unless-stopped - - tackygram: - image: dev.another.im/another-im/tackygram:{{ xmpp_tackygram_version }} - network_mode: service:ejabberd - depends_on: [ejabberd] - env_file: - - state/tackygram/env - environment: - CREDENTIALS_DIRECTORY: /run/credentials - TACKYGRAM_CALL_IP: "{{ public_ip }}" - TACKYGRAM_CALL_PORTS: "{{ xmpp_tackygram_call_ports }}" - volumes: - - tackygram:/var/lib/tackygram - - ./state/tackygram/key:/run/credentials/gateway-key:ro - restart: unless-stopped - -volumes: - database: - logs: - tackygram: diff --git a/ansible/roles/xmpp/templates/settings.env.j2 b/ansible/roles/xmpp/templates/settings.env.j2 deleted file mode 100644 index cf87eec..0000000 --- a/ansible/roles/xmpp/templates/settings.env.j2 +++ /dev/null @@ -1,6 +0,0 @@ -EJABBERD_MACRO_XMPP_DOMAIN={{ xmpp_domain }} -EJABBERD_MACRO_TURN_IP={{ public_ip }} -EJABBERD_MACRO_POW_DIFFICULTY=6 -EJABBERD_MACRO_REGISTRATION_TIMEOUT=600 -EJABBERD_MACRO_UPLOAD_URL={{ xmpp_upload_url }} -EJABBERD_MACRO_ACME_URL=https://acme-v02.api.letsencrypt.org/directory diff --git a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-install b/ansible/roles/xmpp_cert_sync/files/xmpp-cert-install deleted file mode 100644 index b5b68d0..0000000 --- a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-install +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# Managed by Ansible (role xmpp_cert_sync). Forced command of the -# xmpp_cert_sync key from asxpio-ops: read a certificate chain + key on -# stdin, check it, install it as certs/.pem for ejabberd (which -# picks the matching file per domain) and reload. -set -eu -umask 022 -name=${SSH_ORIGINAL_COMMAND:-} -case "$name" in - asxp.io|*.asxp.io) ;; - *) echo "refusing certificate name '$name'" >&2; exit 1 ;; -esac -case "$name" in *[!a-z0-9.-]*) echo "bad name" >&2; exit 1 ;; esac -dir=/opt/xmpp/state/certs -tmp=$(mktemp "$dir/.incoming.XXXXXX") -trap 'rm -f "$tmp"' EXIT -head -c 65536 > "$tmp" -# Valid for at least another day, for this name, with its matching key -openssl x509 -in "$tmp" -noout -checkend 86400 >/dev/null -openssl x509 -in "$tmp" -noout -checkhost "$name" | grep -q "does match" -cert_pub=$(openssl x509 -in "$tmp" -noout -pubkey | sha256sum) -key_pub=$(openssl pkey -in "$tmp" -pubout | sha256sum) -[ "$cert_pub" = "$key_pub" ] || { echo "key does not match certificate" >&2; exit 1; } -chmod 0644 "$tmp" -mv "$tmp" "$dir/$name.pem" -trap - EXIT -# The hand-made certificate from before the push; kept outside the glob -if [ -f "$dir/server.pem" ] && [ -f "$dir/asxp.io.pem" ] && [ -f "$dir/xmpp.asxp.io.pem" ]; then - mkdir -p /opt/xmpp/state/certs-retired - mv "$dir/server.pem" "/opt/xmpp/state/certs-retired/server.pem.$(date +%Y%m%d)" -fi -docker compose -f /opt/xmpp/docker-compose.yml exec -T ejabberd ejabberdctl reload_config -logger -t xmpp-cert-install "installed $name.pem, $(openssl x509 -in "$dir/$name.pem" -noout -enddate)" diff --git a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.path b/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.path deleted file mode 100644 index 1034283..0000000 --- a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Watch Traefik's acme.json for a renewed XMPP certificate - -[Path] -PathChanged=/opt/traefik/letsencrypt/acme.json - -[Install] -WantedBy=paths.target diff --git a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.service b/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.service deleted file mode 100644 index 54a1746..0000000 --- a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Push the XMPP certificate from Traefik to ejabberd -After=docker.service - -[Service] -Type=oneshot -ExecStart=/usr/local/bin/xmpp-cert-sync diff --git a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.timer b/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.timer deleted file mode 100644 index 9b5ab78..0000000 --- a/ansible/roles/xmpp_cert_sync/files/xmpp-cert-sync.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Daily XMPP certificate check (fallback for the path unit) - -[Timer] -OnCalendar=*-*-* 05:40:00 -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/roles/xmpp_cert_sync/handlers/main.yaml b/ansible/roles/xmpp_cert_sync/handlers/main.yaml deleted file mode 100644 index c28484f..0000000 --- a/ansible/roles/xmpp_cert_sync/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Reload systemd - ansible.builtin.systemd: - daemon_reload: true diff --git a/ansible/roles/xmpp_cert_sync/tasks/main.yaml b/ansible/roles/xmpp_cert_sync/tasks/main.yaml deleted file mode 100644 index 478a96c..0000000 --- a/ansible/roles/xmpp_cert_sync/tasks/main.yaml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# Runs on asxpio-ops (where Traefik keeps the certificate); sets up the -# receiving end on asxpio-services through delegate_to. -- name: Generate the sync SSH key - community.crypto.openssh_keypair: - path: /root/.ssh/xmpp_cert_sync - type: ed25519 - comment: xmpp-cert-sync@{{ inventory_hostname }} - register: xmpp_cert_sync_key - -# The receiving end is set up here only while services is managed by -# Ansible; on NixOS it is part of nixos/hosts/asxpio-services, which -# authorizes this host's existing key until ops converts too. -- name: Install the receiving script on asxpio-services - ansible.builtin.copy: - src: xmpp-cert-install - dest: /usr/local/bin/xmpp-cert-install - mode: "0755" - delegate_to: asxpio-services - when: "'asxpio-services' in groups['services_servers'] | default([])" - -- name: Authorize the key for that script only, from ops only - ansible.posix.authorized_key: - user: root - key: "{{ xmpp_cert_sync_key.public_key }}" - key_options: 'restrict,from="{{ asxpio_ops_vpc_ip }}",command="/usr/local/bin/xmpp-cert-install"' - comment: xmpp-cert-sync - delegate_to: asxpio-services - # In a dry run on a fresh host the key does not exist yet - when: - - xmpp_cert_sync_key.public_key is defined - - "'asxpio-services' in groups['services_servers'] | default([])" - -- name: Install the sync script - ansible.builtin.template: - src: xmpp-cert-sync.j2 - dest: /usr/local/bin/xmpp-cert-sync - mode: "0755" - -- name: Install the sync units - ansible.builtin.copy: - src: "{{ item }}" - dest: "/etc/systemd/system/{{ item }}" - mode: "0644" - loop: - - xmpp-cert-sync.service - - xmpp-cert-sync.path - - xmpp-cert-sync.timer - notify: Reload systemd - -- name: Flush handlers - ansible.builtin.meta: flush_handlers - -- name: Enable the path watch and the daily fallback - ansible.builtin.systemd: - name: "{{ item }}" - enabled: true - state: started - loop: - - xmpp-cert-sync.path - - xmpp-cert-sync.timer - # A dry run installs no new unit files - ignore_errors: "{{ ansible_check_mode }}" diff --git a/ansible/roles/xmpp_cert_sync/templates/xmpp-cert-sync.j2 b/ansible/roles/xmpp_cert_sync/templates/xmpp-cert-sync.j2 deleted file mode 100644 index 5925269..0000000 --- a/ansible/roles/xmpp_cert_sync/templates/xmpp-cert-sync.j2 +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 -# Managed by Ansible (role xmpp_cert_sync). -# Push the XMPP certificates from Traefik's acme.json to ejabberd on -# asxpio-services whenever they change (xmpp-cert-sync.path), and daily as -# a fallback. The SSH key may only run xmpp-cert-install there. -import base64, hashlib, json, os, subprocess, sys, tempfile, time - -ACME = "/opt/traefik/letsencrypt/acme.json" -CERTS = {{ xmpp_cert_push | to_json }} -TARGET = "root@{{ asxpio_services_vpc_ip }}" -KEY = "/root/.ssh/xmpp_cert_sync" -KNOWN = "/root/.ssh/xmpp_cert_sync_known_hosts" -STATE = "/var/lib/xmpp-cert-sync" -PROM = "{{ monitoring_textfile_dir }}/xmpp_cert.prom" -{% raw %} - - -def not_after(pem): - with tempfile.NamedTemporaryFile() as t: - t.write(pem); t.flush() - end = subprocess.run(["openssl", "x509", "-in", t.name, "-noout", "-enddate"], - capture_output=True, text=True, check=True).stdout - end = end.split("=", 1)[1].strip() - return end, subprocess.run(["date", "-d", end, "+%s"], capture_output=True, - text=True, check=True).stdout.strip() - - -acme = json.load(open(ACME))["letsencrypt"]["Certificates"] or [] -os.makedirs(STATE, exist_ok=True) -expiry, missing = {}, [] -for name in CERTS: - entry = next((c for c in acme if c["domain"]["main"] == name), None) - if not entry: - print(f"no certificate for {name} in {ACME} yet") - missing.append(name) - continue - pem = base64.b64decode(entry["certificate"]) + base64.b64decode(entry["key"]) - end, expiry[name] = not_after(pem) - digest = hashlib.sha256(pem).hexdigest() - state = os.path.join(STATE, name + ".sha256") - try: - pushed = open(state).read().strip() - except OSError: - pushed = "" - if pushed == digest and "--force" not in sys.argv: - print(f"{name}: ejabberd already has it (valid until {end})") - continue - subprocess.run(["ssh", "-i", KEY, "-o", "BatchMode=yes", "-o", "IdentitiesOnly=yes", - "-o", f"UserKnownHostsFile={KNOWN}", "-o", "StrictHostKeyChecking=accept-new", - TARGET, name], input=pem, check=True, timeout=120) - with open(state, "w") as f: - f.write(digest + "\n") - print(f"{name}: pushed (valid until {end})") - -lines = ["# HELP xmpp_cert_source_not_after_timestamp_seconds Expiry of each XMPP certificate in Traefik's acme.json.", - "# TYPE xmpp_cert_source_not_after_timestamp_seconds gauge"] -lines += [f'xmpp_cert_source_not_after_timestamp_seconds{{cert="{n}"}} {t}' for n, t in expiry.items()] -if not missing: - lines += ["# HELP xmpp_cert_sync_last_success_timestamp_seconds Last run that left ejabberd with all of Traefik's current certificates.", - "# TYPE xmpp_cert_sync_last_success_timestamp_seconds gauge", - f"xmpp_cert_sync_last_success_timestamp_seconds {int(time.time())}"] -else: - try: # keep the last success, so the stale alert still counts from it - lines += [l.rstrip("\n") for l in open(PROM) if l.startswith(("# HELP xmpp_cert_sync", "# TYPE xmpp_cert_sync", "xmpp_cert_sync"))] - except OSError: - pass -with open(PROM + ".tmp", "w") as f: - f.write("\n".join(lines) + "\n") -os.replace(PROM + ".tmp", PROM) -{% endraw %} diff --git a/ansible/roles/xray/tasks/main.yaml b/ansible/roles/xray/tasks/main.yaml deleted file mode 100644 index 5d3a80b..0000000 --- a/ansible/roles/xray/tasks/main.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Deploy Xray - ansible.builtin.include_role: - name: docker_service - vars: - service_name: xray - service_base_path: "{{ services_base_path }}/xray" - service_templates: - - { src: docker-compose.yml.j2, dest: docker-compose.yml } - - { src: config.json.j2, dest: config.json, mode: "0600" } - health_check_port: 443 diff --git a/ansible/roles/xray/templates/config.json.j2 b/ansible/roles/xray/templates/config.json.j2 deleted file mode 100644 index 815d3a0..0000000 --- a/ansible/roles/xray/templates/config.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ xray_config | to_nice_json }} diff --git a/ansible/roles/xray/templates/docker-compose.yml.j2 b/ansible/roles/xray/templates/docker-compose.yml.j2 deleted file mode 100644 index 015fa6c..0000000 --- a/ansible/roles/xray/templates/docker-compose.yml.j2 +++ /dev/null @@ -1,16 +0,0 @@ -# Managed by Ansible (role xray). Root in the container only to read the -# 0600 config and bind :443; every other capability is dropped. -services: - xray: - image: ghcr.io/xtls/xray-core:{{ xray_version }} - container_name: xray - command: ["run", "-c", "/etc/xray/config.json"] - network_mode: host - user: "0" - cap_drop: [ALL] - cap_add: [NET_BIND_SERVICE] - security_opt: ["no-new-privileges:true"] - read_only: true - volumes: - - ./config.json:/etc/xray/config.json:ro - restart: unless-stopped diff --git a/ansible/site.yaml b/ansible/site.yaml deleted file mode 100644 index 705159e..0000000 --- a/ansible/site.yaml +++ /dev/null @@ -1,74 +0,0 @@ ---- -# Everything the deploy pipeline manages. Idempotent: a run with nothing -# to change touches nothing and restarts nothing. -# -# ansible-playbook site.yaml --check --diff # dry run -# ansible-playbook site.yaml --tags traefik # one service -# -# Host bootstrap (WireGuard, SSH hardening, s3fs, swap) is in playbooks/ -# and is run by hand. - -- name: Host baseline - hosts: asxpio - become: true - roles: - - { role: base, tags: [base] } - -- name: Monitoring agents - hosts: asxpio - become: true - roles: - - { role: monitoring_agent, tags: [monitoring_agent, monitoring] } - -- name: asxpio-ops services - hosts: ops_servers - become: true - roles: - - { role: traefik, tags: [traefik] } - - { role: xmpp_cert_sync, tags: [xmpp_cert_sync, xmpp] } - - { role: crawler_alert, tags: [crawler_alert] } - - { role: monitoring, tags: [monitoring] } - -- name: asxpio-services services - hosts: services_servers - become: true - roles: - - { role: sillytavern, tags: [sillytavern] } - - { role: minecraft, tags: [minecraft] } - - { role: xmpp, tags: [xmpp] } - - { role: acme_forward, tags: [acme_forward, xmpp] } - - { role: xray, tags: [xray] } - -# Late: restarting Forgejo briefly cuts the runner off from its job log -- name: Forgejo - hosts: ops_servers - become: true - roles: - - { role: forgejo, tags: [forgejo] } - -- name: Backups - hosts: asxpio - become: true - roles: - - { role: restic_backup, tags: [restic] } - -- name: another-im/interop runner - hosts: services_servers - become: true - roles: - - { role: forgejo_runner_interop, tags: [forgejo_runner_interop] } - -- name: Bucket replica - hosts: services_servers - become: true - roles: - - { role: s3_replicate, tags: [s3_replicate] } - -# Last: when the pipeline changes the runner it recreates the container -# that is running the pipeline. Everything else is done by then; that job -# ends as failed and the next run confirms the result. -- name: Forgejo runner - hosts: services_servers - become: true - roles: - - { role: forgejo_runner, tags: [forgejo_runner] } diff --git a/nixos/README.md b/nixos/README.md index e8a7eb3..697adbd 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -2,8 +2,8 @@ Each server's whole system, as one flake. A server is created by OpenTofu (`../tofu`, OpenTofu), converts itself to NixOS on first boot, and gets its -configuration from here. Production is moving over from `../ansible`; -the plan and its state are in `../MIGRATION.md`. +configuration from here. How the servers moved here from Debian and +Ansible is on branch `migration`. ``` flake.nix inputs (nixpkgs 26.05, unstable for a few packages, sops-nix), hosts, dev shell @@ -17,7 +17,6 @@ modules/monitoring-agent.nix node, container and security metrics, logs to Loki hosts/asxpio-ops/ Traefik, Forgejo, Postgres, Garage, monitoring, app stacks hosts/asxpio-services/ runners, Minecraft, XMPP, Xray, SillyTavern, one file each hosts/rehearsal/ overrides that turn the two hosts into a test pair -migration/ one-off scripts: Debian-era data into place, rehearsal clean-up secrets/*.yaml sops-encrypted, one file per host ``` @@ -191,12 +190,22 @@ the other way round for WireGuard); `nixos-rebuild switch --flake .#rehearsal- --target-host root@ --build-host root@`; reboot once. -With test data: `touch /var/lib/.data-in-place`. With a restored copy of -production: restore last night's snapshot to `/restore`, run -`migration/ops-data.sh /restore` or `services-data.sh /restore`, and on -ops `migration/rehearsal-sanitize-forgejo.sh` before the runner starts. -Read the rehearsal rules in `../MIGRATION.md` first: restored data -carries production credentials. +With test data: `touch /var/lib/.data-in-place`. With a restored copy +of production: restore that night's snapshot to `/` (RESTORE.md, "A whole +host"), and mind what the copy carries: + +- Production credentials. Anything that would use them outward stays + off in `hosts/rehearsal/`: XMPP and the Telegram gateway, mail + (Forgejo, Grafana, crawler), the bucket replica, certificate pushes, + the interop runner, Minecraft's outward plugins (DiscordSRV, + ServerBackup, AutoUpdateGeyser). +- On ops, run `hosts/rehearsal/sanitize-forgejo.sh` before any runner + meets the data: it removes production's queued jobs, schedules, + Actions secrets, runners and webhooks. +- Start app containers by hand only, with mail pointed at nothing and + `INDEXNOW_KEY` empty; never vhpbot or asxpio-monitor. +- Limit SSH to your address with a Hetzner firewall, keep backup + credentials in `/run` only, and delete the servers when done. ## How the first boot works, and its limits diff --git a/nixos/migration/rehearsal-sanitize-forgejo.sh b/nixos/hosts/rehearsal/sanitize-forgejo.sh similarity index 100% rename from nixos/migration/rehearsal-sanitize-forgejo.sh rename to nixos/hosts/rehearsal/sanitize-forgejo.sh diff --git a/nixos/migration/ops-data.sh b/nixos/migration/ops-data.sh deleted file mode 100755 index 6824e96..0000000 --- a/nixos/migration/ops-data.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env bash -# asxpio-ops: move the data of the Debian/Docker layout to where the -# NixOS services keep it, then let them start. -# -# ops-data.sh -# -# is /old-root after an in-place conversion (the dumps then -# come from the last thing done before it: `restic-backup run`, which -# leaves nothing behind, so take them by hand into -# /var/backups/restic-stage), or the target of a restic restore. -# Moves within one filesystem, so it is quick; run it once, as root, on a -# host whose services are still waiting for /var/lib/.data-in-place. -set -euo pipefail - -src=${1:?usage: ops-data.sh } -stage=$src/var/backups/restic-stage -[ ! -e /var/lib/.data-in-place ] || { echo "services already have data (/var/lib/.data-in-place exists)" >&2; exit 1; } -for f in "$stage/pg_dumpall.sql" "$stage/forgejo-gitea.db"; do - [ -e "$f" ] || { echo "missing: $f" >&2; exit 1; } -done -# Each part moves what is still under and skips what already -# moved, so an interrupted run can simply be started again. - -echo "== Forgejo" -fj=/var/lib/forgejo -install -d -o git -g git -m 750 $fj $fj/data $fj/custom -if [ -d "$src/opt/forgejo/data/git/repositories" ]; then - rm -rf $fj/repositories - mv "$src/opt/forgejo/data/git/repositories" $fj/repositories -fi -[ ! -d "$src/opt/forgejo/data/git/lfs" ] || { rm -rf $fj/data/lfs; mv "$src/opt/forgejo/data/git/lfs" $fj/data/lfs; } -[ -d $fj/repositories ] || { echo "missing: Forgejo repositories" >&2; exit 1; } -for d in "$src"/opt/forgejo/data/gitea/data/*; do - [ -e "$d" ] || continue - case "$(basename "$d")" in - home | ssh | tmp | sessions | queues | indexers) ;; # rebuilt, or the container's own - *) rm -rf "$fj/data/$(basename "$d")"; mv "$d" $fj/data/ ;; - esac -done -[ ! -d "$src/opt/forgejo/data/gitea/public" ] || { rm -rf $fj/custom/public; mv "$src/opt/forgejo/data/gitea/public" $fj/custom/public; } -# The online copy taken by the backup hook, not the live file -cp "$stage/forgejo-gitea.db" $fj/data/forgejo.db -chown -R git:git $fj - -echo "== Garage" -install -d -m 700 /var/lib/garage -for part in meta data; do - v="$src/var/lib/docker/volumes/storage_garage_$part/_data" - [ ! -d "$v" ] || { rm -rf /var/lib/garage/$part; mv "$v" /var/lib/garage/$part; } - [ -d /var/lib/garage/$part ] || { echo "missing: Garage $part" >&2; exit 1; } -done - -echo "== Traefik" -install -d -o traefik -g traefik -m 700 /var/lib/traefik -if [ -f "$src/opt/traefik/letsencrypt/acme.json" ]; then - install -o traefik -g traefik -m 600 "$src/opt/traefik/letsencrypt/acme.json" /var/lib/traefik/acme.json -fi - -echo "== Monitoring history (Docker volumes; not in the restic backup)" -mvvol() { # mvvol - if [ -d "$vols/$1/_data" ]; then - rm -rf "$2"; mkdir -p "$(dirname "$2")" - mv "$vols/$1/_data" "$2"; chown -R "$3" "$2" - else - echo " $1: not there (a restore, not a conversion); starting empty" - fi -} -vols=$src/var/lib/docker/volumes -mvvol monitoring_prometheus-data /var/lib/prometheus2/data prometheus:prometheus -mvvol monitoring_loki-data /var/lib/loki loki:loki -if [ -f "$vols/monitoring_grafana-data/_data/grafana.db" ]; then - install -d -o grafana -g grafana /var/lib/grafana/data - mv "$vols/monitoring_grafana-data/_data/grafana.db" /var/lib/grafana/data/grafana.db - chown grafana:grafana /var/lib/grafana/data/grafana.db -fi - -echo "== App stacks (compose file and .env each; CI deploys them later)" -install -d -m 755 /opt -for app in asxpio datacenterbingo blog czsk vhpbot-prod vhpbot-dev; do - [ -d "$src/opt/$app" ] || continue - rm -rf "/opt/$app"; mv "$src/opt/$app" "/opt/$app" - chown -R deploy:deploy "/opt/$app" -done -[ ! -d "$src/root/backups" ] || { rm -rf /root/backups; mv "$src/root/backups" /root/backups; } - -echo "== Starting" -touch /var/lib/.data-in-place -systemctl start postgresql.service - -echo "== Postgres" -# The dump recreates the roles with their old passwords; postgres-roles -# then sets the ones from sops -runuser -u postgres -- psql -q postgres < "$stage/pg_dumpall.sql" > /var/log/pg-restore.log 2>&1 || true -echo "errors in /var/log/pg-restore.log: $(grep -c ERROR /var/log/pg-restore.log || true)" -systemctl restart postgres-roles.service - -systemctl start garage.service garage-bootstrap.service forgejo.service traefik.service - -echo "== Forgejo: SSH keys file for the new paths" -# The repositories' own hook files still name the container's binary; -# Forgejo 17 gives git its own hooks on every push, so they are unused. -forgejo-admin regenerate keys - -echo "== App stacks: images again (Docker's image store does not carry over)" -case "$(hostname)" in - rehearsal-*) - # Restored .env files hold production credentials: vhpbot would log - # in as the production bot, asxpio-monitor probe the internet, the - # apps send mail. Start them by hand, sanitized (MIGRATION.md rules). - echo " rehearsal host: apps NOT started" - exit 0 ;; -esac -for app in asxpio datacenterbingo blog czsk vhpbot-prod vhpbot-dev; do - [ -f "/opt/$app/docker-compose.yml" ] || continue - echo " $app" - if grep -q "^ *build:" "/opt/$app/docker-compose.yml" && ! grep -q "image: *git" "/opt/$app/docker-compose.yml"; then - runuser -l deploy -c "cd /opt/$app && docker compose up -d --build" || echo " $app FAILED" - else - runuser -l deploy -c "cd /opt/$app && docker compose pull -q && docker compose up -d" || echo " $app FAILED" - fi -done - -echo "== Done. Check: systemctl --failed; garage status; a git clone over SSH and HTTPS;" -echo " docker ps (as deploy): every app healthy; Grafana on gf.asxp.io" diff --git a/nixos/migration/services-data.sh b/nixos/migration/services-data.sh deleted file mode 100755 index 10fa6c7..0000000 --- a/nixos/migration/services-data.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# asxpio-services: move the data of the Debian/Docker layout to where the -# NixOS services keep it, then let them start. -# -# services-data.sh -# -# is /old-root after an in-place conversion, or the target of -# a restic restore. Moves within one filesystem, so it is quick; run it -# once, as root, on a host whose services are still waiting for -# /var/lib/.data-in-place. -set -euo pipefail - -src=${1:?usage: services-data.sh } -vols=$src/var/lib/docker/volumes -[ ! -e /var/lib/.data-in-place ] || { echo "services already have data (/var/lib/.data-in-place exists)" >&2; exit 1; } -for f in "$src/opt/minecraft/world" "$src/opt/sillytavern/data" "$src/opt/xmpp/state" "$vols/xmpp_database/_data"; do - [ -e "$f" ] || { echo "missing: $f" >&2; exit 1; } -done - -echo "== Minecraft" -rm -rf /var/lib/minecraft -mv "$src/opt/minecraft" /var/lib/minecraft -rm -f /var/lib/minecraft/docker-compose.yml -chown -R minecraft:minecraft /var/lib/minecraft - -echo "== SillyTavern" -install -d -o sillytavern -g sillytavern -m 750 /var/lib/SillyTavern -rm -rf /var/lib/SillyTavern/data -mv "$src/opt/sillytavern/data" /var/lib/SillyTavern/data -chown -R sillytavern:sillytavern /var/lib/SillyTavern - -echo "== XMPP" -install -d -m 755 /opt/xmpp -rm -rf /opt/xmpp/state -mv "$src/opt/xmpp/state" /opt/xmpp/state -for v in xmpp_database xmpp_tackygram; do - podman volume exists $v || podman volume create $v >/dev/null - dst=$(podman volume inspect $v --format '{{.Mountpoint}}') - rm -rf "$dst" - mv "$vols/$v/_data" "$dst" -done -# The online copy taken by the backup hook, if this is a restore -stage=$src/var/backups/restic-stage/ejabberd.sqlite -db=$(podman volume inspect xmpp_database --format '{{.Mountpoint}}')/ejabberd.sqlite -if [ -f "$stage" ]; then - cp "$stage" "$db.new" - chown --reference="$db" "$db.new" - chmod --reference="$db" "$db.new" - mv "$db.new" "$db" -fi - -echo "== Starting" -touch /var/lib/.data-in-place -systemctl start minecraft-server.service sillytavern.service -for u in podman-xmpp-ejabberd podman-xmpp-apushd podman-xmpp-tackygram; do - # Not enabled on a rehearsal host: it would be a second asxp.io - if systemctl is-enabled -q $u.service 2>/dev/null; then systemctl start $u.service; else echo "left stopped: $u"; fi -done - -echo "== Done. Check: systemctl --failed; the Minecraft log reaches Done; SillyTavern on :8000; an XMPP login" diff --git a/renovate.json b/renovate.json index 0ab4a13..674e7d1 100644 --- a/renovate.json +++ b/renovate.json @@ -5,17 +5,7 @@ ], "customManagers": [ { - "description": "Versions in Ansible vars, marked with a comment: # renovate: datasource= depName=", - "customType": "regex", - "managerFilePatterns": [ - "/^ansible/.+\\.ya?ml$/" - ], - "matchStrings": [ - "# renovate: datasource=(?\\S+) depName=(?\\S+)\\s+[a-z_0-9]+:\\s*\"?(?[^\"\\s]+)\"?" - ] - }, - { - "description": "Versions in the NixOS config, marked the same way: # renovate: ... above `name = \":\";` or `name = \"\";`", + "description": "Versions in the NixOS config, marked with a comment: # renovate: datasource= depName= above `name = \":\";` or `name = \"\";`", "customType": "regex", "managerFilePatterns": [ "/^nixos/.+\\.nix$/" @@ -28,7 +18,6 @@ "description": "Runner job images, pinned in the labels: docker://:", "customType": "regex", "managerFilePatterns": [ - "/^ansible/roles/forgejo_runner/(templates/config\\.yaml\\.j2|tasks/main\\.yaml)$/", "/^nixos/hosts/asxpio-services/runner\\.nix$/" ], "matchStrings": [ @@ -48,7 +37,6 @@ { "description": "Runner labels name their line (node-20, debian-12, python-3.11): never leave it", "matchFileNames": [ - "ansible/roles/forgejo_runner/**", "nixos/hosts/asxpio-services/runner.nix" ], "matchUpdateTypes": [ @@ -59,7 +47,6 @@ { "description": "python-3.11 / python-3.12 labels stay on their minor line", "matchFileNames": [ - "ansible/roles/forgejo_runner/**", "nixos/hosts/asxpio-services/runner.nix" ], "matchPackageNames": [ @@ -70,7 +57,6 @@ }, { "matchFileNames": [ - "ansible/roles/forgejo_runner/**", "nixos/hosts/asxpio-services/runner.nix" ], "matchPackageNames": [ @@ -89,7 +75,6 @@ { "description": "Both label files carry the same pins: one PR per image", "matchFileNames": [ - "ansible/roles/forgejo_runner/**", "nixos/hosts/asxpio-services/runner.nix" ], "groupName": "runner job images", @@ -104,7 +89,7 @@ "nixos/nix" ], "prBodyNotes": [ - "After merging, remove the old `nix-store-` volume on asxpio-services (see forgejo_runner.yaml)." + "After merging, remove the old `nix-store-` volume on asxpio-services (see nixos/hosts/asxpio-services/runner.nix)." ] }, {