Record measured Chapter 5 deployment, alerts, incident and recovery
manual-pdf / build-manual (push) Successful in 2m33s
manual-pdf / build-manual (push) Successful in 2m33s
This commit is contained in:
+353
-449
@@ -1,485 +1,389 @@
|
||||
\chapter{Introduction to SRE: Monitoring and Reliability}
|
||||
\ChapterLabel{SREMonitoring}
|
||||
|
||||
\section{Objective and Scope}
|
||||
|
||||
This chapter documents the design, configuration, deployment
|
||||
requirements, and verification procedures for the Group 10
|
||||
Site Reliability Engineering (SRE) monitoring environment.
|
||||
|
||||
The objective is to monitor the reliability of the existing
|
||||
Gitea and Jenkins services while preserving their security,
|
||||
persistent data, and continuous integration functionality.
|
||||
|
||||
The proposed monitoring stack consists of four Docker
|
||||
containers: Prometheus, Grafana OSS, Node Exporter, and
|
||||
Blackbox Exporter.
|
||||
|
||||
The configuration files were prepared in the Gitea repository
|
||||
on the \texttt{chapter5-sre-monitoring} branch.
|
||||
|
||||
\begin{devopsNote}[Verification Status]
|
||||
Repository configuration and documentation have been prepared.
|
||||
Deployment, runtime verification, dashboard screenshots, alert
|
||||
notifications, and incident testing remain pending. These
|
||||
activities must be completed and documented before submission.
|
||||
\end{devopsNote}
|
||||
\index{monitoring}\index{incident review}\index{error budget}
|
||||
|
||||
\section{Deployment and Reproducibility}
|
||||
\subsection{Scope, baseline, and decisions}
|
||||
Group 10 deployed four monitoring containers on October 30, 2026, using Turan
|
||||
Islamli's prepared branch and Sergio Espinal's authorized operational changes.
|
||||
This report records actual tests, rather than treating configuration as proof.
|
||||
The implementation remains on \path{chapter5-sre-monitoring}; main has not
|
||||
been merged. Human peer review remains outstanding.
|
||||
|
||||
\subsection{Existing Infrastructure}
|
||||
The Ubuntu 24.04 primary Droplet (165.227.90.215) originally had approximately
|
||||
458 MiB RAM. An approved snapshot, ID 252241628, was retained before resizing
|
||||
CPU/RAM to 1 vCPU and 2 GB. The disk remains 10 GB as requested. Its root
|
||||
filesystem reports 8.7 GiB usable, approximately 7.0 GiB used and 1.8 GiB
|
||||
available (81\% used). Snapshot existence does not demonstrate a restore.
|
||||
The primary plan is \$12/month; the separate unchanged 512 MB Droplet costs
|
||||
\$4/month; the 5.65 GB snapshot is approximately \$0.34/month. Known total:
|
||||
approximately \$16.34/month before taxes or other usage. Sergio owns these
|
||||
resources and should remove the snapshot only after deciding it is no longer
|
||||
needed. No additional paid service was provisioned for monitoring.
|
||||
|
||||
The verified deployment host is an Ubuntu 24.04 DigitalOcean
|
||||
Droplet with Docker and Docker Compose installed.
|
||||
The full Grafana image and optional plugin downloads temporarily exhausted disk
|
||||
space during installation. Grafana was stopped, only the new full image and
|
||||
optional downloaded plugin files were removed, and the slim image was used.
|
||||
The Grafana database and all named volumes were preserved. The resulting image
|
||||
is approximately 1.23 GB rather than 2 GB. Only the Prometheus plugin 13.2.4
|
||||
was installed; automatic plugin preinstallation and updates are disabled.
|
||||
The retained free-space margin is small and must be monitored.
|
||||
|
||||
The existing application containers are Gitea, Jenkins,
|
||||
and Caddy.
|
||||
\subsection{Versions, storage, and actual topology}
|
||||
The deployed images are \path{prom/prometheus:v3.15.1},
|
||||
\path{grafana/grafana:13.3.0-slim},
|
||||
\path{quay.io/prometheus/node-exporter:v1.12.1}, and
|
||||
\path{quay.io/prometheus/blackbox-exporter:v0.29.1}. Publisher digests
|
||||
captured with \texttt{docker image inspect} are recorded below. Versions are
|
||||
pinned in Compose; the digests identify the images actually inspected.
|
||||
|
||||
Gitea and Jenkins use separate Compose projects. Caddy
|
||||
provides HTTPS reverse-proxy access.
|
||||
\begin{figure}[htbp]\centering\small
|
||||
\fbox{\begin{minipage}{0.94\linewidth}\centering
|
||||
\textbf{Primary Droplet: Ubuntu 24.04, 1 CPU, 2 GB RAM, 10 GB disk}\\[5pt]
|
||||
Browser $\xrightarrow{\mathrm{HTTPS}\ 443}$ \fbox{Caddy}\\
|
||||
\texttt{gitea\_default} proxy network: Caddy routes by hostname\\[4pt]
|
||||
\fbox{Gitea :3000}\quad \fbox{Jenkins :8080}\quad
|
||||
\fbox{Grafana :3000}\\[5pt]
|
||||
\textbf{Four separate monitoring containers}\\
|
||||
\fbox{Grafana} $\xrightarrow{\mathrm{query}}$ \fbox{Prometheus :9090}\\[4pt]
|
||||
Prometheus $\xrightarrow{\mathrm{scrape\ every\ }30s}$
|
||||
\fbox{Node Exporter :9100}\quad host /proc, /sys, /\\[4pt]
|
||||
Prometheus $\xrightarrow{\mathrm{probe\ request}}$
|
||||
\fbox{Blackbox Exporter :9115}\\
|
||||
Blackbox $\xrightarrow{\mathrm{TLS}\ 443}$ Caddy
|
||||
$\rightarrow$ Gitea /user/login and Jenkins /login\\[4pt]
|
||||
\path{monitoring_monitoring_private}: all four monitoring services\\
|
||||
Grafana and Blackbox additionally join \texttt{gitea\_default}.\\
|
||||
Grafana $\xrightarrow{\mathrm{outbound\ HTTPS}}$ Discord team alerts\\[4pt]
|
||||
\textbf{Persistent storage:} Prometheus named volume $\rightarrow$ /prometheus;\\
|
||||
Grafana named volume $\rightarrow$ /var/lib/grafana;\\
|
||||
existing Gitea /data and Jenkins /var/jenkins\_home retained.\\
|
||||
Configuration bind mounts originate in /opt/ssw590-monitoring.\\
|
||||
Existing applications remain in /opt/gitea and /opt/jenkins.\\[4pt]
|
||||
\textbf{CI outside this diagram's metrics:} Windows LaTeX runner polls Gitea;\\
|
||||
Jenkins application build executes on the primary controller.
|
||||
\end{minipage}}
|
||||
\caption{Actual deployment, October 30, 2026. Internal ports are not public
|
||||
listeners. Grafana is shown twice to clarify its query role, not as two containers.}
|
||||
\label{Figure:SRETopology}\end{figure}
|
||||
|
||||
The monitoring services are defined in a separate Compose
|
||||
project under \texttt{monitoring/compose.yaml}.
|
||||
Prometheus retains up to seven days or 512 MB of stored blocks, whichever
|
||||
limit applies first. WAL/head storage is additional, so this is not a hard
|
||||
filesystem quota \cite{PrometheusStorage}. Grafana stores its SQLite database
|
||||
and installed plugin in its named volume. Removing volumes would destroy this
|
||||
persistence. All four containers use \texttt{unless-stopped} restart policies.
|
||||
|
||||
This separation is intended to prevent changes to the
|
||||
existing application deployments.
|
||||
\subsection{Repeatable operations}
|
||||
Check out the feature branch and copy the non-secret \texttt{monitoring/}
|
||||
directory to \texttt{/opt/ssw590-monitoring}. Privately supply the admin password,
|
||||
Grafana root URL, and the current Caddy private IP in a mode-600 \texttt{.env}.
|
||||
The proxy network must already exist. Confirm its subnet and that
|
||||
172.18.0.250 is unused before assigning Blackbox's fixed address. Set readable
|
||||
configuration directories to 755 and non-secret files to 644. Keep the local
|
||||
Discord provisioning file owned by UID 472, group 0, mode 600.
|
||||
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize,breaklines=true]
|
||||
cd /opt/ssw590-monitoring
|
||||
docker compose config --quiet
|
||||
docker compose up -d
|
||||
docker compose exec grafana grafana cli plugins install prometheus 13.2.4
|
||||
docker compose restart grafana
|
||||
docker compose ps
|
||||
docker exec monitoring-prometheus-1 promtool check config /etc/prometheus/prometheus.yml
|
||||
\end{lstlisting}
|
||||
The commands were executed successfully during deployment. For updates, review
|
||||
image/plugin compatibility and available disk first, retain a backup, validate
|
||||
configuration, and recreate only the affected service. Do not run
|
||||
\texttt{down -v}. Recovery starts with \texttt{docker compose up -d}, target
|
||||
health and logs; restore known-good configuration before escalating to a backup
|
||||
restore. Reinstall the pinned plugin if rebuilding the Grafana volume.
|
||||
|
||||
\subsection{Monitoring Containers}
|
||||
\subsection{Inspected publisher digests}
|
||||
\begin{lstlisting}[basicstyle=\ttfamily\tiny,breaklines=true]
|
||||
prom/prometheus@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
|
||||
grafana/grafana@sha256:a66f098dd9b2e1b5a19287ff176db02d895122488c6e39b3dfcd3fb897039225
|
||||
quay.io/prometheus/node-exporter@sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0
|
||||
quay.io/prometheus/blackbox-exporter@sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13
|
||||
\end{lstlisting}
|
||||
|
||||
\section{Metrics and Probes}
|
||||
Prometheus privately scrapes itself, Node Exporter and Blackbox Exporter, plus
|
||||
two relabeled HTTPS probe targets every 30 seconds. Five \texttt{up} series
|
||||
were 1 at the verification checkpoint; both \texttt{probe\_success} values
|
||||
were 1 after recovery. A successful scrape (\texttt{up}) means collection
|
||||
worked; it does not establish that the application probe succeeded.
|
||||
|
||||
Node Exporter has read-only host-root and proc/sys access. Its
|
||||
\path{node_memory_MemTotal_bytes} was 2,063,564,800 bytes, consistent
|
||||
with host \texttt{free}. The root series labels were verified as
|
||||
\texttt{device=/dev/vda1}, \texttt{mountpoint=/}, \texttt{fstype=ext4},
|
||||
matching \texttt{df}. This excludes container overlay filesystems.
|
||||
|
||||
The HTTPS module requires HTTP 200, valid certificate verification and a
|
||||
response before its timeout. Targets are the actual TLS login URLs below.
|
||||
The exporter resolves both hostnames to Caddy's private 172.18.0.3 address,
|
||||
retaining their hostname/SNI and TLS verification. This measures the private
|
||||
proxy/application route; it cannot establish public DNS or external Internet
|
||||
availability. A shared-host outage also stops its own monitoring.
|
||||
|
||||
\section{HTTPS and Access Control}
|
||||
\begin{itemize}
|
||||
\item \textbf{Prometheus:} Collects and stores monitoring metrics.
|
||||
\item \textbf{Grafana OSS:} Displays dashboards and evaluates alerts.
|
||||
\item \textbf{Node Exporter:} Exposes host CPU, memory, and disk metrics.
|
||||
\item \textbf{Blackbox Exporter:} Performs HTTPS availability probes.
|
||||
\item Gitea login: \url{https://git.sespinal590.dev/user/login}.
|
||||
\item Jenkins login: \url{https://ci.165.227.90.215.sslip.io/login}.
|
||||
\item Grafana: \url{https://metrics.165.227.90.215.sslip.io}.
|
||||
\end{itemize}
|
||||
Use the team account for Gitea, the existing administrator's approved Jenkins
|
||||
access path, and the privately held Grafana admin password. Anonymous Grafana
|
||||
access and self-registration are disabled; its cookie is secure. No grader
|
||||
account is required to read the embedded evidence.
|
||||
|
||||
The Compose configuration requires explicitly selected image
|
||||
versions rather than floating \texttt{latest} tags.
|
||||
Caddy provides HTTPS and forwards the metrics hostname to
|
||||
\texttt{grafana:3000}. The existing Jenkins IP restriction was retained with
|
||||
only Blackbox's 172.18.0.250/32 added. A public 403 from an unapproved source
|
||||
is expected access denial and is not treated as successful availability.
|
||||
The exporter obtained 200 from Jenkins through the narrow permitted route.
|
||||
Caddy's configuration was backed up before modification.
|
||||
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize,breaklines=true]
|
||||
# Existing Jenkins allowlist plus the one monitoring address:
|
||||
remote_ip 155.246.151.38/32 172.18.0.1/32 172.18.0.250/32
|
||||
# Additional HTTPS virtual host:
|
||||
metrics.165.227.90.215.sslip.io {
|
||||
reverse_proxy grafana:3000
|
||||
}
|
||||
\end{lstlisting}
|
||||
No monitoring service has Compose host-port mappings. External TCP checks from
|
||||
Sergio's Windows workstation on October 30 could not connect to primary ports
|
||||
3000, 8080, 9090, 9100 or 9115. HTTPS remained reachable. These are point-in-time
|
||||
observations from that source, not a universal firewall guarantee.
|
||||
|
||||
Prometheus and Grafana use named persistent Docker volumes.
|
||||
\begin{tabularx}{\linewidth}{L{3cm}Y}
|
||||
\caption{Chapter 5 hosts, storage and credential hints\label{Table:SREHosts}}\\
|
||||
\toprule Service / owner & Address, exposure, storage or secret handling\\\midrule
|
||||
Primary / Sergio & 165.227.90.215; Caddy HTTPS 443; SSH for approved operators.
|
||||
Snapshot retained; monitoring runs here.\\
|
||||
Grafana / Sergio & metrics hostname above; private 3000; named Grafana volume.
|
||||
Admin secret stays in root-owned server .env; never in Git or PDF.\\
|
||||
Prometheus / Sergio & Private prometheus:9090; named metrics volume; no user-facing login.\\
|
||||
Exporters / Sergio & Private node-exporter:9100 and blackbox-exporter:9115;
|
||||
read-only configuration/host mounts.\\
|
||||
Discord / team & Dedicated Discord integration; secret destination in
|
||||
\texttt{discord.local.yml} on server only. Rotate via Discord if exposed.\\
|
||||
\bottomrule\end{tabularx}
|
||||
These entries supplement the existing Hosts and Password Hints tables in
|
||||
\ChapterRef{Gitea}; no credentials are reproduced.
|
||||
|
||||
No monitoring service publishes an internal port directly
|
||||
to the public host interface.
|
||||
\section{Dashboard and CI Correlation}
|
||||
The provisioned dashboard is \textit{Chapter 5 -- SRE Monitoring Overview}, UID
|
||||
\texttt{sre-overview}, UTC, default one hour, refresh 30 seconds. Its versioned
|
||||
source is \path{monitoring/grafana/dashboards/sre-overview.json}. The six
|
||||
panels use the following expressions (each line is one panel's query).
|
||||
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize,breaklines=true]
|
||||
100 * (1 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle",job="node-exporter"}[5m])))
|
||||
node_memory_MemAvailable_bytes{job="node-exporter"}
|
||||
100 * node_filesystem_avail_bytes{job="node-exporter",mountpoint="/",fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{job="node-exporter",mountpoint="/",fstype!~"tmpfs|overlay"}
|
||||
probe_success{job="https",instance="https://git.sespinal590.dev/user/login"}
|
||||
probe_success{job="https",instance="https://ci.165.227.90.215.sslip.io/login"}
|
||||
probe_duration_seconds{job="https"}
|
||||
\end{lstlisting}
|
||||
CPU is the non-idle fraction averaged over CPUs, percent; available RAM is
|
||||
bytes rendered in GiB/MiB; root availability is percent for the one verified
|
||||
root mount; service lines are binary 0/1; durations are seconds with separate
|
||||
Gitea/Jenkins legends. Availability is not an HTTP request error rate for
|
||||
all users. Whole-host CPU cannot be attributed solely to Jenkins.
|
||||
|
||||
\subsection{Capacity Constraint}
|
||||
\begin{figure}[p]\centering
|
||||
\includegraphics[width=\linewidth,height=0.82\textheight,keepaspectratio]{evidence/chapter5/dashboard-live.png}
|
||||
\caption{Actual Grafana six-panel dashboard, October 30, 2026, UTC.
|
||||
The Jenkins-only outage is visible while Gitea stays at 1.}
|
||||
\label{Figure:SREDashboard}\end{figure}
|
||||
|
||||
The initial host inspection identified approximately
|
||||
458 MiB of total RAM, with approximately 209 MiB available
|
||||
at the time of inspection.
|
||||
|
||||
This capacity is insufficient for a conventional deployment
|
||||
of the four monitoring containers alongside the existing
|
||||
Gitea, Jenkins, and Caddy services.
|
||||
|
||||
The team must approve a suitable capacity plan before
|
||||
deploying the monitoring stack.
|
||||
|
||||
The team must not create paid resources or resize the
|
||||
Droplet without authorization.
|
||||
|
||||
\subsection{Deployment Verification}
|
||||
|
||||
After obtaining approval, the deployment operator must:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Select and record the four official image versions.
|
||||
\item Configure required environment variables securely.
|
||||
\item Validate the Compose configuration.
|
||||
\item Confirm the required Docker networks exist.
|
||||
\item Deploy the monitoring services.
|
||||
\item Verify all monitoring containers are healthy.
|
||||
\item Confirm existing application containers remain operational.
|
||||
\item Verify persistent volumes and restart policies.
|
||||
\item Record deployment commands and their actual output.
|
||||
\end{enumerate}
|
||||
|
||||
\textbf{Evidence pending:} Compose validation, selected image
|
||||
versions, container status, network inspection, and persistence.
|
||||
|
||||
\section{Metrics and HTTPS Probes}
|
||||
|
||||
\subsection{Prometheus Scrape Configuration}
|
||||
|
||||
Prometheus is configured with a 30-second scrape interval.
|
||||
|
||||
The prepared scrape jobs are:
|
||||
|
||||
\begin{itemize}
|
||||
\item Prometheus self-monitoring.
|
||||
\item Node Exporter host metrics.
|
||||
\item Blackbox Exporter self-monitoring.
|
||||
\item HTTPS probes for Gitea and Jenkins.
|
||||
\end{itemize}
|
||||
|
||||
The scrape configuration is stored at
|
||||
\texttt{monitoring/prometheus/prometheus.yml}.
|
||||
|
||||
The Blackbox module configuration is stored at
|
||||
\texttt{monitoring/blackbox/blackbox.yml}.
|
||||
|
||||
\subsection{Host Metrics}
|
||||
|
||||
Node Exporter provides metrics for CPU utilization,
|
||||
available memory, and root filesystem capacity.
|
||||
|
||||
The dashboard uses the following Prometheus metric families:
|
||||
|
||||
\begin{itemize}
|
||||
\item \texttt{node\_cpu\_seconds\_total}
|
||||
\item \texttt{node\_memory\_MemAvailable\_bytes}
|
||||
\item \texttt{node\_filesystem\_avail\_bytes}
|
||||
\item \texttt{node\_filesystem\_size\_bytes}
|
||||
\end{itemize}
|
||||
|
||||
The deployment operator must verify that these metrics
|
||||
represent the actual host rather than an unintended
|
||||
container filesystem.
|
||||
|
||||
\subsection{HTTPS Availability Metrics}
|
||||
|
||||
Blackbox Exporter provides:
|
||||
|
||||
\begin{itemize}
|
||||
\item \texttt{probe\_success}: successful probe indicator.
|
||||
\item \texttt{probe\_duration\_seconds}: probe duration.
|
||||
\item HTTP response and TLS diagnostic metrics.
|
||||
\end{itemize}
|
||||
|
||||
A successful configured probe requires HTTP 200,
|
||||
valid TLS verification, and completion before timeout.
|
||||
|
||||
Prometheus target availability and service availability
|
||||
are different measurements.
|
||||
|
||||
The Prometheus \texttt{up} metric indicates whether a
|
||||
scrape succeeded. The \texttt{probe\_success} metric
|
||||
indicates whether the probed endpoint passed its checks.
|
||||
|
||||
\textbf{Evidence pending:} Prometheus targets, live metric
|
||||
values, and successful probes for both services.
|
||||
|
||||
\section{HTTPS Access and Security}
|
||||
|
||||
\subsection{Verified HTTPS Endpoints}
|
||||
|
||||
The existing Gitea HTTPS hostname is
|
||||
\texttt{git.sespinal590.dev}.
|
||||
|
||||
The existing Jenkins HTTPS hostname is
|
||||
\texttt{ci.165.227.90.215.sslip.io}.
|
||||
|
||||
Read-only checks confirmed a successful HTTP 200 response
|
||||
and valid TLS verification for the Gitea root endpoint.
|
||||
|
||||
The Jenkins public root and login endpoints returned
|
||||
HTTP 403 from the tested source, with valid TLS verification.
|
||||
|
||||
An internal request to the Jenkins login endpoint from
|
||||
the Caddy container returned HTTP 200.
|
||||
|
||||
\subsection{Jenkins Access Restriction}
|
||||
|
||||
The Caddy configuration uses an IP allowlist to restrict
|
||||
Jenkins access.
|
||||
|
||||
The public HTTP 403 response is therefore not sufficient
|
||||
evidence that the Jenkins application is unavailable.
|
||||
|
||||
Before deployment, the team must establish narrowly scoped
|
||||
monitoring access that preserves the existing restriction.
|
||||
|
||||
The team must verify that Blackbox Exporter can reach the
|
||||
real Jenkins HTTPS login endpoint and obtain HTTP 200.
|
||||
|
||||
The monitoring system must not classify HTTP 403 as
|
||||
a successful Jenkins availability probe.
|
||||
|
||||
\subsection{Grafana HTTPS Access}
|
||||
|
||||
Grafana must be made available through an authenticated
|
||||
HTTPS route managed by Caddy.
|
||||
|
||||
Anonymous access must remain disabled.
|
||||
|
||||
Administrator credentials and notification secrets
|
||||
must not be committed to the repository.
|
||||
|
||||
The team must confirm that Prometheus and exporter ports
|
||||
are not exposed publicly.
|
||||
|
||||
\textbf{Evidence pending:} Grafana HTTPS login, Caddy
|
||||
configuration, TLS verification, and access restrictions.
|
||||
|
||||
\section{Grafana Dashboard and CI Correlation}
|
||||
|
||||
\subsection{Dashboard Provisioning}
|
||||
|
||||
Grafana provisioning files are stored under
|
||||
\texttt{monitoring/grafana/provisioning/}.
|
||||
|
||||
The prepared dashboard definition is stored at
|
||||
\texttt{monitoring/grafana/dashboards/sre-overview.json}.
|
||||
|
||||
The dashboard is designed to display six panels:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Host CPU utilization percentage.
|
||||
\item Host available RAM.
|
||||
\item Root disk available percentage.
|
||||
\item Gitea HTTPS availability.
|
||||
\item Jenkins HTTPS availability.
|
||||
\item HTTPS response time for both services.
|
||||
\end{enumerate}
|
||||
|
||||
The dashboard refresh interval is 30 seconds.
|
||||
|
||||
\subsection{Continuous Integration Correlation}
|
||||
|
||||
The monitoring experiment must be correlated with the
|
||||
existing Jenkins pipeline and Gitea Actions PDF workflow.
|
||||
|
||||
The team must record relevant build execution times and
|
||||
compare them with the monitoring timeline.
|
||||
|
||||
A successful application recovery does not automatically
|
||||
prove that CI pipelines remain operational.
|
||||
|
||||
The Jenkins pipeline and Gitea Actions workflow must
|
||||
therefore be verified independently after the outage.
|
||||
|
||||
\textbf{Evidence pending:} Six-panel dashboard screenshot,
|
||||
Jenkins pipeline execution, and successful Gitea Actions
|
||||
PDF build artifact.
|
||||
After recovery, Jenkins \path{startup-product-ci/main} build 3 passed for
|
||||
commit \path{6cfac4ec1e6d56dbb0b1a66bd59775b9db6ed065}.
|
||||
It ran from 20:43:32.534 to 20:43:52.340 UTC (19.806 seconds), on the Jenkins
|
||||
controller. See \url{https://ci.165.227.90.215.sslip.io/job/startup-product-ci/job/main/3/}.
|
||||
The host measurements immediately before, during and after this build were:
|
||||
\begin{center}\begin{tabular}{lrr}\toprule
|
||||
UTC evaluation & CPU (one-minute rate) & Available RAM (MiB)\\\midrule
|
||||
20:43:00 (before) & 41.57\% & 878.0\\
|
||||
20:43:45 (during) & 17.40\% & 863.8\\
|
||||
20:44:30 (after) & 17.67\% & 914.5\\\bottomrule
|
||||
\end{tabular}\end{center}
|
||||
The short build's CPU peak is not established by these snapshots. They include
|
||||
Jenkins initialization, monitoring and other work; the 30-second scrape cadence
|
||||
and one-minute rate smooth the 19.8-second build. The dashboard uses five-minute
|
||||
CPU smoothing. Available RAM fell slightly during the build and rose afterward,
|
||||
which is correlation rather than proof of per-container allocation.
|
||||
The Windows LaTeX workflow executes off-droplet, so its build load is not
|
||||
measured by these host metrics.
|
||||
|
||||
\section{SLI, SLO, and Error Budget}
|
||||
An \gls{sli} is a measured indicator; here it is successful HTTPS observations
|
||||
divided by received observations for a named service and window. The
|
||||
\gls{slo} is an internal target of at least 99\% success over 24 hours. An
|
||||
\gls{sla} is a customer agreement that may attach consequences; this lab
|
||||
establishes no customer SLA.
|
||||
|
||||
\subsection{Availability Indicator}
|
||||
\subsection{Required hypothetical example}
|
||||
These figures are illustrative, not measured lab results. At 30 seconds,
|
||||
24 hours schedules $24\times60\times2=2880$ probes per service.
|
||||
Gitea's $2880/2880=100\%$ meets the target. Jenkins's
|
||||
$2850/2880\times100=98.9583\%$ misses it, with 30 failures.
|
||||
The theoretical budget is $0.01\times2880=28.8$ failures or
|
||||
$28.8\times30/60=14.4$ minutes. At most 28 whole failed samples meet 99\%.
|
||||
Thirty failures exceed the budget by 1.2 samples, approximately 0.6 minutes.
|
||||
|
||||
The service level indicator (SLI) is the fraction of
|
||||
successful observed HTTPS probes:
|
||||
\subsection{Measured short exercise window}
|
||||
The actual interval is (20:35:00,20:45:00] UTC on October 30, evaluated at
|
||||
20:45:00 with a 30-second scrape interval. Queries were
|
||||
\texttt{avg\_over\_time}, \texttt{count\_over\_time} and
|
||||
\texttt{sum\_over\_time} of \texttt{probe\_success\{job="https"\}[10m]}.
|
||||
Multiply the average by 100 for percent.
|
||||
\begin{center}\begin{tabular}{lrrrr}\toprule
|
||||
Service & Received / expected & Successes & Failures & Percent\\\midrule
|
||||
Gitea & 20 / 20 & 20 & 0 & 100\%\\
|
||||
Jenkins & 20 / 20 & 13 & 7 & 65\%\\\bottomrule
|
||||
\end{tabular}\end{center}
|
||||
Both have 100\% sample coverage in this short window. The services have
|
||||
different scrape phases, so timestamps differ; no samples were missing in
|
||||
this interval. Seven failed Jenkins samples correspond to approximately
|
||||
3.5 minutes under uniform sampling. Actual endpoints transitioned between
|
||||
scrapes, so sample counts do not provide continuous-time precision. Missing
|
||||
observations in another window would be unknown, not successes. This exercise
|
||||
does not establish whether the full 24-hour SLO was met.
|
||||
|
||||
\begin{equation}
|
||||
\mathrm{SLI} =
|
||||
\frac{\text{Successful observed probes}}
|
||||
{\text{Total observed probes}}.
|
||||
\end{equation}
|
||||
\section{Alerts and Runbooks}
|
||||
Both Grafana-managed rules have owner \texttt{sespinal}, a 30-second evaluation
|
||||
interval, summaries and links to \path{monitoring/ALERTING-RUNBOOK.md}.
|
||||
Service unavailability uses \texttt{probe\_success\{job="https"\}<1}, pending
|
||||
one minute, severity critical, retaining instance labels. Disk uses the same
|
||||
verified root percentage as the dashboard, below 15\% for five minutes,
|
||||
severity warning. Fifteen percent provides a response margin on this small disk.
|
||||
No-data state is \texttt{NoData}; evaluation errors are \texttt{Error}, rather
|
||||
than healthy. Grafana creates separate data-source alerts for these conditions
|
||||
\cite{GrafanaNoData}. The service expression additionally uses a zero-valued fallback from the
|
||||
matching target \texttt{up} series when its probe series disappears:
|
||||
\texttt{or on(instance,job) (0 * up\{job="https"\})}. Thus a failed
|
||||
collection does not silently become a successful probe. Removing a target
|
||||
from configuration still requires source review; it is not an availability fix.
|
||||
|
||||
The laboratory service level objective (SLO) is
|
||||
99\% availability over a 24-hour observation window.
|
||||
\begin{figure}[htbp]\centering
|
||||
\includegraphics[width=\linewidth]{evidence/chapter5/alerts-recovered.png}
|
||||
\caption{Actual Grafana group showing both provisioned rules normal after the
|
||||
tests, October 30, 2026. The rule-state JSON records retain firing transitions.}
|
||||
\label{Figure:SREAlerts}\end{figure}
|
||||
Both route through the dedicated Discord integration in contact point
|
||||
\texttt{team-alerts}. Policy groups by folder and alert name, waits 10 seconds,
|
||||
uses a 30-second group interval and four-hour repeat interval. Resolved messages
|
||||
are enabled. The webhook is stored only in server-local provisioning. The
|
||||
contact test succeeded, and Sergio confirmed its receipt, then confirmed
|
||||
receipt of both real firing and both resolved notifications.
|
||||
Exact Discord receipt/acknowledgement timestamps were not retained; do not
|
||||
substitute Grafana evaluation times for receiver times.
|
||||
|
||||
At a 30-second sampling interval, the scheduled number
|
||||
of samples is:
|
||||
For HTTPS failures, inspect the instance, \texttt{up}, Blackbox diagnostics,
|
||||
TLS, Caddy and application state. Keep TLS verification and the Jenkins
|
||||
allowlist intact; restart only the affected service and verify probe recovery
|
||||
and CI. For disk, inspect \texttt{df}, Docker images and volume/log growth;
|
||||
remove only verified disposable material after review. Preserve application
|
||||
and monitoring volumes. Recheck the filesystem and resolved state.
|
||||
|
||||
\begin{equation}
|
||||
N = 24 \times 60 \times 2 = 2880.
|
||||
\end{equation}
|
||||
The disk test changed only its threshold from 15 to 30\% at 20:37:26.770 UTC.
|
||||
It reached firing by observation 20:42:57.308, after five minutes pending.
|
||||
The script's \texttt{finally} block restored 15\% at 20:43:27.486; it was
|
||||
inactive by 20:43:57.520. No disk-filling workload was used.
|
||||
|
||||
The permitted error budget is:
|
||||
\section{Incident and Recovery}
|
||||
\subsection{Controlled Jenkins incident and measurements}
|
||||
The exercise stopped only Jenkins, retaining all volumes and the recovery
|
||||
command. A 210-second systemd safety timer was installed before stopping it;
|
||||
the primary script restarted it after approximately three minutes. Gitea,
|
||||
Caddy and the four monitoring containers remained available during the outage.
|
||||
All times below are October 30, 2026 UTC.
|
||||
\begin{tabularx}{\linewidth}{L{3.6cm}Y}
|
||||
\caption{Observed incident timeline\label{Table:SRETimeline}}\\
|
||||
\toprule Time & Event and evidence\\\midrule
|
||||
20:38:45.484 & Jenkins stop requested; stopped at 20:38:46.995.\\
|
||||
20:39:09.110 & First recorded failed Jenkins probe; previous success 20:38:39.110.\\
|
||||
20:40:30 evaluation & HTTPS alert firing, observed by polling at 20:40:57.\\
|
||||
20:41:47.511 & Restart requested; container started 20:41:47.945.\\
|
||||
20:42:09.110 & Probe still failed while Jenkins initialized.\\
|
||||
20:42:39.110 & First successful post-outage probe.\\
|
||||
20:43:27.344 or earlier & Rule observed inactive; subsequent evaluations stayed normal.\\
|
||||
20:43:32.534--52.340 & Recovery pipeline build 3 SUCCESS.\\
|
||||
\bottomrule\end{tabularx}
|
||||
Stop request to first failed sample was 23.626 seconds. First failure to the
|
||||
20:40:30 firing evaluation was 80.890 seconds, consistent with scrape phase,
|
||||
30-second evaluation and one-minute pending. Stop request to first recovered
|
||||
sample was 233.626 seconds; restart request to that sample was 51.599 seconds.
|
||||
Seven failed probes bound the observed failure period. Discord firing and
|
||||
resolved receipt were confirmed by Sergio, but precise delivery/acknowledgement
|
||||
latencies cannot be calculated from the retained record.
|
||||
|
||||
\begin{equation}
|
||||
B = 2880 \times (1 - 0.99) = 28.8.
|
||||
\end{equation}
|
||||
\subsection{Persistence and integration checks}
|
||||
Prometheus and Grafana were restarted separately without volume deletion.
|
||||
A historical instant query at 20:40:00 returned Jenkins 0 and Gitea 1 both
|
||||
before and after the Prometheus restart. Grafana's health returned database OK;
|
||||
dashboard UID \texttt{sre-overview}, both rules (1m/5m) and the Discord contact
|
||||
point remained. Collection can pause during restarts; the complete 10-minute
|
||||
SLI window above predates them. This test demonstrates persistence, not backup
|
||||
restoration. Raw sanitized records are under \texttt{evidence/chapter5/}.
|
||||
|
||||
Because probe failures are counted in whole samples,
|
||||
the maximum permitted number of failed samples is 28.
|
||||
Gitea Actions manual-pdf run 16 (displayed build 12), source
|
||||
\path{2fc6e8909034bd615fd5f3caffd71f0ef386d18f}, passed in 44 seconds
|
||||
before final documentation changes:
|
||||
\url{https://git.sespinal590.dev/group10-startup/devops-it-manual/actions/runs/16}.
|
||||
The final automated artifact carries build \WorkflowRunNumber{} and source
|
||||
\href{https://git.sespinal590.dev/group10-startup/devops-it-manual/commit/\SourceRevision}{\SourceRevision{}} in its generated metadata.
|
||||
Its workflow record is available from
|
||||
\href{https://git.sespinal590.dev/group10-startup/devops-it-manual/actions}{the repository Actions page}.
|
||||
Human approval of this source revision is still required. Chapter 4's test/build failure
|
||||
is different: code can fail a pipeline while Jenkins remains available.
|
||||
Here the CI server itself was unavailable, so jobs could not execute during
|
||||
that interval. Retained Chapter 4 records link
|
||||
\href{https://ci.165.227.90.215.sslip.io/job/startup-product-ci/job/PR-9/1/}{failed PR-9 build 1}
|
||||
(commit \path{35605c33b903742cd13d444a1a14d61b07fbaa86}) and
|
||||
\href{https://ci.165.227.90.215.sslip.io/job/startup-product-ci/job/PR-9/2/}{repaired build 2}
|
||||
(commit \path{ed8684a2897c407946320183e572f6412dbb7703}, SUCCESS).
|
||||
Those historical records do not establish current peer-review status.
|
||||
The recovery build published a fresh success status to Gitea at 20:43:52 UTC,
|
||||
context \path{startup-product-ci/pipeline/head}, target build 3, matching
|
||||
commit \path{6cfac4ec1e6d56dbb0b1a66bd59775b9db6ed065}.
|
||||
The repository has no configured webhook; the retained polling fallback is
|
||||
distinct from webhook delivery. This manual run verifies execution and status
|
||||
publication, not an automatic new-commit trigger.
|
||||
|
||||
The equivalent theoretical failure allowance is
|
||||
14.4 minutes, while 28 complete failed samples
|
||||
represent 14 minutes.
|
||||
|
||||
\subsection{Mandatory Hypothetical Example}
|
||||
|
||||
The following results are hypothetical and do not
|
||||
represent measured deployment availability.
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{lrrrr}
|
||||
\toprule
|
||||
Service & Successful & Scheduled & Availability & Result \\
|
||||
\midrule
|
||||
Gitea & 2880 & 2880 & 100.00\% & PASS \\
|
||||
Jenkins & 2850 & 2880 & 98.96\% & FAIL \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Jenkins has 30 hypothetical failed samples and
|
||||
therefore exceeds the permitted error budget.
|
||||
|
||||
\subsection{Actual Observation Procedure}
|
||||
|
||||
After deployment, calculate observed availability
|
||||
using \texttt{avg\_over\_time} applied to
|
||||
\texttt{probe\_success}.
|
||||
|
||||
Use \texttt{count\_over\_time} to determine how many
|
||||
samples were actually collected.
|
||||
|
||||
Missing samples must not automatically be counted
|
||||
as successful probes.
|
||||
|
||||
If a complete 24-hour window is unavailable, clearly
|
||||
label the shorter observation window and report its
|
||||
actual sample count.
|
||||
|
||||
Detailed PromQL queries and calculation instructions
|
||||
are maintained in \texttt{monitoring/SLI-SLO.md}.
|
||||
|
||||
\textbf{Evidence pending:} Actual observed sample counts,
|
||||
availability values, and outage-window calculations.
|
||||
|
||||
\section{Grafana Alerts and Runbooks}
|
||||
|
||||
\subsection{HTTPS Service Unavailable}
|
||||
|
||||
The first Grafana-managed alert monitors
|
||||
\texttt{probe\_success} for each HTTPS target.
|
||||
|
||||
The intended condition is a probe result below 1
|
||||
for at least one continuous minute.
|
||||
|
||||
Each service must be distinguishable using its
|
||||
Prometheus instance label.
|
||||
|
||||
\subsection{Host Root Disk Space Low}
|
||||
|
||||
The second Grafana-managed alert monitors the
|
||||
percentage of available root filesystem space.
|
||||
|
||||
The intended condition is less than 15\%
|
||||
available space for five continuous minutes.
|
||||
|
||||
\subsection{Notification Configuration}
|
||||
|
||||
The team must configure an approved Grafana
|
||||
notification contact point and verify that an
|
||||
actual notification is received.
|
||||
|
||||
The contact point must not expose passwords,
|
||||
API keys, or private credentials in the repository.
|
||||
|
||||
\subsection{Safe Alert Demonstration}
|
||||
|
||||
The disk alert must be tested without deliberately
|
||||
filling the Droplet filesystem.
|
||||
|
||||
The approved demonstration procedure temporarily
|
||||
raises the alert threshold above the current
|
||||
available disk percentage, waits for the pending
|
||||
period, records the alert firing, and then restores
|
||||
the required 15\% threshold.
|
||||
|
||||
The full alert configuration and operational
|
||||
procedures are documented in
|
||||
\texttt{monitoring/ALERTING-RUNBOOK.md}.
|
||||
|
||||
\textbf{Evidence pending:} Loaded Grafana alert rules,
|
||||
contact point, firing notifications, and resolutions.
|
||||
|
||||
\section{Controlled Incident and Recovery}
|
||||
|
||||
\subsection{Jenkins-Only Outage}
|
||||
|
||||
The team must coordinate an approved controlled
|
||||
Jenkins-only outage lasting approximately three minutes.
|
||||
|
||||
Gitea, Caddy, Prometheus, and Grafana must remain
|
||||
operational during the experiment.
|
||||
|
||||
The operator must record the exact UTC timestamps
|
||||
for the outage, first failed probe, alert firing,
|
||||
notification receipt, application restart, first
|
||||
successful probe, and alert resolution.
|
||||
|
||||
\subsection{Recovery Verification}
|
||||
|
||||
After restarting Jenkins, the team must verify:
|
||||
|
||||
\begin{enumerate}
|
||||
\item The Jenkins login endpoint is available.
|
||||
\item The HTTPS probe returns a successful result.
|
||||
\item The Grafana alert resolves.
|
||||
\item Gitea remained available during the outage.
|
||||
\item The Jenkins pipeline executes successfully.
|
||||
\item The Gitea Actions PDF workflow executes successfully.
|
||||
\end{enumerate}
|
||||
|
||||
\subsection{Monitoring Persistence}
|
||||
|
||||
Prometheus and Grafana must be restarted separately.
|
||||
|
||||
Prometheus must retain historical metrics.
|
||||
|
||||
Grafana must retain the provisioned dashboard,
|
||||
data source, alert rules, and notification configuration.
|
||||
|
||||
The team must not delete persistent Docker volumes
|
||||
during these tests.
|
||||
|
||||
\subsection{Blameless Incident Review}
|
||||
|
||||
The final incident review must document actual
|
||||
impact, detection, notification, recovery,
|
||||
contributing factors, and preventive improvements.
|
||||
|
||||
At least two follow-up Gitea issues must be created,
|
||||
with assigned owners and acceptance criteria.
|
||||
|
||||
\textbf{Evidence pending:} UTC incident timeline,
|
||||
outage graphs, notifications, restart tests,
|
||||
CI verification, and follow-up issue references.
|
||||
|
||||
\section{Traceability and Submission Evidence}
|
||||
|
||||
\subsection{Repository Artifacts}
|
||||
|
||||
The Chapter 5 preparation is organized under
|
||||
the \texttt{monitoring/} directory.
|
||||
|
||||
Key artifacts include:
|
||||
\subsection{Blameless review and owned improvements}
|
||||
The intended maintenance injection caused the incident. Jenkins initialization
|
||||
extended user-visible unavailability beyond the stopped-container interval.
|
||||
Detection worked; Gitea remained successful throughout the measured window;
|
||||
Jenkins recovered and a normal build passed. No person is blamed for the
|
||||
capacity issue: the original disk budget was too small for the default image
|
||||
and optional plugins, and the slim deployment restored a workable margin.
|
||||
|
||||
The current setup shares the failure domain it monitors. It also relies on
|
||||
Caddy's dynamic private IP, and precise receiver acknowledgement timestamps
|
||||
were not captured. The following owned issues track improvements:
|
||||
\begin{itemize}
|
||||
\item \texttt{ARCHITECTURE.md}
|
||||
\item \texttt{compose.yaml}
|
||||
\item \texttt{prometheus/prometheus.yml}
|
||||
\item \texttt{blackbox/blackbox.yml}
|
||||
\item \texttt{grafana/provisioning/}
|
||||
\item \texttt{grafana/dashboards/sre-overview.json}
|
||||
\item \texttt{SLI-SLO.md}
|
||||
\item \texttt{ALERTING-RUNBOOK.md}
|
||||
\item \href{https://git.sespinal590.dev/group10-startup/devops-it-manual/issues/2}{Issue 2},
|
||||
P1, Sergio (\texttt{sespinal}): add an independent external TLS availability
|
||||
check; verify notification and recovery without exposing private ports.
|
||||
\item \href{https://git.sespinal590.dev/group10-startup/devops-it-manual/issues/3}{Issue 3},
|
||||
P2, Turan (\texttt{turanisl}): remove fragile proxy-address dependence and
|
||||
verify coordinated rebuilds, private access, TLS and rollback.
|
||||
\end{itemize}
|
||||
|
||||
These files provide the intended deployment
|
||||
configuration and reproducibility documentation.
|
||||
\section{Manual Integration and Traceability}
|
||||
Source and prepared configuration are retained on the feature branch.
|
||||
The workflow indentation and master include typo were repaired first.
|
||||
The final PDF includes the source revision from workflow build metadata.
|
||||
Use that revision to inspect the exact source, rather than relying only on a
|
||||
moving branch link. The updated history, service/secret-hints table, glossary,
|
||||
references and AI log accompany this chapter.
|
||||
|
||||
They do not independently prove that the
|
||||
monitoring services were deployed successfully.
|
||||
|
||||
\subsection{Final Evidence Checklist}
|
||||
|
||||
Before submission, the team must provide:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Validated monitoring Compose configuration.
|
||||
\item Running monitoring containers and selected image versions.
|
||||
\item Prometheus targets and actual metric values.
|
||||
\item Grafana authenticated HTTPS login.
|
||||
\item Six-panel dashboard with real data.
|
||||
\item Gitea and Jenkins HTTPS probe results.
|
||||
\item Actual SLI observations and SLO calculations.
|
||||
\item Two configured and tested Grafana alerts.
|
||||
\item Notification delivery and resolution evidence.
|
||||
\item Controlled Jenkins outage and UTC timeline.
|
||||
\item Prometheus and Grafana persistence tests.
|
||||
\item Jenkins pipeline and Gitea Actions verification.
|
||||
\item Blameless incident review.
|
||||
\item Two assigned follow-up Gitea issues.
|
||||
\item Successfully generated final PDF manual artifact.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{devopsNote}[Final Submission Requirement]
|
||||
The final Chapter 5 report must replace all pending evidence
|
||||
statements with verified results or explicitly document
|
||||
unresolved limitations. The team must not present planned
|
||||
configuration as successful deployment.
|
||||
\end{devopsNote}
|
||||
\begin{devopsNote}[Review boundary]
|
||||
Deployment, rule evaluation, notification receipt, controlled recovery and
|
||||
persistence have measured evidence. Human peer review and main merge remain
|
||||
outstanding; main merge is explicitly deferred by Sergio. Receiver timestamps,
|
||||
automatic new-commit trigger validation, and precise restart collection-gap
|
||||
measurement remain
|
||||
limitations. A successful PDF build does not close those gaps.
|
||||
\end{devopsNote}
|
||||
|
||||
Reference in New Issue
Block a user