Files
vpn-dns-gateway/monitoring/EVIDENCE.md
T
billandClaude Opus 5.5 d3a5e6bc73
vpn-dns-gateway/pipeline/head This commit looks good
Add Prometheus/Grafana monitoring stack (refs #19)
Assignment 7 (instructor manual v1.42, Chapter 5): Prometheus, Grafana OSS,
Node Exporter and Blackbox Exporter beside Gitea/Jenkins on The-Ocean, pinned
by tag and digest, memory-capped for the 1 GiB droplet, no host ports.

- monitoring/: compose, scrape and probe config, Grafana provisioning
  (data source, Group 1 SRE dashboard, two alert rules, Discord contact
  point via env var), README with deploy/backup/rollback and runbooks,
  EVIDENCE.md with the deploy, capacity and exposure test records.
- deploy/: private probe network (172.30.90.0/28) with Caddy aliases;
  ci allowlist admits only the Blackbox address 172.30.90.10; new
  metrics.yebilly.me route behind the same allowlist.
- manual images: DNS record, Discord webhook, contact-point test, dashboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:11:02 -04:00

77 lines
7.2 KiB
Markdown

# Assignment 7 raw evidence (droplet The-Ocean, captured by Claude over SSH, approved by Billy)
## Baseline 2026-10-28 04:34 UTC
Ubuntu 24.04.5 LTS, kernel 6.8.0-147-generic x86_64, 1 vCPU; Docker 29.8.1, Compose v5.5.1; disk /dev/vda1 24883167232 B, 18784387072 B available (25% used); gitea_web 172.18.0.0/16; global IPv6 2604:a880:400:d1:0:5:22d:6001/64, no AAAA records; uptime 6 days, load 0.05.
Containers: gitea-jenkins-1 325.4MiB/512MiB, gitea-caddy-1 10.85MiB, gitea-gitea-1 98.21MiB. Host RSS: java 318.1, gitea 122.0, dockerd 50.0, multipathd 26.5, containerd 23.5, caddy 16.7 MiB.
```
Wed Oct 28 04:34:27 UTC 2026
total used free shared buff/cache available
Mem: 1008177152 778825728 101543936 3424256 281452544 229351424
Swap: 1073737728 479457280 594280448
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/vda1 24883167232 6082015232 18784374784 25% /
NAME TYPE SIZE USED PRIO
/swapfile file 1024M 457.2M -2
gitea-jenkins-1 0.17% 326.3MiB / 512MiB
gitea-caddy-1 0.00% 11MiB / 961.5MiB
gitea-gitea-1 0.20% 102.9MiB / 961.5MiB
```
## Unused host services disabled
```
2026-10-28 04:52:51 UTC disabled+masked: multipathd(.service,.socket), fwupd(+fwupd-refresh.timer), udisks2, ModemManager
before: Mem total 1008177152 used 798810112 available 209367040
after (04:52:59): used 786944000 available 221233152 ; 04:53:0x: available 238510080, Mlocked 0
apt-daily.service ran 04:52:52-04:53:24 (40.8M peak, triggered by systemd reload); after: available 364957696, swap used 503414784
checks before change: multipath -ll empty; dmsetup ls "No devices found"; root=UUID cc6f3ac6 (/dev/vda1, LABEL cloudimg-rootfs); multipath-tools-boot not installed; initramfs multipath files 0
post: gitea-jenkins-1, gitea-caddy-1, gitea-gitea-1 Up; git login 200 1.09s, ci login 200 0.38s
undo: systemctl unmask multipathd fwupd udisks2 ModemManager && systemctl enable --now multipathd udisks2 ModemManager
```
## Image pins chosen 2026-10-28 (registry index digests)
- prom/prometheus:v3.15.1 sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2 (released 2026-10-21)
- grafana/grafana:13.2.5 sha256:9f7aa1e1e3246aade5792d35a738049f7f32f89cd51d1956cf426a4e86268a84 (2026-10-27; 13.3.0 skipped as one day old)
- quay.io/prometheus/node-exporter:v1.12.1 sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0 (2026-07-14)
- quay.io/prometheus/blackbox-exporter:v0.29.1 sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13 (2026-10-21)
## Local validation 2026-10-28 (laptop Docker 29.8.2)
- docker compose config --quiet: monitoring and deploy valid; promtool check config SUCCESS; caddy validate: Valid configuration.
- Grafana smoke run: first run rejected "{{ $$labels.instance }}" (bad character $); fixed to {{ .Labels.instance }}; rerun: both rules health ok, probes Normal from laptop, disk rule Pending (NoData) without node-exporter, dashboard group1-sre in folder SRE.
## Deploy 2026-10-28 (UTC)
- Issue #19; branch feature/issue-19-monitoring from main 9b0dc4d (Jenkins pipeline/head + Automated Manual Build success on 9b0dc4d).
- 14:40:23 second swapfile: /swapfile2 1 GiB added (fstab); swap total 2147475456 B. Disk 24883167232 B, 17710153728 B available after.
- 14:40:40 backup ~/gitea/backup-20261028T144040Z (docker-compose.yml, Caddyfile). Staged files validated on droplet (caddy validate: Valid configuration; compose config valid). Diffs = probe network + aliases; ci allowlist +172.30.90.10/32; metrics block.
- 14:40:57-14:41:09 `docker compose up -d --no-deps caddy` (recreate). gitea_probe 172.30.90.0/28; caddy gitea_probe=172.30.90.2 (aliases git/ci), gitea_web=172.18.0.3. Let's Encrypt: "certificate obtained successfully" metrics.yebilly.me. Laptop: git 200 0.049s, ci 200 0.289s, metrics 502 (Grafana not started).
- docker-proxy now targets 172.30.90.2 (probe network) for 80/443; IPv6/hairpin clients would appear as 172.30.90.1, not allowlisted (only .10/32).
- ~/monitoring copied (700). .env.secret created by Billy: 600 root; names GF_SECURITY_ADMIN_PASSWORD, DISCORD_WEBHOOK_URL; no empty values; no "$".
- 14:50:45-14:51:51 pull. promtool: SUCCESS. RepoDigests (amd64) match pins; sizes: prometheus 381400167, grafana 1949552290, node-exporter 40992821, blackbox 58273564 B. Before up: avail 241209344 B, swap used 520241152 B; disk 39% used.
- 14:52:04-14:52:08 `docker compose up -d`. Samples (avail MiB / swap used MiB): 14:52:23 228/578, 14:52:43 230/666, 14:53:02 159/668, 14:53:22 195/692, 14:53:40 211/700, 14:53:57 218/700, 14:54:14 189/705, 14:54:32 156/707. Peaks: grafana 136.6/192 MiB, prometheus 26.6/128, blackbox 15.3/32, node-exporter 13.6/32. No OOM in dmesg. Within abort limits.
- Grafana "permission denied" on /etc/grafana/provisioning/* (scp-created 700 dirs). Fix 14:55: dirs 755 / files 644 under grafana, prometheus, blackbox; restart 14:55:08; provisioning datasources, alerting, dashboards finished.
- Targets (14:5x): prometheus, node, blackbox, https x2 all up. probe_success 1 both; status 200; duration ci 0.686s, git 0.193s.
- 14:56: rules "HTTPS service down" (ci, git Normal) and "Root disk space low" (Normal), health ok; contact point team-alerts discord url set; dashboard Group 1 SRE /d/group1-sre.
- Host verification 14:56:37: root fs labels device=/dev/vda1 fstype=ext4 mountpoint=/; size 24883167232 = df; avail 15281520640 vs df 15281516544. MemTotal 1008177152 = free total; MemAvailable 293392384 vs free available 301010944 (seconds apart).
- Laptop after start: git 200 0.53s, ci 200 0.064s, metrics /login 200 1.68s, metrics /metrics 302.
## External exposure tests 2026-10-28 14:57 UTC (Billy's laptop, home network on the team allowlist, IPv6 available)
- Raw ports 3000, 3001, 8080, 9090, 9100, 9115, 50000 on 147.182.178.136 and [2604:a880:400:d1:0:5:22d:6001]: all no connection (curl 000, 5 s connect timeout).
- https://metrics.yebilly.me/metrics -> 302 to /login?redirectTo=%2Fmetrics (GF_METRICS_ENABLED=false); /api/dashboards/uid/group1-sre -> 401; /api/datasources/proxy/uid/prometheus/api/v1/query?query=up -> 401 (no anonymous access).
- https://git.yebilly.me/metrics -> 404; https://ci.yebilly.me/prometheus/ -> 403 (no app metrics endpoints).
- http://metrics.yebilly.me -> 308 to https.
- IPv6 (--resolve to droplet IPv6, no AAAA records): ci /login 403, metrics /login 403, git /user/login 200. IPv4 from allowlisted laptop: ci 200, metrics 200. Confirms docker-proxy gateway (172.30.90.1) is not allowlisted.
## Grafana login and contact-point test 2026-10-28
- ~15:01 UTC (11:01 EDT): Billy logged in at https://metrics.yebilly.me as billy; dashboard Group 1 SRE showed all 7 panels with data (screenshot).
- Contact point is provisioned, so the UI offers no Test button. Legacy POST /api/alertmanager/grafana/config/api/v1/receivers/test -> 410 Gone ("use /apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers/{uid}/test").
- One failed admin auth at ~15:04 UTC from the droplet host (password read from file included compose-trimmed whitespace); later calls used the container's environment.
- 15:05:55 UTC: POST .../receivers/dGVhbS1hbGVydHM/test with integration team-alerts-discord, secureFields.url=true -> {"status":"success","duration":"866ms"}.