Files
myfileagent-pipeline/monitoring
Codex (authorized Assignment 5 implementation) 6605394d7a
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/pr-main This commit looks good
Add Assignment 7 monitoring, tested alerts, and incident evidence
2026-10-28 17:51:31 +00:00
..

Assignment 7 monitoring

Deployed on the existing Droplet and validated October 24-28, 2026. Source is submitted for peer review; see incidents/2026-10-24-jenkins-outage.md. Report integration and compilation are deferred by the team.

Architecture and access

Caddy serves authenticated Grafana at https://metrics.myfileagent.tech over the existing private proxy bridge. Grafana uses private http://prometheus:9090. Prometheus scrapes itself, Node Exporter, Blackbox Exporter and the actual Gitea/Jenkins HTTPS login probes every 30 seconds. TLS verification stays enabled. No monitoring host ports, privileged containers or Docker socket mounts are used. Only Grafana joins the existing proxy bridge. Node Exporter reads host root/proc/sys through a read-only root mount and uses the host PID namespace for whole-host CPU, memory and filesystem measurements. This is sensitive host visibility; it does not measure per-container attribution or whole-host network interfaces.

Versions and resource settings

Compose fixes Prometheus v3.15.1, Grafana 13.2.4, Node Exporter v1.12.1 and Blackbox Exporter v0.29.1. Pulled image digests are in evidence/monitoring-image-digests-2026-10-24.json. Existing Gitea/Jenkins versions are preserved. Prometheus has a 160 MiB memory/swap cap and 120 MiB Go memory target; exporters each have 32 MiB caps. Grafana memory/swap limits were removed at the team's request after bounded startup failed. CPU quotas remain. This is measured lab operation on a shared host, not guaranteed sizing. Avoid overlapping Jenkins/manual builds; monitor actual availability and resource pressure. Prometheus retention is seven days and 512 MB of TSDB blocks. WAL/head/compaction require additional space; this is not a hard total-volume limit.

Deployment and secrets

Run from this monitoring directory on the Droplet. Review docker compose config --quiet before changes. The external proxy network must exist as myfileagent-gitea_gitea-private. The compose override reflects the existing Droplet paths and supplemental group 1000; adapt only after verifying host identities. Secrets stay outside Git under /home/codex/myfileagent-gitea/secrets with restricted permissions. The admin-password file is only the initial setup value; do not use it to reset a changed password. Private Discord routing provisioning is mounted separately over the committed empty placeholder. Recreate the approved contact point/policy privately for a new deployment; never commit the webhook URL. Obsolete SMTP setup files are excluded from this change. Gmail SMTP was not the working delivery route. Preserve the live Caddyfile; the example fragment is not a replacement for all existing routes. Validate/reload Caddy only for an approved proxy change.

Dashboards, alerts and validation

The six-panel team dashboard and two-panel runbook dashboard are file-provisioned. Dashboard JSON copies under grafana/dashboards and grafana/provisioning/dashboards/json must remain identical. UI annotations live in Grafana state and are not reconstructed by dashboard JSON. Service alert: separate expected URL instances, one-minute pending, every 30 seconds. Capacity: root /dev/vda1 ext4, available space below 15% for five minutes. Missing expected probe series, no-data and evaluation errors surface as alerting. Discord delivery uses group wait 10 seconds, group interval one minute and repeat four hours, with resolved delivery enabled. No notification secret is present in this tree. The threshold-only capacity test and Jenkins-only outage both delivered firing and resolved messages. Final capacity threshold is 15%. See runbooks, slo and incidents. Evidence JSON and selected team screenshots are under evidence/. Python CI regression checks run through the established Jenkins multibranch job; Compose/promtool/Blackbox validation is recorded separately. These existing Python checks alone do not validate all monitoring semantics.

Persistence, backup and recovery

Prometheus and Grafana use separate named volumes. October 28 separate restarts preserved historical readings, resource-backed dashboards, data source, two alert rules and 18 annotations. A missed Jenkins probe sample was recorded; monitoring gaps are unknown, not service success. See evidence/monitoring-restart-persistence.json. This is restart persistence, not tested backup/restore. Before future upgrades, use a consistent stopped Grafana SQLite/volume backup and an approved consistent Prometheus snapshot/backup procedure, preserving ownership and private routing secrets separately. Restore into isolation and verify before replacing live volumes; this monitoring backup/restore exercise has not been performed. Monitoring rollback: docker compose stop from this directory only. Resume: docker compose start. Do not use down -v, global prune, or stop the existing Gitea/Jenkins project as monitoring rollback. For Jenkins-only recovery use the exact command in runbooks/service-unavailable.md.

Review status

Feature branch assignment7/monitoring. P1 external-check issue 12 and P2 timestamp/recovery issue 13 are assigned to glovely. Peer approval, merge and final report publication remain separate steps. Same-Droplet monitoring cannot reliably report a total host failure; no external checker has been deployed.