Files
myfileagent-pipeline/documentation/devopsSREMonitoringReliability.tex
T
Codex (authorized Assignment 5 implementation) ced96c8a2b
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/pr-main This commit looks good
Document Assignment 7 SRE deployment, reliability evidence, and Grafana registry
2026-10-28 18:38:41 +00:00

603 lines
39 KiB
TeX

\chapter{Introduction to SRE: Monitoring and Reliability}
\ChapterLabel{SREMonitoringReliability}
\index{SRE}\index{Prometheus}\index{Grafana}\index{Node Exporter}\index{Blackbox Exporter}
\begin{devopsNote}[Assignment 7 source draft: compilation deferred]
This chapter addresses instructor manual version 1.42, Chapter 5, using the existing
MyFileAgent Gitea/Jenkins Droplet. Evidence is dated October 24--28, 2026. Operational
PR 14 was reviewed and merged; this subsequent documentation source has not yet been
peer approved or compiled. The team skipped the additional external HTTPS command
capture. That missing evidence and the IPv6 limitation are stated rather than marked
passed. Earlier chapters retain their dated historical results.
\end{devopsNote}
\section{Deployment and Reproducibility}
\subsection{Scope, Ownership and Baseline}
\phantomsection\label{AcronymRef:SRE}\label{GlossaryRef:sre}
Site reliability engineering (SRE) combines measurable objectives, monitoring and
operating procedures. Four separate project-published containers were added:
Prometheus, Grafana OSS, Node Exporter and Blackbox Exporter. Gitea, Jenkins, Caddy,
the repository and the Droplet were reused. No Kubernetes, cAdvisor, application
metrics plugin, separate Alertmanager or new workload was introduced.
Gowri Das Lovely coordinated the approved work; Codex assisted with implementation,
measurement and source authoring on the Droplet. Nicholas Kogut independently approved
and merged \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/pulls/14}{PR 14}.
Branch \texttt{assignment7/monitoring} had head
\texttt{6605394d7a3e4183bfc8e94e2b08f1d324a73b8e}; its reviewed merge is
\texttt{b42689f02f30ad895101a2c5f367e54e3603bc5d}.
Issues 12 and 13 are owned follow-ups. A separate initial Assignment 7 planning issue
was not captured; later issues are not described as a pre-deployment issue.
Host \texttt{ssw590-group7-droplet}, IPv4 \texttt{142.93.193.110}, has one vCPU and
nominal 1 GB RAM/25 GB storage. Pre-monitoring main build 3 passed October 24 in
19.365 seconds on starting commit \texttt{131d605c5edb5b5080e4d54861c3c7bf7c360c9c}.
Available memory ranged from 86.3 to 170.2 MiB during that build; host CPU reached
100\% in one sample. These are whole-host observations, not Jenkins-only consumption.
Earlier successful manual builds remain in \ChapterRef{AutomatedManualBuild}; no new
manual compile was run during the outage exercise because the team deferred it.
A dated October 28 cross-check recorded Ubuntu 24.04.4 LTS, \texttt{x86\_64}, Docker
29.8.1 and Compose v5.5.1; total RAM was 1,008,177,152 bytes and swap 1,073,737,728
bytes. Root filesystem size was 24,883,167,232 bytes. These later values are not
relabeled as an October 24 baseline. See
\path{evidence/assignment7/documentation-host-comparison-2026-10-28.json}.
No new paid host/upgrade was purchased; existing hosting and domain remain team-owned.
A current billing amount was not collected. Monitoring success does not resolve the
earlier access-policy exceptions automatically.
\subsection{Architecture, Images and Retention}
% Source-only architecture figure; no compilation performed.
\begin{figure}[htbp]
\centering
\small
\begin{tabular}{c}
\fbox{\parbox{0.88\linewidth}{\centering External browser clients\\HTTPS 443; Caddy-managed certificates}}\\[0.6em]
$\downarrow$\\[0.6em]
\fbox{\parbox{0.88\linewidth}{\centering Shared DigitalOcean Droplet: Caddy reverse proxy\\
\texttt{myfileagent.tech} $\rightarrow$ Gitea\\
\texttt{ci.myfileagent.tech} $\rightarrow$ Jenkins\\
\texttt{metrics.myfileagent.tech} $\rightarrow$ authenticated Grafana}}\\[0.6em]
$\downarrow$ private Docker networking\\[0.6em]
\fbox{\parbox{0.88\linewidth}{\centering Grafana $\rightarrow$ Prometheus:9090\\
Prometheus $\rightarrow$ Node Exporter:9100 and Blackbox Exporter:9115\\
Prometheus also scrapes itself and Blackbox Exporter's own metrics.\\
Blackbox $\rightarrow$ Gitea/Jenkins HTTPS login URLs; TLS validation enabled.}}\\[0.6em]
\fbox{\parbox{0.88\linewidth}{\centering Node Exporter $\rightarrow$ read-only host root/proc/sys; host PID namespace\\
Prometheus $\rightarrow$ persistent \texttt{prometheus\_data} volume\\
Grafana $\rightarrow$ persistent \texttt{grafana\_data} volume\\
Grafana alerting $\rightarrow$ team Discord webhook over HTTPS; secret outside Git}}\\
\end{tabular}
\caption{Deployed monitoring architecture. Only Grafana joins both the monitoring
and existing private proxy networks. Raw monitoring ports are not published.
A total Droplet failure can also stop local monitoring and notifications.}
\label{Figure:SREArchitecture}
\end{figure}
\begin{table}[htbp]\centering\small
\begin{tabularx}{\linewidth}{L{2.5cm}YL{2.2cm}}
\toprule Service & Published image & Release\\\midrule
Prometheus & \texttt{prom/prometheus} & v3.15.1\\
Grafana OSS & \texttt{grafana/grafana} & 13.2.4\\
Node Exporter & \texttt{quay.io/prometheus/node-exporter} & v1.12.1\\
Blackbox Exporter & \texttt{quay.io/prometheus/blackbox-exporter} & v0.29.1\\
\bottomrule\end{tabularx}
\caption{Recorded Linux/amd64 monitoring images. Compose fixes tags rather than claiming all images are digest-pinned.}
\end{table}
Full pulled digests are preserved in
\path{evidence/assignment7/monitoring-image-digests-2026-10-24.json}.
Prometheus has a 160 MiB memory/swap cap and \texttt{GOMEMLIMIT=120MiB}; exporters have
32 MiB caps. Grafana's memory/swap limit was removed at the team's request after
bounded startup failed readiness. CPU quotas remain. This observed shared-host lab
operation is not a sizing guarantee. Run Jenkins/manual builds one at a time; two
configured executors do not prove safe concurrency. Per-job nonconcurrency does not
prevent overlap between different jobs.
\phantomsection\label{AcronymRef:TSDB}
Prometheus time-series database (TSDB) retention is seven days and 512 MB of blocks.
Write-ahead-log, head and compaction require additional room: 512 MB is not a total
volume quota. Save evidence before history expires\cite{PrometheusStorageA7}.
\subsection{Deployment, Persistence and Recovery Instructions}
The reviewed \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring}{monitoring source}
is deployed from \path{/home/codex/myfileagent-gitea/assignment7-monitoring/monitoring}.
Only Grafana joins both \texttt{myfileagent-gitea\_gitea-private} and
\texttt{myfileagent-monitoring\_monitoring}. Node Exporter reads host root/proc/sys
through a read-only root mount and uses the host PID namespace. This grants sensitive
host visibility, but no privileged mode or Docker socket. Only CPU, memory and
filesystem collectors are enabled. No monitoring host ports are published.
The following abridged Compose excerpt shows the persistent/private boundary;
the reviewed source contains all services, limits and the separate secret override.
\begin{lstlisting}
services:
prometheus:
image: prom/prometheus:v3.15.1
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks: [monitoring]
grafana:
image: grafana/grafana:13.2.4
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:ro
networks: [monitoring, proxy]
networks:
monitoring:
proxy:
external: true
name: myfileagent-gitea_gitea-private
volumes:
prometheus_data:
grafana_data:
\end{lstlisting}
No \texttt{ports:} mapping is present for these monitoring services.
Review actual networks, identities and paths before deployment. The override uses
supplemental group 1000 and this Droplet's restricted secret paths. An authorized
operator supplies the initial Grafana password and private Discord routing file
outside Git; the committed routing placeholder contains only \texttt{apiVersion: 1}.
It cannot recreate the receiver secret. Never reset a changed login with the bootstrap
file. See the team-specified \texttt{bitwarden-grafana} hint in \ChapterRef{Passwords}.
From the reviewed monitoring directory, after checking prerequisites:
\begin{lstlisting}
docker compose config --quiet
docker compose pull
docker compose up -d node-exporter blackbox-exporter prometheus
docker compose exec -T prometheus promtool check config /etc/prometheus/prometheus.yml
docker compose up -d grafana
docker compose ps
\end{lstlisting}
Compose and promtool checks passed; Blackbox loaded its module and successfully
probed services. Preserve all existing Caddy routes when adding the Grafana route;
validate Caddy before reload. The example fragment is not a whole Caddyfile replacement.
Rollback only monitoring with \texttt{docker compose stop} from its directory; resume
with \texttt{docker compose start}. Never use \texttt{down -v}, global pruning or
stop the existing Gitea/Jenkins project as monitoring rollback.
Separate named volumes preserve Prometheus history and Grafana state. Before upgrades,
plan a consistent stopped Grafana volume/SQLite backup, preserve ownership and store
private routing secrets separately. Use a documented consistent Prometheus snapshot
or planned stopped backup, not an assumed-consistent live recursive copy. Restore
into isolation and verify before replacing live data. Monitoring backup/restore has
not been exercised; the later restart evidence proves persistence only.
\section{Metrics and HTTPS Probes}
\subsection{Collection and Metric Inventory}
Jobs \texttt{prometheus}, \texttt{node}, \texttt{blackbox} and \texttt{https} scrape
every 30 seconds. The first three collect Prometheus itself, host metrics and Blackbox's
own metrics. The separate multi-target job requests Blackbox \texttt{/probe}, retaining
the target URL as \texttt{instance}\cite{NodeExporterA7,BlackboxExporterA7}.
\begin{table}[htbp]\centering\footnotesize
\begin{tabularx}{\linewidth}{L{3.4cm}L{1.8cm}Y}
\toprule Metric & Type/unit & Labels, meaning and limits\\\midrule
\texttt{node\_cpu\_seconds\_total} & Counter, seconds & CPU/mode/instance; cumulative host CPU time. Use rates, not raw counts, for utilization.\\
\texttt{node\_memory\_MemAvailable\_bytes} & Gauge, bytes & Instance/job; estimated host memory available without swapping, not just unused RAM.\\
\texttt{node\_filesystem\_size\_bytes}, \texttt{node\_filesystem\_avail\_bytes} & Gauge, bytes & Device/fstype/mountpoint/instance; select the same real root filesystem, excluding overlays and pseudo mounts.\\
\texttt{up} & Gauge, 0/1 & Job/instance; collection succeeded. Not application availability.\\
\texttt{probe\_success} & Gauge, 0/1 & Job/URL instance; configured probe succeeded, not authenticated Git/build correctness.\\
\texttt{probe\_duration\_seconds} & Gauge, seconds & Job/URL instance; elapsed probe duration. A failed probe may finish quickly.\\
\bottomrule\end{tabularx}\caption{Required metric inventory and interpretation.}
\end{table}
\subsection{Host Cross-check and Actual Filesystem Labels}
The verified selector is \texttt{mountpoint="/", device="/dev/vda1", fstype="ext4"},
not an assumed \texttt{/host} label or overlay. October 28 \texttt{free -b} and exported
total RAM both gave 1,008,177,152 bytes. Available RAM was 217,042,944 bytes at the host
command versus a recently scraped 232,452,096 bytes. Observations were not simultaneous;
changing workloads prevent exact equality. Root size matched at 24,883,167,232 bytes;
available root bytes were 12,422,406,144 versus 12,422,414,336, an 8,192-byte difference
between nearby observations. CPU idle time from \texttt{/proc/stat} was 31,254,346 ticks
versus a recently scraped 312,523.19 seconds. The recorded host clock unit is 100 ticks per second. Compare using units and
timestamps; these are not raw quantities in identical units. No precise simultaneous
CPU-rate comparison is claimed. Raw values are in the dated host-comparison JSON.
Host metrics combine workloads and cannot be attributed solely to Jenkins.
\subsection{HTTPS Success Definition and Diagnosis}
Targets are \url{https://myfileagent.tech/user/login} and
\url{https://ci.myfileagent.tech/login}. The GET module follows redirects, requires
SSL, prefers IPv4 and validates hostname/certificate. Expected final status is 2xx;
there is no body-content assertion or authenticated user transaction.
\begin{lstlisting}
modules:
http_2xx:
prober: http
timeout: 10s
http:
method: GET
preferred_ip_protocol: ip4
follow_redirects: true
fail_if_not_ssl: true
tls_config:
insecure_skip_verify: false
\end{lstlisting}
All five targets and both service probes were healthy in the October 28 cross-check.
During the Jenkins outage, collection continued while its probe became zero:
\texttt{up=1} can coexist with \texttt{probe\_success=0}. Diagnose collection, exporter
logs, DNS, TLS and proxy/backend health before restarting anything. A same-Droplet
login-page probe does not establish external reachability from every network, working
Git operations or successful builds. Complete host failure can stop monitoring too.
\section{HTTPS and Access Control}
\subsection{Public Pages and Authentication}
Operating entry points are \href{https://myfileagent.tech/user/login}{Gitea login},
\href{https://ci.myfileagent.tech/login}{Jenkins login} and
\href{https://metrics.myfileagent.tech/login}{Grafana login}.
Grafana's root URL is \url{https://metrics.myfileagent.tech}; provisioning disables
anonymous access and signup. The team changed the bootstrap password privately.
Figure~\ref{Figure:GrafanaSignedOut} shows the supplied incognito login page. It
establishes the displayed page requires credentials, not that every direct dashboard
URL has independently been tested signed out.
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.68\textheight,keepaspectratio]{hw7_images/team-grafana-incognito-login.png}
\caption{Team-supplied incognito Grafana login page. No password is included.}
\label{Figure:GrafanaSignedOut}\end{figure}
October 28 Jenkins configuration showed the private security realm,
\texttt{disableSignup=true}, Matrix authorization, and no explicit Anonymous or general
Authenticated Users grants. This is a configuration check, not a new private-window
access test. Earlier public-browser and SSH-source exception limitations remain
unresolved without independent instructor approval; working monitoring does not waive them.
\subsection{External Port Evidence and Limits}
\EvidenceID{A7-ACCESS-01}: the team ran PowerShell from its Windows workstation outside
the Droplet October 28, 14:20:37--14:21:35 EDT. IPv4 \texttt{142.93.193.110} accepted
TCP on 80/443. Ports 3000, 3001, 5050, 8080, 9090, 9100, 9115 and 50000 were not
reachable within the 2.5-second timeout. Earlier public 5050/8080 endpoints are closed;
current Jenkins 8080 remains private and loopback-bound. Failed connections do not
distinguish refusal from filtering. No raw monitoring port is intentionally published.
The transcript resolved IPv6 \texttt{2607:7700:0:28:0:2:8e5d:c16e}; all tested ports,
including 80/443, were unreachable. A Droplet check found no global IPv6 address while
kernel disable flags were zero. Do not repeat the older claim that IPv6 is currently
disabled, claim working IPv6 HTTPS, or interpret these results as proof of IPv6 firewall
effectiveness. DNS/host IPv6 reconciliation remains a limitation. The transcript did
not capture curl HTTPS output; the team explicitly skipped that follow-up. TLS-validating
probes and HTTPS health checks from the Droplet are separate evidence, not replacements
for a missing external command result. Sanitized findings are in
\path{evidence/assignment7/team-external-access-summary-2026-10-28.json}; the original
transcript remains private outside Git because it includes workstation metadata.
A complete independent scan of unintended public HTTPS metrics routes is not recorded.
\section{Dashboard and Continuous-Integration Correlation}
\subsection{Six Required Panels}
\phantomsection\label{GlossaryRef:dashboard}
The \href{https://metrics.myfileagent.tech/d/myfileagent-sre}{MyFileAgent -- SRE Monitoring}
dashboard has UID \texttt{myfileagent-sre}, folder SSW590, timezone
\texttt{America/New\_York}, and 30-second refresh. Its units and legends distinguish:
\begin{enumerate}
\item \textbf{Whole-host CPU (percent):}
\begin{lstlisting}
100 * (1 - avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[2m])))
\end{lstlisting}
This averages host CPU non-idle time over a two-minute rate window.
\item \textbf{Available host memory (bytes, displayed MiB):}
\begin{lstlisting}
node_memory_MemAvailable_bytes{job="node"}
\end{lstlisting}
\item \textbf{Root available space (percent):}
\begin{lstlisting}
100 * node_filesystem_avail_bytes{mountpoint="/",device="/dev/vda1",fstype="ext4"}
/ node_filesystem_size_bytes{mountpoint="/",device="/dev/vda1",fstype="ext4"}
\end{lstlisting}
\item \textbf{Gitea HTTPS availability (0/1):} \texttt{probe\_success} filtered to its URL.
\item \textbf{Jenkins HTTPS availability (0/1):} the same metric filtered to its URL.
\item \textbf{HTTPS duration (seconds):} \texttt{probe\_duration\_seconds\{job="https"\}}
with separate service lines. A quick failed probe is not good latency.
\end{enumerate}
Scrape health is checked separately with \texttt{up}, not substituted for availability.
The original screenshots below were chosen by the team; their rolling windows were
captured at different times and are not a single fixed comparison dataset.
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.70\textheight,keepaspectratio]{hw7_images/team-dashboard-cpu-memory.png}
\caption{Team-selected CPU/memory evidence with build markers on both panels.}
\label{Figure:SRECPU}\end{figure}
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.70\textheight,keepaspectratio]{hw7_images/team-dashboard-root-gitea.png}
\caption{Team-selected root-space and Gitea availability panels.}
\label{Figure:SRERootGitea}\end{figure}
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.70\textheight,keepaspectratio]{hw7_images/team-dashboard-jenkins-duration.png}
\caption{Team-selected Jenkins availability and two-service HTTPS duration panels.}
\label{Figure:SREJenkinsDuration}\end{figure}
\subsection{Normal Build 4: Before, During and After}
\EvidenceID{A7-CI-01}: \href{https://ci.myfileagent.tech/job/myfileagent-python-ci/job/main/4/}{main build 4}
passed October 24, 16:34:13.162--16:34:45.699 EDT, duration 32.537 seconds, on commit
\texttt{131d605c5edb5b5080e4d54861c3c7bf7c360c9c}. It ran on the Jenkins controller
executor on this Droplet, passed syntax and two tests, and notified Gitea. Separate
start/end annotations were saved on each of the six panels with build, commit,
timestamps and execution location. They are panel-specific, not automatically global.
The fixed comparison window is
\href{https://metrics.myfileagent.tech/d/myfileagent-sre?from=1792873933162\&to=1792874145699}{16:32:13.162--16:35:45.699 EDT}.
Host CPU ranged approximately 24.57--37.49\% before, 36.67--38.99\% during, and
55.51--64.56\% after. Available memory during the run ranged from 181,882,880 to
222,879,744 bytes. Root available space stayed near 50.8\%; both service probes stayed
one. These are shared-host correlations, not per-Jenkins attribution. A two-minute
CPU rate smooths/delays a short build's peak. Five-second query steps over 30-second
scrapes repeat evaluations; they do not create five-second observations. No synthetic
load was added to manufacture a spike. Raw series and test evidence are versioned.
\section{SLI, SLO and Error Budget}
\subsection{Definitions and Hypothetical Example}
\phantomsection\label{AcronymRef:SLI}\label{GlossaryRef:sli}\index{SLI}
A service-level indicator (SLI) is the measured fraction of specified HTTPS probes
that succeed; report each service separately and include expected/received coverage.
\phantomsection\label{AcronymRef:SLO}\label{GlossaryRef:slo}\index{SLO}
Our service-level objective (SLO) is at least 99\% successful scheduled probes over
24 hours per service, an internal laboratory target.
\phantomsection\label{AcronymRef:SLA}\index{SLA}
A service-level agreement (SLA) is a customer agreement that may define consequences
for a miss; this exercise creates no customer SLA.
The instructor's hypothetical figures are not measured results. At 30-second intervals,
a complete day has 2,880 probes. Gitea's 2,880/2,880 is 100\%; Jenkins's 2,850/2,880
is approximately 98.96\%, below 99\%.
\phantomsection\label{GlossaryRef:errorbudget}\index{error budget}
The theoretical error budget is $(1-0.99)\times2880=28.8$ failed samples, equivalent
to $28.8\times30/60=14.4$ minutes under uniform sampling. At most 28 whole failures
meet the target; 30 exceed the theoretical budget by 1.2 samples, about 0.6 minutes.
These equivalents are not exact continuous downtime measurements.
\subsection{Baseline and Actual Exercise Window}
\EvidenceID{A7-SLO-BASELINE-01}: the healthy October 24 baseline was
16:40:50--16:50:50 EDT, 20:40:50--20:50:50 UTC, evaluation epoch \texttt{1792875050}.
Both services had 20 received samples, all successful. The actual controlled-exercise
window was \textbf{17:23:00--17:33:00 EDT} on October 24, 21:23:00--21:33:00 UTC,
evaluation epoch \texttt{1792877580}. Approximately 20 samples are expected in ten minutes.
\begin{table}[htbp]\centering
\begin{tabular}{lrrrr}\toprule
Service & Received & Successes & Failures & Success fraction\\\midrule
Gitea & 20 & 20 & 0 & 100\%\\
Jenkins & 20 & 12 & 8 & 60\%\\\bottomrule
\end{tabular}
\caption{Measured exercise window: both services have nominal 20/20 coverage. This is not a 24-hour SLO measurement.}
\label{Table:SREIncidentSLI}\end{table}
Both services ended at \texttt{probe\_success=1}. Received failures were isolated to
Jenkins. Do not extrapolate the ten-minute percentage to claim a full-day miss/pass.
Full-day collection and actually meeting the SLO are optional in instructor version 1.42.
\subsection{Reproduce Queries and Interpret Missing Data}
Evaluate these instant queries at the recorded epoch while history remains retained:
\begin{lstlisting}
100 * avg_over_time(probe_success{job="https"}[10m])
count_over_time(probe_success{job="https"}[10m])
count_over_time(probe_success{job="https"}[10m])
- sum_over_time(probe_success{job="https"}[10m])
up{job=~"https|blackbox|prometheus"}
\end{lstlisting}
Range selectors are left-open/right-closed. Boundaries, jitter and restarts can change
counts. Averages use received observations; absent samples/series are unknown, not
success. Count binary probe failures separately from collection failures. Exact query
results and samples are retained in
\path{evidence/assignment7/jenkins-incident-sli-fixed-window.json} and
\path{evidence/assignment7/jenkins-incident-probe-samples.json}.
\section{Alerts and Operator Runbooks}
\subsection{Final Rules and Team-Controlled Delivery}
Grafana manages two file-provisioned rules in folder SSW590, group \texttt{team-sre},
evaluated every 30 seconds. Labels include owner \texttt{SSW590-Group7}, team
\texttt{group7}, scope \texttt{assignment7}, and severity. Both rules have a summary,
description and runbook link. No-data and execution errors enter Alerting, not health.
Provisioned definitions are changed in reviewed files followed by an authorized
reload/restart, not treated as durable UI-only changes\cite{GrafanaAlertFilesA7}.
\begin{table}[htbp]\centering\small
\begin{tabularx}{\linewidth}{L{3cm}YL{2cm}}
\toprule Rule & Condition and response & Pending/severity\\\midrule
\texttt{sre-service-unavailable} & Expected probe below one, separate URL instances; inspect collection, TLS, proxy/backend and restore only the affected service. & 1 minute; critical\\
\texttt{sre-root-capacity} & Verified root available percentage below 15\%; inspect growth and agree on safe cleanup/retention, protecting persistent data. & 5 minutes; warning\\
\bottomrule\end{tabularx}\caption{Final actionable alert rules.}\end{table}
Missing expected service series are explicitly replaced with zero and grouped by URL:
\begin{lstlisting}
min by (instance) (
probe_success{job="https"}
or on(instance) label_replace(vector(0),"instance",
"https://myfileagent.tech/user/login","","")
or on(instance) label_replace(vector(0),"instance",
"https://ci.myfileagent.tech/login","","")
)
\end{lstlisting}
Capacity uses the same available/size selectors as the root panel.
The \href{https://metrics.myfileagent.tech/d/myfileagent-sre-runbooks}{live runbook dashboard}
contains service-response panel 1 and capacity-response panel 2; Markdown runbooks
are also versioned. Contact point \texttt{team-alerts} uses Discord integration
\texttt{team-discord}, with resolved delivery enabled. Policy groups by folder,
alert name and instance; group wait is 10 seconds, group interval one minute, and
repeat four hours. Collection, evaluation, pending and grouping delays accumulate.
The team created the destination and supplied the webhook privately. Gmail SMTP was
considered but was not the working route. No receiver secret is included in this manual.
\subsection{Contact Point and Safe Capacity Test}
The team received the contact-point test, but a test message alone does not prove a
rule. The October 24 capacity exercise temporarily raised the free-space threshold
from 15\% to 90\%, above roughly 50.8\% free, retaining the five-minute pending period.
No disk was filled. Threshold change was recorded at 17:14:02.658 EDT; pending was
observed, then firing at 17:19:57.613. The team supplied the actual firing message.
We restored 15\% at 17:20:24.112 and verified final threshold/Normal state by
17:21:40.949. Resolved delivery was also confirmed. These are observation times,
not precise message-delivery seconds. The resolved screenshot includes an obsolete
setup description restored with older rule text; it is historical wording, not the
current route. The live description was corrected before the service outage test.
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.40\textheight,keepaspectratio]{hw7_images/capacity-discord-firing-team.png}\par\medskip
\includegraphics[width=\linewidth,height=0.40\textheight,keepaspectratio]{hw7_images/capacity-discord-resolved-team.png}
\caption{Actual team-received capacity firing and resolved messages. Final rule: below 15\% for five minutes.}
\label{Figure:SRECapacityAlerts}\end{figure}
\subsection{Diagnosis, Restoration and Escalation}
Acknowledge and record time; identify the URL instance; compare collection health,
probe result/duration and exporter logs. Check DNS, TLS and Caddy before assuming
backend failure. Inspect affected container state/logs, resource pressure and recent
changes. Never disable TLS validation to clear a warning. For the approved Jenkins
exercise, the known recovery command was:
\begin{lstlisting}
cd /home/codex/myfileagent-gitea
docker compose -f compose.yaml -f compose.jenkins.yaml start jenkins
\end{lstlisting}
Verify the service name before reuse. Confirm HTTPS, recovered probes, a passing
pipeline and Gitea status notification, then record resolved delivery. Escalate
unresolved faults to the other team member. For capacity, compare \texttt{df -B1 /},
inspect growth read-only, protect volumes/repositories/evidence and agree on cleanup.
Do not globally prune Docker or delete service data to manufacture recovery.
Repeating a controlled outage or threshold test requires an approved team window.
\section{Controlled Incident, Recovery and Persistence}
\subsection{Approved Jenkins-Only Exercise}
The team approved an approximately three-minute Jenkins stop. Prechecks found no
unfinished build and an empty queue. Codex executed the known commands on the team's
behalf; automatic recovery restarted only Jenkins after approximately three minutes.
Gitea and monitoring stayed running and volumes were preserved.
Figure~\ref{Figure:SREIncidentDashboard} is the original team dashboard capture.
Figure~\ref{Figure:SREIncidentTimeline} adds source-authored event annotations from
saved samples; those markers are not claimed to have been saved in the Grafana UI.
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.72\textheight,keepaspectratio]{hw7_images/team-incident-dashboard-full.png}
\caption{Team dashboard capture for October 24, approximately 17:23--17:33:59 EDT: Jenkins drops and recovers while Gitea remains one. The displayed range extends beyond the exact 17:23--17:33 SLI window.}
\label{Figure:SREIncidentDashboard}\end{figure}
\begin{figure}[htbp]\centering
\begin{tikzpicture}[x=1.05cm,y=0.9cm,>=Stealth]
\draw[->] (0,0) -- (10.5,0) node[right]{\scriptsize EDT};
\foreach \x/\lab in {0/17:23,2/17:25,4/17:27,6/17:29,8/17:31,10/17:33}{\draw (\x,0.08)--(\x,-0.08) node[below]{\scriptsize\lab};}
\node[left] at (0,3.2){\scriptsize Gitea};
\node[left] at (0,1.4){\scriptsize Jenkins};
\draw[gray,dotted] (0,1)--(10,1);\draw[gray,dotted] (0,1.8)--(10,1.8);
\node[left] at (0,1){\tiny 0};\node[left] at (0,1.8){\tiny 1};
\draw[devopsGreen,thick] (0.41482,3.6)--(9.91482,3.6);
\draw[devopsBlue,thick] (0.18372,1.80) -- (0.68372,1.80) -- (0.68372,1.80) -- (1.18372,1.80) -- (1.18372,1.80) -- (1.68372,1.80) -- (1.68372,1.80) -- (2.18372,1.80) -- (2.18372,1.80) -- (2.68372,1.80) -- (2.68372,1.80) -- (3.18372,1.80) -- (3.18372,1.80) -- (3.68372,1.80) -- (3.68372,1.80) -- (4.18372,1.80) -- (4.18372,1.00) -- (4.68372,1.00) -- (4.68372,1.00) -- (5.18372,1.00) -- (5.18372,1.00) -- (5.68372,1.00) -- (5.68372,1.00) -- (6.18372,1.00) -- (6.18372,1.00) -- (6.68372,1.00) -- (6.68372,1.00) -- (7.18372,1.00) -- (7.18372,1.00) -- (7.68372,1.00) -- (7.68372,1.00) -- (8.18372,1.00) -- (8.18372,1.80) -- (8.68372,1.80) -- (8.68372,1.80) -- (9.18372,1.80) -- (9.18372,1.80) -- (9.68372,1.80) -- (9.68372,1.80);
\draw[dashed] (3.86662,0)--(3.86662,4.1) node[above,align=center]{\tiny Stop\\\tiny17:26:51.997};
\draw[dashed,devopsRed] (5.33333,0)--(5.33333,2.5) node[above,align=center]{\tiny Firing\\\tiny17:28:20};
\draw[dashed] (6.91812,0)--(6.91812,4.1) node[above,align=center]{\tiny Restart\\\tiny17:29:55.087};
\draw[dashed,devopsGreen] (7.81022,0)--(7.81022,2.5) node[above,align=center]{\tiny HTTPS ready\\\tiny17:30:48.613};
\end{tikzpicture}
\caption{Annotated timeline from saved binary probe samples, shown as sample-and-hold steps. First failed Jenkins sample: 17:27:11.023; first recovered sample: 17:31:11.023. Command/HTTP event markers are separate from probe transitions. This is a source-authored figure, not an altered Grafana screenshot.}
\label{Figure:SREIncidentTimeline}\end{figure}
\begin{table}[htbp]\centering\small
\begin{tabularx}{\linewidth}{L{5cm}L{3.1cm}Y}\toprule
Event & October 24 EDT & Evidence boundary\\\midrule
Stop requested & 17:26:45.883 & Automation event\\
Jenkins stopped & 17:26:51.997 & Stop completed\\
First failed sample & 17:27:11.023 & Actual probe timestamp\\
Failure first observed & 17:27:12.740 & Polling timestamp\\
Rule firing transition & 17:28:20 & Grafana UI\\
Firing first observed & 17:28:34.086 & Polling timestamp\\
Discord firing received & displayed 17:28 & No exact second\\
Acknowledgment & Confirmed in chat & Clock time unavailable\\
Restart requested & 17:29:55.087 & Automatic recovery\\
Start command finished & 17:29:57.750 & Exit zero, not readiness\\
HTTPS ready observed & 17:30:48.613 & HTTP 200\\
First successful sample & 17:31:11.023 & Actual probe timestamp\\
Rule Normal transition & 17:31:20 & Grafana UI\\
Discord resolved received & Confirmed & No visible message time\\
\bottomrule\end{tabularx}\caption{Event versus observation times, America/New\_York, UTC--04:00.}
\label{Table:SRETimeline}\end{table}
Stop-to-first-failed-sample was 19.026 seconds; stop-to-rule-firing was 88.003 seconds.
First failed sample to firing was 68.977 seconds. Polling observed firing 14.086 seconds
after the UI transition. The scrape/evaluation intervals and one-minute pending period
explain quantization; notification grouping adds delay. Exact delivery/acknowledgment
latency cannot be calculated without precise receipt/acknowledgment times.
Stopped-to-restart-requested was 183.090 seconds, restart-to-observed HTTPS readiness
53.526 seconds, and stopped-to-observed readiness 236.617 seconds (about 3 minutes
57 seconds). Startup extended the three-minute injection. First failed to first
recovered sample spans 240 seconds; this is a sampled interval, not exact downtime.
\begin{figure}[p]\centering
\includegraphics[width=\linewidth,height=0.40\textheight,keepaspectratio]{hw7_images/jenkins-discord-firing-team.png}\par\medskip
\includegraphics[width=\linewidth,height=0.40\textheight,keepaspectratio]{hw7_images/jenkins-discord-resolved-team.png}
\caption{Service-rule firing and resolved messages received in the team Discord channel.}
\label{Figure:SREServiceAlerts}\end{figure}
\subsection{Recovery Validation and Blameless Review}
Both probes ended at one and Discord delivery/resolution was confirmed.
\href{https://ci.myfileagent.tech/job/myfileagent-python-ci/job/main/5/}{Recovery-validation build 5}
ran \textbf{October 25}, after fresh sign-in, passing syntax and two tests in 36.837
seconds on commit \texttt{131d605c5edb5b5080e4d54861c3c7bf7c360c9c}. Its log records
Gitea SUCCESS notification. It is following-day validation, not an immediate recovery
build. No manual/PDF build was rerun under the team's explicit deferral. Historical
manual successes do not fill that missing immediate check.
This approved fault injection is not an unplanned application defect or an individual's
error. Impact was eight failed Jenkins probes; Gitea had no failures in the fixed
window. Isolation, the idle-build precheck, known recovery command, automatic restart,
per-service instances and Discord delivery worked. Gaps were exact receipt and
acknowledgment times and prompt pipeline-validation access.
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/pulls/11}{Earlier PR 11}
records a code-test failure/repair, distinct from unavailable-service monitoring.
The full blameless review is retained in the reviewed operational source.
\textbf{P1 issue 12}, assigned to Gowri (\texttt{glovely}), proposes an independent
external HTTPS checker. A complete shared-host/network failure can stop local detection
and notifications. \textbf{P2 issue 13}, also assigned to Gowri, tracks complete incident
timestamps and prompt recovery validation. Both remain open improvements, not completed
deployments or authorization for a new outage or paid service.
\subsection{Separate Prometheus and Grafana Persistence Test}
\EvidenceID{A7-PERSIST-01}: on October 28 both services were restarted separately
without deleting volumes. Prometheus restart was requested 13:31:34.517 EDT and
readiness observed 13:31:40.103 (5.585 seconds). Grafana restart was requested
13:32:15.106 and readiness observed 13:32:55.110 (40.004 seconds). Old October 24
probe values were unchanged. Data-source, two alert-rule and 18 annotation records
matched before/after hashes. Grafana's resource storage retained both original
six-panel monitoring and two-panel runbook dashboards. Its empty legacy dashboard
table was not mistaken for lost dashboards. All targets/both probes were healthy
afterward. Gitea/Jenkins/Grafana health/login checks from the Droplet returned 200;
these are not the skipped external HTTPS capture.
One approximately 60-second interval between Jenkins samples was recorded: 19 received
versus approximately 20 expected; Gitea had 20. The missed scheduled collection is
unknown, not proof of service failure or success. Grafana restart pauses evaluation
and notifications even while Prometheus collects. This demonstrates persistence,
not backup/restore or uninterrupted observation.
\section{Manual Integration, Traceability and Remaining Work}
\subsection{Reviewed Operational Source and CI}
All links below identify immutable merge commit
\texttt{b42689f02f30ad895101a2c5f367e54e3603bc5d}, rather than a moving branch.
\begin{itemize}
\item \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/compose.yaml}{Compose configuration} and
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/README.md}{deployment/recovery guide}.
\item \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/prometheus/prometheus.yml}{Prometheus targets} and
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/blackbox/blackbox.yml}{Blackbox probe module}.
\item \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/grafana/dashboards/team-sre.json}{Dashboard definition} and
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/grafana/provisioning/alerting/team-sre-rules.json}{final alert rules}.
\item \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/runbooks}{operator runbooks},
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/incidents/2026-10-24-jenkins-outage.md}{blameless review} and
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/src/commit/b42689f02f30ad895101a2c5f367e54e3603bc5d/monitoring/evidence}{sanitized evidence}.
\item \href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/pulls/14}{Reviewed PR 14},
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/issues/12}{P1 issue 12} and
\href{https://myfileagent.tech/myfileagent/myfileagent-pipeline/issues/13}{P2 issue 13}.
\end{itemize}
Both Jenkins branch and required PR checks passed on feature head \texttt{6605394d7a}.
Nicholas (\texttt{nkogut}) approved at 14:03 EDT and merged at 14:04 EDT October 28.
\href{https://ci.myfileagent.tech/job/myfileagent-python-ci/job/main/6/}{Post-merge main build 6}
passed syntax and two tests in 36.824 seconds on the merge commit and notified Gitea.
These existing Python regressions do not validate every monitoring setting. Separate
Compose/promtool, JSON, dashboard-copy and private secret-value checks support the
operational change; no gate was bypassed.
\subsection{Document Controls and Publication Boundary}
This is cumulative Assignment 7 manual version 1.9.0, with SRE after Jenkins. Hosts
includes the Grafana page and private monitoring services. Passwords contains the
team-specified \texttt{bitwarden-grafana} entry and non-revealing Discord hints. No
vault login, webhook URL, password or private key is included. Introduction, history,
glossary/acronyms, references and AI attribution are updated. Raw original screenshots
remain unchanged; the annotated incident figure is generated from recorded samples.
The documentation is a separate Gitea feature-branch change that still needs source
review and final publication approval. The existing manual Actions workflow builds
pushes to \texttt{main} or \texttt{manual-build-validation}; it does not build this
documentation branch. No workflow was triggered or relabeled as a completed Assignment
7 publication. Before an approved final merge/build, confirm workflow/artifact labels
consistently, compile through Gitea Actions, inspect affected pages and all links,
retain the downloaded PDF/manifest and verify exact source/run/checksum identity.
Do not submit an old Assignment 6 PDF or call this uncompiled draft the final artifact.
Remaining limitations are the skipped external HTTPS command capture, inconclusive
IPv6, incomplete signed-out direct-URL testing, earlier unresolved access exceptions,
no initial planning issue, no tested monitoring backup/restore, next-day recovery-build
timing and the deferred manual compile. These are not marked complete. Full-day SLO
measurement is optional; issues 12/13 remain open by design.