Add Prometheus/Grafana monitoring and SRE manual chapter (Assignment 7) #22

Merged
bill merged 5 commits from feature/issue-19-monitoring into main 2026-10-28 18:18:36 +00:00
13 changed files with 422 additions and 99 deletions
Showing only changes of commit 249488d6fc - Show all commits
+5 -4
View File
@@ -5,8 +5,9 @@ run as four pinned containers beside Gitea and Jenkins on the 1\,GiB
DigitalOcean droplet, with Grafana at \url{https://metrics.yebilly.me/login} DigitalOcean droplet, with Grafana at \url{https://metrics.yebilly.me/login}
for approved networks only. A dashboard shows host CPU, memory, and disk and for approved networks only. A dashboard shows host CPU, memory, and disk and
the HTTPS availability of Gitea and Jenkins. A 99\% availability objective is the HTTPS availability of Gitea and Jenkins. A 99\% availability objective is
defined and measured, and two alert rules notify the team's Discord channel. defined and measured, and three alert rules (service availability, disk
Both rules were shown firing and resolving, the second through a planned space, and collection health) notify the team's Discord channel. Each was
Jenkins outage that was detected in about two minutes and recovered about a shown firing and resolving; the availability rule through a planned Jenkins
minute after restart. Earlier chapters retain the group's prior assignment outage that was detected in about two minutes and recovered about a minute
after restart. Earlier chapters retain the group's prior assignment
results, including the Jenkins merge gate and the Gitea Actions manual build. results, including the Jenkins merge gate and the Gitea Actions manual build.
+13 -2
View File
@@ -719,8 +719,19 @@ authentication, so Billy pushed and re-authorized Git Credential Manager.
Billy's questions about the CPU readings led to the I/O-wait finding and the Billy's questions about the CPU readings led to the I/O-wait finding and the
dashboard change. dashboard change.
Outputs used: commits \texttt{d3a5e6b} and \texttt{b6cf080} and the chapter Review and corrections: at Billy's request, Claude had an independent
commit on \texttt{feature/issue-19-monitoring}; subagent audit the chapter against the instructor's requirements. Claude
checked its findings against the evidence (two of its ``unsupported''
claims were supported by earlier output and a figure) and, with Billy's
approval, added a collection-health rule and tested it by stopping Blackbox
Exporter, ran Blackbox Exporter as non-root, compared CPU counters with
\texttt{/proc/stat}, and corrected four figures and the overstated
no-data claim. Billy replaced the Grafana administrator password himself;
Claude confirmed the old value was rejected and removed it from the
secrets file without printing it.
Outputs used: commits \texttt{d3a5e6b} and \texttt{b6cf080}, the chapter
commits on \texttt{feature/issue-19-monitoring} (PR \#22);
\texttt{monitoring/EVIDENCE.md}; \ChapterRef{SREMonitoring}; this record. \texttt{monitoring/EVIDENCE.md}; \ChapterRef{SREMonitoring}; this record.
Assumptions and unresolved items: the title-page assignment title comes Assumptions and unresolved items: the title-page assignment title comes
from the Canvas page Billy showed (``\#7 Grafana and Promethous SRE -- from the Canvas page Billy showed (``\#7 Grafana and Promethous SRE --
+2 -2
View File
@@ -151,8 +151,8 @@
\include{devopsHostsPasswords} \include{devopsHostsPasswords}
% Restore when a chapter cites devopsReferences.bib. % Restore when a chapter cites devopsReferences.bib.
%\bibliographystyle{IEEEtran} \bibliographystyle{IEEEtran}
%\bibliography{devopsReferences} \bibliography{devopsReferences}
\appendix \appendix
\include{devopsDocumentGuide} \include{devopsDocumentGuide}
+1 -1
View File
@@ -12,7 +12,7 @@ link each entry to the changed chapter, table, figure, or controlled artifact.
\multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\ \multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\
\toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule \toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule
\endhead \bottomrule \endlastfoot \endhead \bottomrule \endlastfoot
October 28, 2026 / 5.0 & BY, CD & Assignment 7: added \ChapterRef{SREMonitoring}. Deployed Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter on The-Ocean (pinned by digest, memory-capped, no host ports) after a capacity trial on the 1\,GiB plan; disabled four unused host services and added a second swap file; added \texttt{metrics.yebilly.me} behind the Jenkins allowlist and a private probe network. Recorded the dashboard, normal-build comparison, SLI/SLO worked example and measured window, contact-point, capacity-alert and Jenkins-outage tests with Discord notifications, restart persistence, blameless review, and improvement issues \#20 and \#21. \textbf{Updated the Hosts table} (monitoring containers, ports, volumes, \texttt{metrics} DNS, swap, monitoring and backup status) and \textbf{the Passwords table} (Grafana administrator, monitoring secrets file, Discord webhook). Set the Assignment 7 title page and abstract; added glossary terms. & Title and abstract, \ChapterRef{SREMonitoring}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\ October 28, 2026 / 5.0 & BY, CD & Assignment 7: added \ChapterRef{SREMonitoring}. Deployed Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter on The-Ocean (pinned by digest, memory-capped, no host ports) after a capacity trial on the 1\,GiB plan; disabled four unused host services and added a second swap file; added \texttt{metrics.yebilly.me} behind the Jenkins allowlist and a private probe network. Recorded the dashboard, normal-build comparison, SLI/SLO worked example and measured window, contact-point, capacity-alert, collection-health, and Jenkins-outage tests with Discord notifications, restart persistence, blameless review, and improvement issues \#20 and \#21. After an independent review of the draft: added the collection-health rule and its test, replaced the initial Grafana administrator password, ran Blackbox Exporter as non-root, and added runbooks, network and storage detail in the diagram, host CPU checks, a targets table, citations with a Bibliography, and four corrected figures. \textbf{Updated the Hosts table} (monitoring containers, ports, volumes, \texttt{metrics} DNS, swap, monitoring and backup status) and \textbf{the Passwords table} (Grafana accounts, monitoring secrets file, Discord webhook). Set the Assignment 7 title page and abstract; added glossary terms. & Title and abstract, \ChapterRef{SREMonitoring}, \ChapterRef{HostsPasswords}, \ChapterRef{AIPromptLog}\\
October 23, 2026 / 4.2 & VS, CDX & Corrected the Jenkins lockfile link to the recorded 63-plugin revision; clarified clean reproduction, Jenkins revision selection, and the unconfirmed webhook-timeout cause. Scoped the existing update-check result to the 63 checked plugins. Theme plugins are unchanged at Vincent's direction. Hosts and Passwords tables are unchanged because no service, account, or credential changed. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\ October 23, 2026 / 4.2 & VS, CDX & Corrected the Jenkins lockfile link to the recorded 63-plugin revision; clarified clean reproduction, Jenkins revision selection, and the unconfirmed webhook-timeout cause. Scoped the existing update-check result to the 63 checked plugins. Theme plugins are unchanged at Vincent's direction. Hosts and Passwords tables are unchanged because no service, account, or credential changed. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\
October 23, 2026 / 4.1 & BY, CD & Corrected the Jenkins instructor access path to the Stevens campus network, with off-campus graders' addresses added on request; recorded the GlobalProtect test showing the Stevens VPN is split-tunnel and therefore not an access path, and Vincent's passing campus test on \texttt{Stevens-Net}; added the real webhook delivery table and diagnosis of one timed-out delivery, UML stereotypes on the deployment diagram, the stored Jenkins URL, free disk space, reconciled plugin counts, and corrected wording on push rights, resource limits, and corrective actions. Shortened AI initials in this table (CDX for Codex, CD for Claude). Hosts and Passwords tables are unchanged. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\ October 23, 2026 / 4.1 & BY, CD & Corrected the Jenkins instructor access path to the Stevens campus network, with off-campus graders' addresses added on request; recorded the GlobalProtect test showing the Stevens VPN is split-tunnel and therefore not an access path, and Vincent's passing campus test on \texttt{Stevens-Net}; added the real webhook delivery table and diagnosis of one timed-out delivery, UML stereotypes on the deployment diagram, the stored Jenkins URL, free disk space, reconciled plugin counts, and corrected wording on push rights, resource limits, and corrective actions. Shortened AI initials in this table (CDX for Codex, CD for Claude). Hosts and Passwords tables are unchanged. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\
October 22--23, 2026 / 4.0 & BY, VS, CD & Assignment 6: ran the guarded Jenkins capacity test on the resized 1\,GiB droplet; deployed Jenkins 2.580.1 LTS with a hashed plugin lockfile behind Caddy at \texttt{ci.yebilly.me} (Stevens and team allowlist); integrated Gitea via a private webhook and the \texttt{jenkins-bot} identity; required check \texttt{vpn-dns-gateway/pipeline/pr-main} on \texttt{main}; recorded PR~\#15's pass, blocked failure, repair, review, and merge, the restart-persistence and IPv4/IPv6 exposure tests, and the plugin-update check. \textbf{Updated the Hosts table} (resize, Jenkins, \texttt{ci} DNS, Color Buttons retired) and \textbf{the Passwords table} (Jenkins administrators, \texttt{jenkins-bot} account and token, CI allowlist file). Added glossary terms, set the Assignment 6 title page and abstract, and noted the completed Assignment 5 merge. & Title and abstract, \ChapterRef{JenkinsCI}, \ChapterRef{HostsPasswords}, \ChapterRef{AutomatedManualBuild}, \ChapterRef{AIPromptLog}\\ October 22--23, 2026 / 4.0 & BY, VS, CD & Assignment 6: ran the guarded Jenkins capacity test on the resized 1\,GiB droplet; deployed Jenkins 2.580.1 LTS with a hashed plugin lockfile behind Caddy at \texttt{ci.yebilly.me} (Stevens and team allowlist); integrated Gitea via a private webhook and the \texttt{jenkins-bot} identity; required check \texttt{vpn-dns-gateway/pipeline/pr-main} on \texttt{main}; recorded PR~\#15's pass, blocked failure, repair, review, and merge, the restart-persistence and IPv4/IPv6 exposure tests, and the plugin-update check. \textbf{Updated the Hosts table} (resize, Jenkins, \texttt{ci} DNS, Color Buttons retired) and \textbf{the Passwords table} (Jenkins administrators, \texttt{jenkins-bot} account and token, CI allowlist file). Added glossary terms, set the Assignment 6 title page and abstract, and noted the completed Assignment 5 merge. & Title and abstract, \ChapterRef{JenkinsCI}, \ChapterRef{HostsPasswords}, \ChapterRef{AutomatedManualBuild}, \ChapterRef{AIPromptLog}\\
+4 -4
View File
@@ -49,7 +49,7 @@ no host ports; SQLite file in volume \texttt{gitea\_gitea-data}; Jenkins state
in volume \texttt{gitea\_jenkins-home}. Monitoring (Compose project in volume \texttt{gitea\_jenkins-home}. Monitoring (Compose project
\texttt{monitoring}, no host ports): Prometheus \texttt{:9090} (128\,MiB), \texttt{monitoring}, no host ports): Prometheus \texttt{:9090} (128\,MiB),
Node Exporter \texttt{:9100} and Blackbox Exporter \texttt{:9115} (32\,MiB Node Exporter \texttt{:9100} and Blackbox Exporter \texttt{:9115} (32\,MiB
each) on network \texttt{monitoring\_monitoring}; Grafana \texttt{:3000} each; Blackbox runs as \texttt{nobody}) on network \texttt{monitoring\_monitoring}; Grafana \texttt{:3000}
(192\,MiB) also on \texttt{gitea\_web}; Blackbox at \texttt{172.30.90.10} on (192\,MiB) also on \texttt{gitea\_web}; Blackbox at \texttt{172.30.90.10} on
\texttt{gitea\_probe} (172.30.90.0/28); volumes \texttt{gitea\_probe} (172.30.90.0/28); volumes
\texttt{monitoring\_prometheus\_data} (7\,d / 500\,MB) and \texttt{monitoring\_prometheus\_data} (7\,d / 500\,MB) and
@@ -69,7 +69,7 @@ Gitea (\ChapterRef{GiteaFoundation}), restart persistence for Jenkins
\texttt{monitoring/README.md}\\ \texttt{monitoring/README.md}\\
Monitoring status & Prometheus and Grafana: host CPU, memory, root disk, and Monitoring status & Prometheus and Grafana: host CPU, memory, root disk, and
HTTPS probes of Gitea and Jenkins every 30\,s; alerts \emph{HTTPS service HTTPS probes of Gitea and Jenkins every 30\,s; alerts \emph{HTTPS service
down} and \emph{Root disk space low} to Discord \texttt{\#devops-alerts}. down}, \emph{Root disk space low}, and \emph{Monitoring target down} to Discord \texttt{\#devops-alerts}.
Shares the droplet's failure domain; no external check yet (issue~\#20)\\ Shares the droplet's failure domain; no external check yet (issue~\#20)\\
\end{tabularx} \end{tabularx}
\normalsize \normalsize
@@ -111,9 +111,9 @@ Gitea \texttt{jenkins-bot} (added 22 Oct 2026) & BY & BY's password manager; use
Jenkins \texttt{billy} & BY & BY's password manager & Administer (all)\\ Jenkins \texttt{billy} & BY & BY's password manager & Administer (all)\\
Jenkins \texttt{vsun1} & VS & VS's password manager & Administer (all)\\ Jenkins \texttt{vsun1} & VS & VS's password manager & Administer (all)\\
Jenkins initial admin password & --- & One-time setup secret in \texttt{/var/jenkins\_home/secrets/}; read once by BY, superseded by named accounts & Setup only\\ Jenkins initial admin password & --- & One-time setup secret in \texttt{/var/jenkins\_home/secrets/}; read once by BY, superseded by named accounts & Setup only\\
Grafana \texttt{billy} (added 28 Oct 2026) & BY & BY's password manager; initial value in the monitoring secrets file, used only when Grafana first created its database & Grafana Admin\\ Grafana \texttt{billy} (added 28 Oct 2026) & BY & BY's password manager; the initial value set through the monitoring secrets file was replaced in Grafana on 28 Oct 2026 and removed from the file & Grafana Admin\\
Grafana \texttt{vsun1} (added 28 Oct 2026) & VS & VS's password manager; temporary password set by BY and sent privately, to be changed by VS at first login & Viewer\\ Grafana \texttt{vsun1} (added 28 Oct 2026) & VS & VS's password manager; temporary password set by BY and sent privately, to be changed by VS at first login & Viewer\\
Monitoring secrets \texttt{.env.secret} & BY & \texttt{\textasciitilde/monitoring/.env.secret} on the droplet, mode 600, root; typed by BY; holds the initial Grafana admin password and the Discord webhook URL; never in Git & n/a\\ Monitoring secrets \texttt{.env.secret} & BY & \texttt{\textasciitilde/monitoring/.env.secret} on the droplet, mode 600, root; typed by BY; holds the Discord webhook URL (the initial Grafana admin password was removed after it was replaced); never in Git & n/a\\
Discord webhook \texttt{Grafana} & BY & BY's password manager and the monitoring secrets file; revoke under \texttt{\#devops-alerts} $\rightarrow$ Integrations $\rightarrow$ Webhooks & Post to \texttt{\#devops-alerts}\\ Discord webhook \texttt{Grafana} & BY & BY's password manager and the monitoring secrets file; revoke under \texttt{\#devops-alerts} $\rightarrow$ Integrations $\rightarrow$ Webhooks & Post to \texttt{\#devops-alerts}\\
CI allowlist \texttt{.env} & BY & \texttt{\textasciitilde/gitea/.env} on the droplet, root-only; holds team and approved grader IP addresses (personal data, not a secret); grader entries are removed after grading & n/a\\ CI allowlist \texttt{.env} & BY & \texttt{\textasciitilde/gitea/.env} on the droplet, root-only; holds team and approved grader IP addresses (personal data, not a secret); grader entries are removed after grading & n/a\\
DigitalOcean team & BY, VS & Each member's own login, in their password manager & Team member\\ DigitalOcean team & BY, VS & Each member's own login, in their password manager & Team member\\
+43
View File
@@ -4,3 +4,46 @@
publisher = {IT Revolution Press}, publisher = {IT Revolution Press},
year = {2018} year = {2018}
} }
@book{SREWorkbook,
author = {Beyer, Betsy and Murphy, Niall Richard and Rensin, David K. and Kawahara, Kent and Thorne, Stephen},
title = {The Site Reliability Workbook: Practical Ways to Implement {SRE}},
publisher = {O'Reilly Media},
year = {2018},
note = {Chapter 2, ``Implementing SLOs,'' \url{https://sre.google/workbook/implementing-slos/}, accessed Oct. 28, 2026}
}
@misc{PrometheusDocs,
author = {{Prometheus Authors}},
title = {Prometheus Documentation: Configuration, Storage, and Querying},
howpublished = {\url{https://prometheus.io/docs/prometheus/latest/}},
note = {Version 3.15; accessed Oct. 28, 2026}
}
@misc{NodeExporter,
author = {{Prometheus Authors}},
title = {Node Exporter},
howpublished = {\url{https://github.com/prometheus/node_exporter}},
note = {Release v1.12.1; accessed Oct. 28, 2026}
}
@misc{BlackboxExporter,
author = {{Prometheus Authors}},
title = {Blackbox Exporter},
howpublished = {\url{https://github.com/prometheus/blackbox_exporter}},
note = {Release v0.29.1; accessed Oct. 28, 2026}
}
@misc{GrafanaDocker,
author = {{Grafana Labs}},
title = {Run {Grafana} {Docker} Image},
howpublished = {\url{https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/}},
note = {Grafana OSS 13.2; accessed Oct. 28, 2026}
}
@misc{GrafanaAlerting,
author = {{Grafana Labs}},
title = {Grafana Alerting: Provision Alerting Resources and Configure Contact Points},
howpublished = {\url{https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/file-provisioning/}},
note = {Grafana OSS 13.2; accessed Oct. 28, 2026}
}
+266 -82
View File
@@ -24,15 +24,20 @@ Vincent is the verifier and pull-request reviewer. Times are UTC unless marked
Eastern (EDT, UTC$-$4). Sections~\ref{Section:SREDeployment}--\ref{Section:SREQuality} Eastern (EDT, UTC$-$4). Sections~\ref{Section:SREDeployment}--\ref{Section:SREQuality}
follow the eight rubric rows in order. Raw timestamps for every test are kept follow the eight rubric rows in order. Raw timestamps for every test are kept
in in
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/commit/b6cf08061815acd628bf3caaa90e38c46d57a8e7/monitoring/EVIDENCE.md}{\texttt{monitoring/EVIDENCE.md}}. \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/EVIDENCE.md}{\texttt{monitoring/EVIDENCE.md}};
repository links in this chapter point to \texttt{main}, where
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/pulls/22}{PR~\#22}
merges this work.
\begin{devopsNote}[Result summary] \begin{devopsNote}[Result summary]
The stack fits on the existing 1\,GiB droplet without a resize, with memory The stack fits on the existing 1\,GiB droplet without a resize, with memory
caps and a second swap file. Both HTTPS probes, both alert rules, and the caps and a second swap file. Both HTTPS probes, all three alert rules, and
Discord route were tested for real: a disk-space rule fired and resolved the Discord route were tested for real: a disk-space rule fired and resolved
under a temporarily raised threshold, and a planned 4~min~48~s Jenkins stop under a temporarily raised threshold; a planned 4~min~48~s Jenkins stop fired
fired the availability alert about 2~minutes after injection and resolved the availability alert about 2~minutes after injection and resolved about
about 1.5~minutes after the restart. Gitea stayed available throughout. The 1.5~minutes after the restart; and stopping Blackbox Exporter fired the
collection-health rule and the availability rule's no-data handling. Gitea
stayed available throughout. The
main measured weakness is memory pressure: about 15\% of CPU time is spent main measured weakness is memory pressure: about 15\% of CPU time is spent
waiting on swap (improvement waiting on swap (improvement
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/issues/21}{issue~\#21}). \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/issues/21}{issue~\#21}).
@@ -44,9 +49,10 @@ waiting on swap (improvement
\index{monitoring!deployment} \index{monitoring!deployment}
\paragraph{Baseline and capacity decision.} \paragraph{Baseline and capacity decision.}
At 04:34 on October 28 the droplet ran Ubuntu 24.04.5 LTS on 1 vCPU with At 04:34 on October 28 the droplet ran Ubuntu 24.04.5 LTS (kernel
961\,MiB RAM; 147--229\,MiB was available and 414\,MiB of the 1\,GiB swap 6.8.0-147, Docker Engine 29.8.1, Compose v5.5.1) on 1 vCPU with 961\,MiB RAM;
file was already in use. Jenkins used 325\,MiB, Gitea 98\,MiB, and Caddy 147--219\,MiB was available in two samples 17\,s apart, and 414\,MiB of the
1\,GiB swap file was already in use. Jenkins used 325\,MiB, Gitea 98\,MiB, and Caddy
11\,MiB; the root disk had 18.8\,GB of 24.9\,GB free. The four new 11\,MiB; the root disk had 18.8\,GB of 24.9\,GB free. The four new
containers were expected to need 150--240\,MiB, so the team chose a containers were expected to need 150--240\,MiB, so the team chose a
\emph{capped trial} on the existing plan instead of an immediate resize, with \emph{capped trial} on the existing plan instead of an immediate resize, with
@@ -63,9 +69,9 @@ occurred. The trial therefore became the deployment. Section~\ref{Section:SREDas
shows its cost: frequent swap-in wait. shows its cost: frequent swap-in wait.
\paragraph{Versions and images.} \paragraph{Versions and images.}
All four images come from the projects' own repositories and are pinned by All four images come from the projects' own repositories~\cite{PrometheusDocs,GrafanaDocker,NodeExporter,BlackboxExporter} and are pinned by
tag \emph{and} digest in tag \emph{and} digest in
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/commit/b6cf08061815acd628bf3caaa90e38c46d57a8e7/monitoring/compose.yaml}{\texttt{monitoring/compose.yaml}} \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/compose.yaml}{\texttt{monitoring/compose.yaml}}
(Table~\ref{Table:SREImages}). The instructor suggests a \texttt{.env} file (Table~\ref{Table:SREImages}). The instructor suggests a \texttt{.env} file
for the tags; this repository ignores every \texttt{.env} file to keep for the tags; this repository ignores every \texttt{.env} file to keep
secrets out of Git, so the versions live in the Compose file instead and are secrets out of Git, so the versions live in the Compose file instead and are
@@ -87,7 +93,7 @@ Blackbox Exporter & \nolinkurl{quay.io/prometheus/blackbox-exporter:v0.29.1} & \
\end{table} \end{table}
\paragraph{Retention and storage.} \paragraph{Retention and storage.}
Prometheus keeps 7 days or 500\,MB, whichever limit is reached first Prometheus keeps 7 days or 500\,MB, whichever limit is reached first~\cite{PrometheusDocs}
(\texttt{--storage.tsdb.retention.time=7d}, (\texttt{--storage.tsdb.retention.time=7d},
\texttt{--storage.tsdb.retention.size=500MB}), and its Go runtime aims to \texttt{--storage.tsdb.retention.size=500MB}), and its Go runtime aims to
stay under 96\,MiB (\texttt{GOMEMLIMIT}). With about 15\,GB free after the stay under 96\,MiB (\texttt{GOMEMLIMIT}). With about 15\,GB free after the
@@ -95,6 +101,19 @@ image pulls (Grafana's image alone is 1.95\,GB), this leaves room for the
operating system, Gitea, and builds. Node Exporter runs only the CPU, memory, operating system, Gitea, and builds. Node Exporter runs only the CPU, memory,
filesystem, load, and uname collectors. filesystem, load, and uname collectors.
\paragraph{Identities and mounts.}
Prometheus and Node Exporter run as \texttt{nobody} (UID 65534) and Grafana
as UID 472, the images' defaults. Blackbox Exporter's image runs as root;
because HTTP probes need no privileges, it was changed to
\texttt{user: "65534:65534"} on October 28 at 17:33 and probes kept working.
Prometheus stores its database at \texttt{/prometheus} (volume
\nolinkurl{monitoring_prometheus_data}) and Grafana its database and plugins
at \texttt{/var/lib/grafana} (volume \nolinkurl{monitoring_grafana_data}).
Configuration is bind-mounted read-only:
\texttt{/etc/prometheus/prometheus.yml}, \texttt{/config/blackbox.yml},
\texttt{/etc/grafana/provisioning}, and \texttt{/var/lib/grafana-dashboards};
Node Exporter reads the host at \texttt{/host} (read-only).
\paragraph{Deployment diagram.} \paragraph{Deployment diagram.}
Figure~\ref{Figure:SREDeployment} shows what was built. Prometheus and both Figure~\ref{Figure:SREDeployment} shows what was built. Prometheus and both
exporters sit only on the private \texttt{monitoring} network. Grafana also exporters sit only on the private \texttt{monitoring} network. Grafana also
@@ -115,15 +134,16 @@ address 172.30.90.10 and Caddy answers as \texttt{git.yebilly.me} and
arr/.style={-{Stealth}, thick}] arr/.style={-{Stealth}, thick}]
\node[box] (browser) at (-0.6,0) {\guillemotleft device\guillemotright\\Team / grader\\browser}; \node[box] (browser) at (-0.6,0) {\guillemotleft device\guillemotright\\Team / grader\\browser};
\node[box] (fw) at (3.4,0) {\guillemotleft device\guillemotright\\Cloud Firewall\\\texttt{gitea-fw}, 443 / 80}; \node[box] (fw) at (3.4,0) {\guillemotleft device\guillemotright\\Cloud Firewall\\\texttt{gitea-fw}, 443 / 80};
\node[box] (caddy) at (7.9,0) {\guillemotleft container\guillemotright\\Caddy TLS proxy\\allowlist: \texttt{ci}, \texttt{metrics}}; \node[box] (caddy) at (7.9,0) {\guillemotleft container\guillemotright\\Caddy TLS proxy\\allowlist: \texttt{ci}, \texttt{metrics}\\{\scriptsize net: \textit{web, probe}}};
\node[box] (gitea) at (13.4,2.4) {\guillemotleft container\guillemotright\\Gitea \texttt{:3000}}; \node[box] (gitea) at (13.4,2.4) {\guillemotleft container\guillemotright\\Gitea \texttt{:3000}\\{\scriptsize net: \textit{web}}};
\node[box] (jenkins) at (13.4,0.6) {\guillemotleft container\guillemotright\\Jenkins \texttt{:8080}}; \node[box] (jenkins) at (13.4,0.6) {\guillemotleft container\guillemotright\\Jenkins \texttt{:8080}\\{\scriptsize net: \textit{web}}};
\node[new] (grafana) at (13.4,-1.7) {\guillemotleft container\guillemotright\\Grafana OSS \texttt{:3000}\\dashboard, alert rules}; \node[new] (grafana) at (13.4,-1.7) {\guillemotleft container\guillemotright\\Grafana OSS \texttt{:3000}\\dashboard, alert rules\\{\scriptsize net: \textit{web, mon}}};
\node[new] (prom) at (13.4,-4.7) {\guillemotleft container\guillemotright\\Prometheus \texttt{:9090}\\scrapes every 30\,s}; \node[new] (prom) at (13.4,-4.7) {\guillemotleft container\guillemotright\\Prometheus \texttt{:9090}\\scrapes every 30\,s\\{\scriptsize net: \textit{mon}}};
\node[new] (bbox) at (7.9,-4.7) {\guillemotleft container\guillemotright\\Blackbox Exporter\\\texttt{:9115}, 172.30.90.10}; \node[new] (bbox) at (7.9,-4.7) {\guillemotleft container\guillemotright\\Blackbox Exporter\\\texttt{:9115}, 172.30.90.10\\{\scriptsize net: \textit{mon, probe}}};
\node[new] (node) at (17.8,-4.7) {\guillemotleft container\guillemotright\\Node Exporter\\\texttt{:9100}, host \texttt{/} (ro)}; \node[new] (node) at (17.8,-4.7) {\guillemotleft container\guillemotright\\Node Exporter\\\texttt{:9100}, host \texttt{/} (ro)\\{\scriptsize net: \textit{mon}}};
\node[box] (pvol) at (13.4,-7.2) {\guillemotleft artifact\guillemotright\\\texttt{prometheus\_data}\\7\,d / 500\,MB}; \node[box] (pvol) at (13.4,-7.2) {\guillemotleft artifact\guillemotright\\\texttt{prometheus\_data}\\7\,d / 500\,MB};
\node[box] (gvol) at (17.8,-1.7) {\guillemotleft artifact\guillemotright\\\texttt{grafana\_data}\\users, alert state}; \node[box] (gvol) at (17.8,-1.7) {\guillemotleft artifact\guillemotright\\\texttt{grafana\_data}\\users, alert state};
\node[box] (evol) at (17.8,1.5) {\guillemotleft artifact\guillemotright\\\texttt{gitea-data}, \texttt{jenkins-home},\\\texttt{caddy-data}, \texttt{caddy-config}};
\node[box] (discord) at (3.4,-7.2) {\guillemotleft device\guillemotright\\Discord\\\texttt{\#devops-alerts}}; \node[box] (discord) at (3.4,-7.2) {\guillemotleft device\guillemotright\\Discord\\\texttt{\#devops-alerts}};
\draw[arr] (browser) -- node[lbl, above=3pt]{HTTPS} (fw); \draw[arr] (browser) -- node[lbl, above=3pt]{HTTPS} (fw);
\draw[arr] (fw) -- (caddy); \draw[arr] (fw) -- (caddy);
@@ -136,32 +156,37 @@ address 172.30.90.10 and Caddy answers as \texttt{git.yebilly.me} and
\draw[arr, dashed, devopsGreen] (bbox.north) -- node[lbl, pos=0.78, left=2pt, align=right]{HTTPS probes\\(\texttt{gitea\_probe})} (caddy.south); \draw[arr, dashed, devopsGreen] (bbox.north) -- node[lbl, pos=0.78, left=2pt, align=right]{HTTPS probes\\(\texttt{gitea\_probe})} (caddy.south);
\draw[arr] (prom) -- (pvol); \draw[arr] (prom) -- (pvol);
\draw[arr] (grafana) -- (gvol); \draw[arr] (grafana) -- (gvol);
\draw[arr] (gitea.east) -| ([xshift=-6mm]evol.north);
\draw[arr] (jenkins.east) -- (jenkins.east -| evol.west);
\draw[arr, dashed, devopsRed] (grafana.230) -- ++(0,-0.95) -| node[lbl, pos=0.8, left=2pt]{alerts (HTTPS out)} (discord.north); \draw[arr, dashed, devopsRed] (grafana.230) -- ++(0,-0.95) -| node[lbl, pos=0.8, left=2pt]{alerts (HTTPS out)} (discord.north);
\node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (grafana) (prom) (bbox) (node) (pvol) (gvol), inner sep=10pt, \node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (grafana) (prom) (bbox) (node) (pvol) (gvol) (evol), inner sep=10pt,
label={[font=\scriptsize]above:\guillemotleft device\guillemotright\ Droplet \texttt{The-Ocean} (1\,GiB RAM, 2\,GiB swap) / \guillemotleft executionEnvironment\guillemotright\ Docker networks \texttt{gitea\_web}, \texttt{gitea\_probe}, \texttt{monitoring}}] {}; label={[font=\scriptsize]above:\guillemotleft device\guillemotright\ Droplet \texttt{The-Ocean} (1\,GiB RAM, 2\,GiB swap) / \guillemotleft executionEnvironment\guillemotright\ Docker networks \texttt{gitea\_web}, \texttt{gitea\_probe}, \texttt{monitoring}}] {};
\end{tikzpicture}} \end{tikzpicture}}
\caption{UML deployment diagram after Assignment 7. Shaded boxes are the four \caption{UML deployment diagram after Assignment 7. Shaded boxes are the four
new containers; arrows point from the side that opens the connection. Only new containers; arrows point from the side that opens the connection. Only
Caddy's 80/443 are public. Blackbox Exporter probes the real HTTPS hostnames Caddy's 80/443 are public. Blackbox Exporter probes the real HTTPS hostnames
through Caddy on the private probe network; Grafana sends alert notifications through Caddy on the private probe network; Grafana sends alert notifications
outward to Discord. Gitea's and Jenkins' volumes are as in outward to Discord. Network tags: \textit{web} = \texttt{gitea\_web},
\ChapterRef{JenkinsCI}.} \textit{probe} = \texttt{gitea\_probe}, \textit{mon} =
\texttt{monitoring\_monitoring}. Artifacts are named Docker volumes (Compose
prefixes \texttt{gitea\_} and \texttt{monitoring\_} omitted); Caddy's volumes
hold its certificates and configuration.}
\label{Figure:SREDeployment} \label{Figure:SREDeployment}
\end{figure} \end{figure}
\paragraph{Configuration in Git and secrets outside it.} \paragraph{Configuration in Git and secrets outside it.}
The The
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/commit/b6cf08061815acd628bf3caaa90e38c46d57a8e7/monitoring}{\texttt{monitoring/}} \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring}{\texttt{monitoring/}}
folder holds the Compose file, \texttt{prometheus/prometheus.yml}, folder holds the Compose file, \texttt{prometheus/prometheus.yml},
\texttt{blackbox/blackbox.yml}, Grafana provisioning (data source, dashboard \texttt{blackbox/blackbox.yml}, Grafana provisioning (data source, dashboard
loader, both alert rules, the contact point), the dashboard JSON, and a loader, three alert rules, the contact point), the dashboard JSON, and a
\texttt{README.md} with deploy, update, backup, rollback, and runbook steps. \texttt{README.md} with deploy, update, backup, rollback, and runbook steps.
Provisioned items are read-only in Grafana's interface, so Git is their source Provisioned items are read-only in Grafana's interface, so Git is their source
of truth. Two secrets live only in \texttt{\textasciitilde/monitoring/.env.secret} of truth. Secrets live only in \texttt{\textasciitilde/monitoring/.env.secret}
on the droplet (mode 600, root): the initial Grafana administrator password on the droplet (mode 600, root), typed by Billy in his own SSH session: the
and the Discord webhook URL. Billy typed both in his own SSH session; the Discord webhook URL, and until it was replaced (Section~\ref{Section:SREAccess})
contact point reads the URL through \texttt{\$DISCORD\_WEBHOOK\_URL}, so the initial Grafana administrator password. The contact point reads the URL
it appears in no file in Git. Monitoring containers get no Docker socket and through \texttt{\$DISCORD\_WEBHOOK\_URL}, so it appears in no file in Git. Monitoring containers get no Docker socket and
no \texttt{privileged} flag. Node Exporter needs the host's process ID no \texttt{privileged} flag. Node Exporter needs the host's process ID
namespace and a read-only bind of \texttt{/} to report host CPU, memory, and namespace and a read-only bind of \texttt{/} to report host CPU, memory, and
disk; that mount lets the container read host files, which is accepted for disk; that mount lets the container read host files, which is accepted for
@@ -182,22 +207,32 @@ docker compose up -d && docker compose ps
\end{minted} \end{minted}
The \texttt{chmod} line was added after Grafana first logged The \texttt{chmod} line was added after Grafana first logged
\texttt{permission denied}: \texttt{scp} from Windows creates root-only \texttt{permission denied}: \texttt{scp} from Windows creates root-only
directories, and Grafana runs as user 472. Start-up order does not matter, directories, and Grafana runs as user 472. The Gitea stack in
and every service uses \texttt{restart: unless-stopped}. Routine pauses use \texttt{\textasciitilde/gitea} must be up first, because it creates the
external networks \texttt{gitea\_web} and \texttt{gitea\_probe}; inside the
monitoring stack the start-up order does not matter, and every service uses
\texttt{restart: unless-stopped}. Routine pauses use
\texttt{docker compose stop}/\texttt{start}; \texttt{docker compose down -v} \texttt{docker compose stop}/\texttt{start}; \texttt{docker compose down -v}
must never be used because it deletes both named volumes. An upgrade changes must never be used because it deletes both named volumes. An upgrade changes
one image's tag and digest at a time after a backup, and is rolled back by one image's tag and digest at a time after a backup, and is rolled back by
restoring the backup rather than assuming an older release can read newer restoring the backup rather than assuming an older release can read newer
data. Grafana and Prometheus state that Git cannot rebuild (users, alert data. Grafana and Prometheus state that Git cannot rebuild (users, alert
state, metric history) is backed up with the \texttt{tar} procedure in the state, metric history) is backed up as follows; no scheduled backup exists
README; no scheduled backup exists yet. yet:
\begin{minted}[breaklines]{sh}
cd ~/monitoring && docker compose stop grafana prometheus
docker run --rm -v monitoring_grafana_data:/g:ro -v monitoring_prometheus_data:/p:ro \
-v /root/backups:/b alpine tar czf /b/monitoring-$(date -u +%Y%m%dT%H%M%SZ).tgz /g /p
docker compose start grafana prometheus
\end{minted}
\paragraph{Restart persistence.} \paragraph{Restart persistence.}
Prometheus was restarted at 16:12:09 and answered at 16:12:15; its oldest Prometheus was restarted at 16:12:09 and answered at 16:12:15; its oldest
sample (14:52:16) remained, and the raw scrapes at 16:12:06 and 16:12:36 sample (14:52:16) remained, and the raw scrapes at 16:12:06 and 16:12:36
show no missed interval because the restart fell between them. Grafana was show no missed interval because the restart fell between them. Grafana was
restarted at 16:12:56; at 16:13:44 the dashboard (version~2, 7 panels), the restarted at 16:12:56; at 16:13:44 the dashboard (with the I/O-wait change,
data source, both rules, the contact point, and the administrator login were 7 panels), the data source, the two rules then defined, the contact point, and
the administrator login were
all present. A restart shows persistence on the named volumes; it is not a all present. A restart shows persistence on the named volumes; it is not a
backup restore. backup restore.
@@ -224,8 +259,44 @@ uses the multi-target pattern: each URL becomes the probe target and the
- {source_labels: [__param_target], target_label: instance} - {source_labels: [__param_target], target_label: instance}
- {target_label: __address__, replacement: blackbox-exporter:9115} - {target_label: __address__, replacement: blackbox-exporter:9115}
\end{minted} \end{minted}
At about 14:56 all five targets reported \texttt{up} with no error; scrape The target view used for collection health (Prometheus' targets API, which
durations were 0.03--0.23\,s. the \emph{Scrape health} panel also shows) is summarized in
Table~\ref{Table:SRETargets}.
\begin{table}[H]
\centering\footnotesize
\caption{Scrape targets, October 28, 2026 (UTC)\label{Table:SRETargets}}
\begin{tabular}{@{}llllr@{}}
\toprule \textbf{Job} & \textbf{Target (instance)} & \textbf{Health} & \textbf{Last error} & \textbf{Scrape time}\\ \midrule
\texttt{prometheus} & \texttt{prometheus:9090} & up & none & 0.022\,s\\
\texttt{node} & \texttt{node-exporter:9100} & up & none & 0.062\,s\\
\texttt{blackbox} & \texttt{blackbox-exporter:9115} & up & none & 0.004\,s\\
\texttt{https} & \texttt{https://git.yebilly.me/user/login} & up & none & 0.128\,s\\
\texttt{https} & \texttt{https://ci.yebilly.me/login} & up & none & 0.064\,s\\
\bottomrule
\end{tabular}
\end{table}
\noindent All five were also up with no error at about 14:56, shortly after
start-up (scrape times 0.031--0.226\,s); the table shows the check at 17:31.
\paragraph{Probe module.}
\texttt{blackbox/blackbox.yml} defines the module the \texttt{https} job uses~\cite{BlackboxExporter}:
\begin{minted}[breaklines]{yaml}
modules:
http_2xx:
prober: http
timeout: 10s
http:
method: GET
preferred_ip_protocol: ip4
valid_status_codes: [] # empty = any 2xx
follow_redirects: true
fail_if_not_ssl: true
tls_config:
insecure_skip_verify: false
\end{minted}
The probes use IPv4: the private probe network has no IPv6, and public DNS
publishes only \texttt{A} records.
\paragraph{Probe success criteria.} \paragraph{Probe success criteria.}
The \texttt{http\_2xx} module defines success as: a DNS answer, a TLS The \texttt{http\_2xx} module defines success as: a DNS answer, a TLS
@@ -252,7 +323,7 @@ hair-pinned visitors with a network gateway address (first 172.18.0.1, now
confirms it is. confirms it is.
\paragraph{Host metric verification.} \paragraph{Host metric verification.}
At 14:56:37 Node Exporter's root filesystem series carried the labels At 14:56:37 Node Exporter's~\cite{NodeExporter} root filesystem series carried the labels
\texttt{device="/dev/vda1"}, \texttt{fstype="ext4"}, and \texttt{device="/dev/vda1"}, \texttt{fstype="ext4"}, and
\texttt{mountpoint="/"}; the container's overlay filesystems are excluded by \texttt{mountpoint="/"}; the container's overlay filesystems are excluded by
Node Exporter's defaults. The dashboard and the disk alert select exactly Node Exporter's defaults. The dashboard and the disk alert select exactly
@@ -260,7 +331,13 @@ Node Exporter's defaults. The dashboard and the disk alert select exactly
24{,}883{,}167{,}232\,bytes, equals \texttt{df -B1 /}; available bytes differed 24{,}883{,}167{,}232\,bytes, equals \texttt{df -B1 /}; available bytes differed
by 4\,KB from \texttt{df}, read seconds apart. \texttt{MemTotal} by 4\,KB from \texttt{df}, read seconds apart. \texttt{MemTotal}
(1{,}008{,}177{,}152\,bytes) equals \texttt{free -b}; \texttt{MemAvailable} (1{,}008{,}177{,}152\,bytes) equals \texttt{free -b}; \texttt{MemAvailable}
was 293.4 against 301.0\,MB a few seconds apart. was 293.4 against 301.0\,MB a few seconds apart. CPU counters were compared
with \texttt{/proc/stat} (divided by \texttt{USER\_HZ} = 100) at 17:30:59:
user 4{,}099.5 against 4{,}100.8\,s, system 1{,}768.0 against 1{,}768.9\,s,
idle 562{,}034 against 562{,}053\,s, I/O wait 2{,}078.2 against 2{,}080.2\,s,
steal 1{,}726.4 against 1{,}727.5\,s. Each exported counter trails the kernel
by about the age of the last scrape (up to 30\,s), so the panels derive CPU
use from rates rather than raw totals.
\begin{table}[htbp] \begin{table}[htbp]
\centering\footnotesize \centering\footnotesize
@@ -291,10 +368,26 @@ Jenkins: \url{https://ci.yebilly.me/login};
Grafana: \url{https://metrics.yebilly.me/login}. Grafana: \url{https://metrics.yebilly.me/login}.
Gitea is public. Jenkins and Grafana answer only the Stevens network Gitea is public. Jenkins and Grafana answer only the Stevens network
155.246.0.0/16 and approved team or grader addresses, then require their own 155.246.0.0/16 and approved team or grader addresses, then require their own
login. Grafana has no anonymous access and no self sign-up. Accounts: login. Grafana has no anonymous access and no self sign-up
\texttt{billy} (Admin) and \texttt{vsun1} (Vincent, Viewer, added at 17:03; (\texttt{GF\_AUTH\_ANONYMOUS\_ENABLED=false}, \texttt{GF\_USERS\_ALLOW\_SIGN\_UP=false}),
least privilege, because changes go through Git). Graders do not need an account: the dashboard and its session cookie is marked secure, and its external root URL is set to
alert evidence is in this chapter. \texttt{https://metrics.yebilly.me/} (\texttt{GF\_SERVER\_ROOT\_URL}) so
alert links and redirects use the HTTPS hostname. Accounts: \texttt{billy}
(Admin) and \texttt{vsun1} (Vincent, Viewer, added at 17:03; least privilege,
because changes go through Git). Graders do not need an account: the
dashboard and alert evidence is in this chapter.
\paragraph{Initial credential.}
Grafana's built-in \texttt{admin}/\texttt{admin} was never active: the first
administrator, \texttt{billy}, was created at first start with a password
Billy typed into the root-only secrets file. That first password was then
replaced in Grafana (\emph{Profile} $\rightarrow$ \emph{Change password}) on
October 28; at 17:29:34 the old value was rejected (HTTP 401), its line was
deleted from \texttt{.env.secret}, and recreating Grafana at 17:33 removed it
from the container's environment. The current password exists only in
Billy's password manager and Grafana's database. The change came several
hours after first login rather than immediately, because the gap was found
in a review of this chapter.
\paragraph{DNS and certificate.} \paragraph{DNS and certificate.}
Billy added the \texttt{A} record \texttt{metrics} $\rightarrow$ Billy added the \texttt{A} record \texttt{metrics} $\rightarrow$
@@ -336,7 +429,18 @@ Caddyfile were copied to \texttt{\textasciitilde/gitea/backup-20261028T144040Z}.
\pagebreak[3] \pagebreak[3]
\paragraph{External exposure tests.} \paragraph{External exposure tests.}
Billy's laptop (home network on the team allowlist; IPv6 available) ran the Billy's laptop (home network on the team allowlist; IPv6 available) ran the
tests in Table~\ref{Table:SREExposure} at 14:57. tests in Table~\ref{Table:SREExposure} at 14:57 with \texttt{curl}; a status
of \texttt{000} means no TCP connection within the 5\,s limit:
\begin{minted}[breaklines]{sh}
for host in 147.182.178.136 "[2604:a880:400:d1:0:5:22d:6001]"; do
for p in 3000 3001 8080 9090 9100 9115 50000; do
curl -s -o /dev/null -m 6 --connect-timeout 5 -w "%{http_code}" "http://$host:$p/"; echo " $host:$p"
done
done
curl -s -o /dev/null -w "%{http_code}" https://metrics.yebilly.me/api/dashboards/uid/group1-sre
curl -s -6 -o /dev/null --resolve ci.yebilly.me:443:2604:a880:400:d1:0:5:22d:6001 \
-w "%{http_code}" https://ci.yebilly.me/login
\end{minted}
{\small {\small
\begin{tabularx}{\linewidth}{L{5.2cm}L{1.9cm}Y} \begin{tabularx}{\linewidth}{L{5.2cm}L{1.9cm}Y}
@@ -364,7 +468,7 @@ The provisioned dashboard \emph{Group 1 SRE} uses Eastern time
(\texttt{America/New\_York}), a 6-hour default range, 30\,s refresh, and the private data source (\texttt{America/New\_York}), a 6-hour default range, 30\,s refresh, and the private data source
\texttt{http://prometheus:9090}. It was written for this deployment, not \texttt{http://prometheus:9090}. It was written for this deployment, not
imported, and its definition is versioned as imported, and its definition is versioned as
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/commit/b6cf08061815acd628bf3caaa90e38c46d57a8e7/monitoring/grafana/dashboards/sre.json}{\texttt{sre.json}}. Table~\ref{Table:SREPanels} lists the six \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/grafana/dashboards/sre.json}{\texttt{sre.json}}. Table~\ref{Table:SREPanels} lists the six
required panels and the optional seventh with their queries; required panels and the optional seventh with their queries;
Figure~\ref{Figure:SREDashboard} shows them. In the queries, \texttt{R} Figure~\ref{Figure:SREDashboard} shows them. In the queries, \texttt{R}
stands for the root-filesystem selector stands for the root-filesystem selector
@@ -471,7 +575,7 @@ lab observation window, evaluated separately for Gitea and Jenkins. An
\gls{sla} is a promise to a customer, usually with consequences if missed; \gls{sla} is a promise to a customer, usually with consequences if missed;
this project makes no SLA. The \gls{error-budget} is the failure the SLO this project makes no SLA. The \gls{error-budget} is the failure the SLO
still allows, here 1\% of the window's probes. The approach follows the still allows, here 1\% of the window's probes. The approach follows the
Google SRE Workbook.\footnote{\url{https://sre.google/workbook/implementing-slos/}} Google SRE Workbook~\cite{SREWorkbook}.
The 99\% figure is an exercise target, not a reliability promise. The 99\% figure is an exercise target, not a reliability promise.
\paragraph{Worked example (hypothetical numbers from the instructor).} \paragraph{Worked example (hypothetical numbers from the instructor).}
@@ -524,25 +628,35 @@ day's only failures, Jenkins would reach $2{,}869/2{,}880 = 99.62\%$ and use
\index{runbook} \index{runbook}
\paragraph{Rules.} \paragraph{Rules.}
Both rules are Grafana-managed and provisioned from The instructor's two required rules, plus one collection-health rule, are
\texttt{grafana/provisioning/alerting/sre.yaml} (Table~\ref{Table:SRERules}). Grafana-managed and provisioned from
They are evaluated every 30\,s, matching the scrape interval. Missing data \texttt{grafana/provisioning/alerting/sre.yaml}~\cite{GrafanaAlerting} (Table~\ref{Table:SRERules}).
counts as \emph{Alerting} rather than healthy, and a query error sets the All are evaluated every 30\,s, matching the scrape interval. For each rule,
\emph{Error} state, which also notifies. A missing probe series or failed a query that returns no data counts as \emph{Alerting} rather than healthy,
collection therefore reaches the team, but a stopped Grafana cannot alert and a query error sets the \emph{Error} state, which also notifies. One case
anyone (Section~\ref{Section:SREIncident}). is not covered by that setting alone: \emph{HTTPS service down} queries both
probe series together, so if only one of them disappeared while the other
remained, Grafana would mark the missing one \emph{MissingSeries} and resolve
it. \emph{Monitoring target down} closes that gap: every scrape target,
including each HTTPS probe target, has its own \texttt{up} series, so a
stopped exporter or an unreachable probe is reported per target. A stopped
Grafana still cannot alert anyone (Section~\ref{Section:SREIncident}).
{\small {\small
\begin{tabularx}{\linewidth}{L{2.6cm}YY} \begin{tabularx}{\linewidth}{L{2.0cm}YYY}
\caption{Alert rules\label{Table:SRERules}}\\ \caption{Alert rules\label{Table:SRERules}}\\
\toprule & \textbf{HTTPS service down} & \textbf{Root disk space low}\\ \midrule \toprule & \textbf{HTTPS service down} & \textbf{Root disk space low} & \textbf{Monitoring target down}\\ \midrule
Owner / severity & Billy (backup Vincent) / critical & Billy (backup Vincent) / warning\\ \endfirsthead
Query & \texttt{probe\_success} of the \texttt{https} job, one instance per service & Panel~3's query (percent available on the root filesystem)\\ \toprule & \textbf{HTTPS service down} & \textbf{Root disk space low} & \textbf{Monitoring target down}\\ \midrule
Condition / pending & below 1 for 1\,minute & below 15 for 5\,minutes\\ \endhead
No data / error & Alerting / Error & Alerting / Error\\ Summary & ``\textit{instance} HTTPS probe is failing'' & ``Root filesystem on The-Ocean below 15\% free'' & ``\textit{job} target \textit{instance} is not being collected''\\
Notification & \texttt{team-alerts}; group by alert and instance & \texttt{team-alerts}; group by alert\\ Owner / severity & Billy (backup Vincent) / critical & Billy (backup Vincent) / warning & Billy (backup Vincent) / critical\\
Timing & group wait 10\,s, group interval 1\,m, repeat 4\,h & same\\ Query & \texttt{probe\_success} of the \texttt{https} job, one instance per service & Panel~3's query (percent available on the root filesystem) & \texttt{up}, one series per scrape target\\
Runbook & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md\#runbook-https-service-down}{README: HTTPS service down} & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md\#runbook-root-disk-space-low}{README: Root disk space low}\\ Condition / pending & below 1 for 1\,minute & below 15 for 5\,minutes & below 1 for 1\,minute\\
No data / error & Alerting / Error & Alerting / Error & Alerting / Error\\
Notification & \texttt{team-alerts}; group by alert and instance & \texttt{team-alerts}; group by alert & \texttt{team-alerts}; group by alert\\
Timing & group wait 10\,s, group interval 1\,m, repeat 4\,h & same & same\\
Runbook & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md\#runbook-https-service-down}{README} & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md\#runbook-root-disk-space-low}{README} & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md\#runbook-monitoring-target-down}{README}\\
\bottomrule \bottomrule
\end{tabularx}} \end{tabularx}}
@@ -550,8 +664,32 @@ The worst-case time from an outage to a notification is about one scrape
(30\,s) plus one evaluation (30\,s) plus the pending period (60\,s) plus the (30\,s) plus one evaluation (30\,s) plus the pending period (60\,s) plus the
group wait (10\,s): 2~minutes 10~seconds. The 15\% disk threshold is about group wait (10\,s): 2~minutes 10~seconds. The 15\% disk threshold is about
3.7\,GB of the 24.9\,GB disk: enough time to clear build cache, journals, or 3.7\,GB of the 24.9\,GB disk: enough time to clear build cache, journals, or
old images before Gitea, Jenkins, or Prometheus fail to write. The runbooks old images before Gitea, Jenkins, or Prometheus fail to write.
say who acts and what to try first, and never to use \texttt{down -v}.
\paragraph{Runbooks.}
The owner (Billy; Vincent as backup) first acknowledges in
\texttt{\#devops-alerts} with name and time, then:
\begin{itemize}[nosep]
\item \emph{HTTPS service down.} Check on the dashboard whether one or both
services are down and whether scrape health is also failing (then the cause is
collection, not the service). On the droplet: \texttt{cd \textasciitilde/gitea
\&\& docker compose ps} and \texttt{docker compose logs -{}-tail=50
<service>}. A stopped container: \texttt{docker compose start <service>}; a
running but failing one: \texttt{docker compose restart <service>}. Confirm the
probe returns to 1, the resolved message arrives, and, for Jenkins, that a
pipeline run passes.
\item \emph{Root disk space low.} Run \texttt{df -h /} and \texttt{docker system df};
clear build cache (\texttt{docker builder prune}), journals
(\texttt{journalctl -{}-vacuum-size=200M}), and unused images. Never delete
volumes; if Prometheus is the cause, lower its size limit. Plan a disk resize
with the team if space cannot be recovered.
\item \emph{Monitoring target down.} The \texttt{job} label names the
collector (\texttt{blackbox}/\texttt{https}: Blackbox Exporter; \texttt{node};
\texttt{prometheus}). In \texttt{\textasciitilde/monitoring}: \texttt{docker
compose ps} and logs, then \texttt{start} or \texttt{restart} the service.
Until it resolves, treat the dashboard and the other alerts as partly blind.
\end{itemize}
No runbook step uses \texttt{docker compose down -v}.
\paragraph{Contact point.} \paragraph{Contact point.}
The \gls{contact-point} \texttt{team-alerts} uses Grafana's Discord integration The \gls{contact-point} \texttt{team-alerts} uses Grafana's Discord integration
@@ -562,7 +700,8 @@ was sent at 15:05:55 through the replacement endpoint, which uses the stored
URL without exposing it (command in the README). Grafana returned URL without exposing it (command in the README). Grafana returned
\texttt{status success} and the test message reached \texttt{\#devops-alerts} \texttt{status success} and the test message reached \texttt{\#devops-alerts}
(Figure~\ref{Figure:SREContactTest}). This proves delivery only. The rules (Figure~\ref{Figure:SREContactTest}). This proves delivery only. The rules
and routing were proven by the two tests below. and routing were proven by the capacity and collection tests below and by
the Jenkins outage in Section~\ref{Section:SREIncident}.
\begin{figure}[H] \begin{figure}[H]
\centering \centering
@@ -603,8 +742,33 @@ after the 15\% threshold was restored (right).}
\label{Figure:SREDiskAlert} \label{Figure:SREDiskAlert}
\end{figure} \end{figure}
The availability rule was tested by the controlled incident in the next \paragraph{Collection-health test.}
section. At 17:34:44 Blackbox Exporter was stopped (\texttt{docker compose stop
blackbox-exporter}). The first failed scrape followed at 17:34:56; by 17:35:07
the \texttt{blackbox} target and both \texttt{https} targets read
\texttt{up = 0}, and no \texttt{probe\_success} series existed at all. At
1:36~p.m.\ Eastern Discord received \emph{Monitoring target down} for
\texttt{blackbox-exporter:9115} and, in the same minute, \emph{HTTPS service
down} for both login URLs with \texttt{grafana\_state\_reason = NoData}: with
every probe series gone, the availability rule's no-data policy fired as
designed. At 1:37~p.m.\ the collection alert was updated to all three
targets (\texttt{[FIRING:3]}). Blackbox Exporter was started again at
17:37:52, all five targets were up at 17:38:25, and Discord received
\emph{Resolved} for both rules by 1:39~p.m.\ (Figure~\ref{Figure:SRECollection}).
\begin{figure}[H]
\centering
\includegraphics[width=0.49\linewidth]{images/discord-collection-firing-2026-10-28.png}\hfill
\includegraphics[width=0.49\linewidth]{images/discord-collection-resolved-2026-10-28.png}
\caption{October 28, 2026, 1:36--1:39 p.m.\ Eastern: collection test. Left:
\emph{Monitoring target down} for Blackbox Exporter and \emph{HTTPS service
down} fired by missing data (\texttt{NoData}). Right: \emph{Monitoring target
down} resolved for all three affected targets.}
\label{Figure:SRECollection}
\end{figure}
The availability rule's real-outage test was the controlled incident in the
next section.
%--------------------------------------------------------------- %---------------------------------------------------------------
\section{Incident and Recovery} \section{Incident and Recovery}
@@ -619,8 +783,11 @@ command: \texttt{cd \textasciitilde/gitea \&\& docker compose start jenkins}.
Billy, as owner, acknowledged and approved the restart; Claude ran the Billy, as owner, acknowledged and approved the restart; Claude ran the
commands. Before starting, the team confirmed that no build was running. The commands. Before starting, the team confirmed that no build was running. The
exercise would be ended early if anything else failed or it ran past about exercise would be ended early if anything else failed or it ran past about
8 minutes. 8 minutes. It ran 4~minutes 48~seconds, longer than the planned three,
because the restart waited for the owner's acknowledgement of the alert; that
stayed inside the 8-minute limit, and no other service was affected.
\clearpage
\paragraph{Timeline.} \paragraph{Timeline.}
Table~\ref{Table:SREIncident} combines Prometheus sample times, Grafana rule Table~\ref{Table:SREIncident} combines Prometheus sample times, Grafana rule
states polled every 6\,s, the Jenkins log, and Discord timestamps, all in UTC. states polled every 6\,s, the Jenkins log, and Discord timestamps, all in UTC.
@@ -680,10 +847,19 @@ At 16:11:46 the Jenkins and Gitea login pages returned 200 from Billy's
laptop. Billy then pushed \texttt{b6cf080}. Gitea's webhook started Jenkins laptop. Billy then pushed \texttt{b6cf080}. Gitea's webhook started Jenkins
build~\#2 (pending status 16:36:27), and the build passed at 16:37:08 after build~\#2 (pending status 16:36:27), and the build passed at 16:37:08 after
33.9\,s with both tests passing. This proves the webhook, the pipeline, and 33.9\,s with both tests passing. This proves the webhook, the pipeline, and
the status report back to Gitea after the outage. The manual-PDF workflow the status report back to Gitea after the outage. The changes then went
runs only on pushes to \texttt{main}, on Vincent's laptop runner, so it is through the established review gate as
checked when this branch is merged; the PDF's title-page build suffix \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/pulls/22}{PR~\#22}
identifies that run. (\texttt{feature/issue-19-monitoring} into \texttt{main}): the required
check \texttt{vpn-dns-gateway/pipeline/pr-main} passed (on the manual commit
at 17:12:32), and Vincent approved at 17:09; Gitea dismisses an approval
as stale when later commits arrive, so branch protection requires a fresh
approval of the final head before the merge can happen. The manual-PDF workflow runs only on pushes to \texttt{main}, on
Vincent's laptop runner, so its post-outage run is the merge build that
produced this PDF; the title-page build suffix
(\texttt{+build.}\textit{run}\texttt{.}\textit{commit}) identifies that run
and the merge commit, listed under
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/actions}{Gitea Actions}.
\paragraph{How this differs from a failed build.} \paragraph{How this differs from a failed build.}
In \ChapterRef{JenkinsCI}, PR~\#15's deliberate unit-test failure In \ChapterRef{JenkinsCI}, PR~\#15's deliberate unit-test failure
@@ -707,7 +883,7 @@ link and the failing URL. \emph{Measurement gaps:} the acknowledgement was
given to the operator rather than posted in Discord before the restart, so given to the operator rather than posted in Discord before the restart, so
its exact time is not timestamped in the channel; the next exercise should its exact time is not timestamped in the channel; the next exercise should
acknowledge in the channel first. Probe timing is limited to 30\,s samples. acknowledge in the channel first. Probe timing is limited to 30\,s samples.
The 1.5-minute Jenkins start-up and the swap pressure in The minute-long Jenkins start-up and the swap pressure in
Section~\ref{Section:SREDashboard} share one cause: too little memory. Section~\ref{Section:SREDashboard} share one cause: too little memory.
\emph{Shared failure domain:} monitoring runs on the same droplet, so a \emph{Shared failure domain:} monitoring runs on the same droplet, so a
whole-droplet outage would silence collection and alerts together, and the whole-droplet outage would silence collection and alerts together, and the
@@ -735,9 +911,16 @@ deployment; replaced by \texttt{.Labels}. (3) The provisioned contact point
had no \emph{Test} button and the old endpoint was removed, so the new had no \emph{Test} button and the old endpoint was removed, so the new
endpoint was found and documented. (4) One SLO query was first evaluated at endpoint was found and documented. (4) One SLO query was first evaluated at
the wrong time (16:23) and was rerun at 16:13. (5) The dashboard's CPU line the wrong time (16:23) and was rerun at 16:13. (5) The dashboard's CPU line
was ambiguous under swap pressure, so an I/O-wait line was added. One failed was ambiguous under swap pressure, so an I/O-wait line was added. An
Grafana administrator login, from a password read with untrimmed whitespace, independent review of the chapter draft then found: (6) a claim that a missing
occurred at about 15:04 while finding the API route. probe series always alerts, which was untested and not true for a single
series, so the collection-health rule was added and tested; (7) the initial
Grafana administrator password had not been replaced, so it was; (8) Blackbox
Exporter ran as root, so it now runs as \texttt{nobody}; and smaller gaps in
the diagram, host checks, runbooks, citations, and four wrong figures, all
corrected in this version. One failed Grafana administrator login, from a
password read with untrimmed whitespace, occurred at about 15:04 while finding
the API route.
\paragraph{Cost, ownership, and cleanup.} \paragraph{Cost, ownership, and cleanup.}
No paid service was added. The droplet stays on its 1\,GiB Basic plan (listed No paid service was added. The droplet stays on its 1\,GiB Basic plan (listed
@@ -755,11 +938,12 @@ and the Discord webhook. The four disabled host services can be restored with
\paragraph{Document controls.} \paragraph{Document controls.}
This chapter was added in version 5.0. Document History records it with the This chapter was added in version 5.0. Document History records it with the
updated title and abstract; \ChapterRef{HostsPasswords} adds the monitoring updated title and abstract; \ChapterRef{HostsPasswords} adds the monitoring
host details, \texttt{metrics.yebilly.me}, the Grafana administrator, and the host details, \texttt{metrics.yebilly.me}, the Grafana accounts, and the
Discord webhook; new glossary terms are indexed; and AI assistance is recorded Discord webhook; new glossary terms are indexed; sources are cited in the
in \ChapterRef{AIPromptLog}. The reviewed configuration is commit Bibliography; and AI assistance is recorded in \ChapterRef{AIPromptLog}. The
\href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/commit/b6cf08061815acd628bf3caaa90e38c46d57a8e7}{\texttt{b6cf080}} reviewed source is the head of
on \texttt{feature/issue-19-monitoring}; the merge commit and the Gitea Actions \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/pulls/22}{PR~\#22},
run that built this PDF are identified by the build suffix on the title page. merged into \texttt{main}; the merge commit and the Gitea Actions run that
built this PDF are identified by the build suffix on the title page.
\endgroup \endgroup
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

+28
View File
@@ -141,3 +141,31 @@ undo: systemctl unmask multipathd fwupd udisks2 ModemManager && systemctl enable
## Grafana accounts ## Grafana accounts
- 2026-10-28 17:03:14 UTC Billy created Grafana user vsun1 (Vincent Sun), org role Viewer, not server admin. Org users: billy Admin, vsun1 Viewer. - 2026-10-28 17:03:14 UTC Billy created Grafana user vsun1 (Vincent Sun), org role Viewer, not server admin. Org users: billy Admin, vsun1 Viewer.
## Grafana administrator password replaced
- ~17:2x UTC Billy changed the billy password in Grafana (Profile -> Change password); the new value is only in his password manager and Grafana's database.
- 17:29:34 UTC the previous value (still in the running container's environment) returned HTTP 401 on /api/user: the initial credential is no longer valid.
- GF_SECURITY_ADMIN_PASSWORD line removed from ~/monitoring/.env.secret (now only DISCORD_WEBHOOK_URL; mode 600 root); `docker compose config --quiet` valid. The stale value leaves the container environment at the next Grafana recreate.
## Audit follow-up checks 2026-10-28 (UTC)
- Baseline detail (first sample 04:34:10): free -b available 154066944 B (146.9 MiB), swap used 434180096 B (414.1 MiB); second sample 04:34:27 available 229351424 B (218.7 MiB). Docker 29.8.1, Compose v5.5.1, kernel 6.8.0-147-generic.
- 14:56 target check: all five targets up, lastError none, lastScrapeDuration 0.031-0.226 s.
- 17:30:59 CPU counters, /proc/stat (USER_HZ 100) vs node_cpu_seconds_total: user 4100.8 / 4099.5 s, system 1768.9 / 1768.0, idle 562052.6 / 562034.4, iowait 2080.2 / 2078.2, steal 1727.5 / 1726.4 (difference consistent with the <=30 s scrape age).
- 17:3x targets: blackbox 0.004 s, https git 0.128 s, https ci 0.064 s, node 0.062 s, prometheus 0.022 s; all up, no error.
- Container identities and mounts: prometheus uid 65534 (nobody), /prometheus = volume monitoring_prometheus_data, /etc/prometheus/prometheus.yml bind ro; grafana uid 472, /var/lib/grafana = volume monitoring_grafana_data, /etc/grafana/provisioning and /var/lib/grafana-dashboards bind ro; node-exporter uid 65534, /host bind ro; blackbox-exporter uid 0 (image default), /config/blackbox.yml bind ro -> changed to user 65534:65534 (see below).
## Collection-health rule and non-root Blackbox (UTC)
- Local smoke run: new rule "Monitoring target down" (expr `up`, < 1 for 1 m, no data -> Alerting, error -> Error) loaded healthy and went Pending for the absent node target; blackbox-exporter as uid 65534 probed successfully.
- 17:33:23 deployed sre.yaml (third rule), compose.yaml (blackbox `user: "65534:65534"`), README (runbook, password prompt); `docker compose up -d grafana blackbox-exporter`. 17:33:57 "finished to provision alerting", no errors. blackbox id uid=65534(nobody). Old admin password no longer in the Grafana container environment. 17:34:15 all five targets up.
## Collection-health test: Blackbox Exporter stopped (UTC; EDT = UTC-4)
- Pre: up blackbox=1, prometheus=1, https=1 (x2), node=1.
- 17:34:44 INJECT `docker compose stop blackbox-exporter`.
- 17:34:56 first failed scrape: up blackbox=0, one https target 0; 17:35:07 both https targets 0; count(probe_success) returned no series from 17:35:07 until the restore (probe series absent, not 0).
- 17:37:52 RESTORE `docker compose start blackbox-exporter`; 17:38:25 all five targets up; blackbox uid 65534.
- Grafana alert state could not be read through the API (admin password now known only to Billy); notifications are evidenced by the Discord screenshots.
- Discord #devops-alerts (screenshots), EDT: 1:36 PM "[FIRING:1] Monitoring target down" instance blackbox-exporter:9115 job blackbox, A=0; same minute "[FIRING:1] HTTPS service down" for ci and for git with grafana_state_reason=NoData, A=-1 (probe series absent -> no-data policy Alerting); 1:37 PM "[FIRING:3] Monitoring target down" (blackbox plus both https targets); RESOLVED (A=1) for HTTPS service down git and ci (1:39 PM for ci) and "[RESOLVED] Monitoring target down" for all three at 1:39 PM.
+23 -4
View File
@@ -26,8 +26,10 @@ GF_SECURITY_ADMIN_PASSWORD=<from the team password manager>
DISCORD_WEBHOOK_URL=<webhook for #devops-alerts> DISCORD_WEBHOOK_URL=<webhook for #devops-alerts>
``` ```
The admin password applies only when Grafana first creates its database; later The admin password applies only when Grafana first creates its database. At
changes are made in Grafana and recorded in the password manager. first login, change it in Grafana (Profile → Change password), store the new
value in the password manager, and delete the `GF_SECURITY_ADMIN_PASSWORD`
line from `.env.secret`; on The-Ocean this was done on 28 Oct 2026.
## Deploy ## Deploy
@@ -70,7 +72,7 @@ retries scrapes. All four services restart `unless-stopped`.
```bash ```bash
GIP=$(docker inspect monitoring-grafana-1 --format '{{(index .NetworkSettings.Networks "monitoring_monitoring").IPAddress}}') GIP=$(docker inspect monitoring-grafana-1 --format '{{(index .NetworkSettings.Networks "monitoring_monitoring").IPAddress}}')
P=$(docker exec monitoring-grafana-1 printenv GF_SECURITY_ADMIN_PASSWORD) read -rs -p 'Grafana password for billy: ' P; echo # typed, never stored
curl -s -u "billy:$P" -H 'Content-Type: application/json' -X POST \ curl -s -u "billy:$P" -H 'Content-Type: application/json' -X POST \
-d '{"integration":{"uid":"team-alerts-discord","type":"discord","version":"v1","settings":{},"secureFields":{"url":true}}}' \ -d '{"integration":{"uid":"team-alerts-discord","type":"discord","version":"v1","settings":{},"secureFields":{"url":true}}}' \
"http://$GIP:3000/apis/notifications.alerting.grafana.app/v1beta1/namespaces/default/receivers/dGVhbS1hbGVydHM/test" "http://$GIP:3000/apis/notifications.alerting.grafana.app/v1beta1/namespaces/default/receivers/dGVhbS1hbGVydHM/test"
@@ -91,10 +93,27 @@ retries scrapes. All four services restart `unless-stopped`.
(volumes kept), then revert the `metrics` block and probe allowlist entry in (volumes kept), then revert the `metrics` block and probe allowlist entry in
`deploy/Caddyfile` and recreate Caddy. `deploy/Caddyfile` and recreate Caddy.
## Runbook: Monitoring target down
Alert `Monitoring target down` (critical, owner Billy, backup Vincent): a
Prometheus scrape target (`up`) has failed for 1 minute, or no target data
exists. While it fires, the dashboard and the other alerts are partly blind.
1. Acknowledge in `#devops-alerts` with your name and the time.
2. The `job` label names the broken collector: `blackbox` or `https` means
Blackbox Exporter, `node` means Node Exporter, `prometheus` means Prometheus.
3. On the droplet: `cd ~/monitoring && docker compose ps`, then
`docker compose logs --tail=50 <service>`.
4. Stopped: `docker compose start <service>`. Running but failing:
`docker compose restart <service>`. Never use `down -v`.
5. Confirm all targets are up again (dashboard *Scrape health* panel) and that
Discord shows the resolved message.
## Runbook: HTTPS service down ## Runbook: HTTPS service down
Alert `HTTPS service down` (critical, owner Billy, backup Vincent): a login Alert `HTTPS service down` (critical, owner Billy, backup Vincent): a login
page's `probe_success` has been 0 for 1 minute, or the probe series is missing. page's `probe_success` has been 0 for 1 minute. If the probe series disappears
instead, this rule can resolve; `Monitoring target down` reports that case.
1. Acknowledge in `#devops-alerts` with your name and the time. 1. Acknowledge in `#devops-alerts` with your name and the time.
2. Open the `Group 1 SRE` dashboard. Is only one service down, or both? 2. Open the `Group 1 SRE` dashboard. Is only one service down, or both?
+1
View File
@@ -72,6 +72,7 @@ services:
blackbox-exporter: blackbox-exporter:
image: quay.io/prometheus/blackbox-exporter:v0.29.1@sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13 image: quay.io/prometheus/blackbox-exporter:v0.29.1@sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13
restart: unless-stopped restart: unless-stopped
user: "65534:65534" # image default is root; HTTP probes need no privileges
command: ["--config.file=/config/blackbox.yml"] command: ["--config.file=/config/blackbox.yml"]
volumes: volumes:
- ./blackbox/blackbox.yml:/config/blackbox.yml:ro - ./blackbox/blackbox.yml:/config/blackbox.yml:ro
@@ -86,3 +86,39 @@ groups:
group_wait: 10s group_wait: 10s
group_interval: 1m group_interval: 1m
repeat_interval: 4h repeat_interval: 4h
# Collection health: one series per scrape target, so a stopped exporter or a
# probe series that disappears is reported instead of silently resolving.
- uid: monitoring-target-down
title: Monitoring target down
condition: C
data:
- refId: A
relativeTimeRange: {from: 300, to: 0}
datasourceUid: prometheus
model:
refId: A
expr: up
instant: true
- refId: C
datasourceUid: __expr__
model:
refId: C
type: threshold
expression: A
conditions:
- evaluator: {type: lt, params: [1]}
for: 1m
noDataState: Alerting # no up series at all: Prometheus has lost every target
execErrState: Error # Prometheus itself unreachable
labels: {severity: critical, owner: billy}
annotations:
summary: "{{ .Labels.job }} target {{ .Labels.instance }} is not being collected"
description: "Prometheus could not scrape this target for 1 minute; panels and alerts that depend on it are blind. Owner: Billy (backup: Vincent)."
runbook_url: https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md#runbook-monitoring-target-down
notification_settings:
receiver: team-alerts
group_by: [alertname]
group_wait: 10s
group_interval: 1m
repeat_interval: 4h