Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d1996c0ab | ||
|
|
34c4c7488a | ||
|
|
11270cfced | ||
|
|
249488d6fc | ||
|
|
336eaaefa7 | ||
|
|
b6cf080618 | ||
|
|
d3a5e6bc73 | ||
|
|
9b0dc4dc52 |
@@ -91,5 +91,7 @@ Thumbs.db
|
||||
*.key
|
||||
secrets.*
|
||||
|
||||
# Source images, the reference template, and the reviewed root submission PDF
|
||||
# are intentionally not ignored.
|
||||
# Source images and the reference template remain versioned.
|
||||
# Local manual builds replace one deliverable; do not commit generated PDFs.
|
||||
/manual/2026F-SSW-590-DevOps-Group-1.pdf
|
||||
/manual/latex/devopsAssignment.pdf
|
||||
|
||||
@@ -10,8 +10,16 @@ colors.yebilly.me {
|
||||
# Jenkins: Stevens campus network (155.246.0.0/16) plus team and approved grader
|
||||
# IPs from CI_TEAM_IPS in the untracked .env. Everyone else gets 403 before login.
|
||||
# The Stevens VPN is split-tunnel, so it does not give visitors a 155.246.x.x address.
|
||||
# 172.30.90.10 is Blackbox Exporter on the private probe network (monitoring/compose.yaml).
|
||||
ci.yebilly.me {
|
||||
@denied not remote_ip 155.246.0.0/16 {$CI_TEAM_IPS}
|
||||
@denied not remote_ip 155.246.0.0/16 172.30.90.10/32 {$CI_TEAM_IPS}
|
||||
respond @denied 403
|
||||
reverse_proxy jenkins:8080
|
||||
}
|
||||
|
||||
# Grafana (Assignment 7): same allowlist as Jenkins, then Grafana's own login.
|
||||
metrics.yebilly.me {
|
||||
@denied not remote_ip 155.246.0.0/16 {$CI_TEAM_IPS}
|
||||
respond @denied 403
|
||||
reverse_proxy grafana:3000
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ services:
|
||||
# Jenkins resolves git.yebilly.me to Caddy here, so checkout and status
|
||||
# calls stay on the droplet instead of hairpinning through the public IP.
|
||||
aliases: [git.yebilly.me]
|
||||
probe:
|
||||
# Blackbox Exporter (monitoring/compose.yaml) probes both sites through Caddy here.
|
||||
aliases: [git.yebilly.me, ci.yebilly.me]
|
||||
depends_on: [gitea]
|
||||
|
||||
# Jenkins LTS controller (Assignment 6). Builds run on its single executor.
|
||||
@@ -66,3 +69,10 @@ volumes:
|
||||
|
||||
networks:
|
||||
web:
|
||||
# Fixed subnet so Blackbox Exporter can have a fixed address (172.30.90.10), the only
|
||||
# private address the ci.yebilly.me allowlist admits. The web subnet stays denied:
|
||||
# Docker's proxy presents IPv6 and hairpin visitors as its gateway, 172.18.0.1.
|
||||
probe:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.30.90.0/28
|
||||
|
||||
@@ -14,7 +14,34 @@ discuss repository visibility with the other group member before publication.
|
||||
No registration token, runner identity file, private key, or account credential
|
||||
is copied. Hints-only Hosts/Passwords records are retained.
|
||||
|
||||
## Build and status
|
||||
## Local PDF for review and submission
|
||||
|
||||
From repository root, use the existing TinyTeX installation:
|
||||
|
||||
```powershell
|
||||
./manual/latex/makefilePowerShell.ps1 -Action pdf
|
||||
```
|
||||
|
||||
The helper detects the shared `../Tools/LaTeX/TinyTeX` installation. For a
|
||||
different existing installation, set `DEVOPS_LATEX_BIN` to its `bin/windows`
|
||||
directory first. It runs the full bibliography, glossary, acronym, index,
|
||||
and cross-reference sequence and replaces
|
||||
`manual/2026F-SSW-590-DevOps-Group-1.pdf`. That PDF and compiler intermediates
|
||||
are ignored by Git; sources and evidence remain versioned. Docker and an
|
||||
Actions artifact download are unnecessary for this local build. Local builds
|
||||
show the human document version without claiming an Actions run number.
|
||||
|
||||
After reviewing the PDF, remove generated LaTeX intermediates with:
|
||||
|
||||
```powershell
|
||||
./manual/latex/makefilePowerShell.ps1 -Action clean
|
||||
```
|
||||
|
||||
The PDF is retained. Continue using Gitea Actions for automated build evidence;
|
||||
keep historical run artifacts already required by the manual. New local
|
||||
revisions reuse this one PDF rather than creating more run folders.
|
||||
|
||||
## Historical Assignment 5 build evidence
|
||||
|
||||
See [compiler and workflow instructions](../ci/manual/README.md).
|
||||
Gitea run 1 succeeded for commit `828f6c5` (issue #12), including checkout,
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
This group document records the SSW 590 coursework and its supporting
|
||||
commands, designs, and evidence. Assignment 6 adds continuous integration:
|
||||
a Jenkins LTS controller runs beside Gitea on the DigitalOcean droplet,
|
||||
reachable at \url{https://ci.yebilly.me/login} from approved networks only.
|
||||
A Gitea pull request triggers a private webhook; Jenkins tests the pull
|
||||
request's latest head commit with a versioned \texttt{Jenkinsfile} and
|
||||
reports a named status check that branch protection requires before merge.
|
||||
A deliberate unit-test failure blocked pull request \#15, a repair passed,
|
||||
and the change was reviewed and merged. Earlier chapters retain the group's
|
||||
prior assignment results, including the Gitea Actions manual build.
|
||||
commands, designs, and evidence. Assignment 7 introduces site reliability
|
||||
engineering: Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter
|
||||
run as four pinned containers beside Gitea and Jenkins on the 1\,GiB
|
||||
DigitalOcean droplet, with Grafana at \url{https://metrics.yebilly.me/login}
|
||||
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
|
||||
defined and measured, and three alert rules (service availability, disk
|
||||
space, and collection health) notify the team's Discord channel. Each was
|
||||
shown firing and resolving; the availability rule through a planned Jenkins
|
||||
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.
|
||||
|
||||
@@ -679,3 +679,103 @@ changed. The revision is checked through the complete local TinyTeX build,
|
||||
diagnostic inspection, and visual review of the affected PDF pages.
|
||||
No commit, push, remote configuration change, or submission is performed
|
||||
as part of this correction.
|
||||
|
||||
\section{Assignment 7 Monitoring Deployment, Tests, and Chapter}
|
||||
Date: October 27--28, 2026; Tool: Anthropic Claude Code (Claude Opus 5.5);
|
||||
Human: Billy Ye, with Vincent Sun as verifier and reviewer.
|
||||
Inputs: instructor manual version 1.42 (Chapter 5), found in Billy's
|
||||
downloads after Billy asked to implement ``chapter 5 of this manual''; the
|
||||
repository and its AI guidance; Billy's decisions (measure capacity before
|
||||
any resize and then try a capped deployment on the 1\,GiB plan, alerts to a
|
||||
Discord webhook, hostname \texttt{metrics.yebilly.me}, Claude running droplet
|
||||
commands over SSH with Billy approving each step, disabling four unused host
|
||||
services after Claude showed the disk and boot checks); Billy's DNS record,
|
||||
Discord channel and webhook, issue \#19, secrets file, Grafana login,
|
||||
screenshots, pushes, and improvement issues \#20 and \#21.
|
||||
|
||||
Claude synced both checkouts, measured the baseline, chose and verified
|
||||
pinned image digests, wrote the \texttt{monitoring/} configuration, the
|
||||
Caddy and Compose changes, the dashboard, alert rules, and README runbooks;
|
||||
validated them locally (Compose, \texttt{promtool}, \texttt{caddy validate},
|
||||
and a throwaway Grafana run); deployed them after backing up the Caddy files;
|
||||
ran the exposure, contact-point, capacity-alert, outage, persistence, and SLO
|
||||
queries; and wrote \ChapterRef{SREMonitoring}, the Hosts and Passwords
|
||||
updates, glossary terms, title page, abstract, and Document History. Billy
|
||||
typed every secret himself: Claude never saw the Grafana password or the
|
||||
webhook URL. API calls read the password from the Grafana container's
|
||||
environment without printing it.
|
||||
|
||||
Human/AI corrections: the local Grafana run rejected an alert template
|
||||
written with \texttt{\$\$labels}; the deployed Grafana could not read its
|
||||
configuration after the Windows upload (fixed with \texttt{chmod}); Grafana~13
|
||||
had removed the old contact-point test endpoint, so the replacement was found
|
||||
from its own error message; one Grafana login from Claude failed because a
|
||||
password was read from the file with untrimmed whitespace; the first
|
||||
build-check before the outage matched the \texttt{ps} header and aborted
|
||||
before anything was stopped; one SLO query was first evaluated at the wrong
|
||||
time and was rerun; Billy's partial home IP address was removed from the
|
||||
evidence file before commit; the push from Claude's shell failed
|
||||
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
|
||||
dashboard change.
|
||||
|
||||
Review and corrections: at Billy's request, Claude had an independent
|
||||
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.
|
||||
Assumptions and unresolved items: the title-page assignment title comes
|
||||
from the Canvas page Billy showed (``\#7 Grafana and Promethous SRE --
|
||||
Group''), with the spelling of Prometheus corrected; the acknowledgement was given to Claude before the restart, and
|
||||
Billy's Discord reply came later; Billy created Vincent's Grafana
|
||||
account \texttt{vsun1} as Viewer; the 24-hour SLO was not evaluated; the manual-PDF build needs
|
||||
Vincent's runner when the branch is merged. No pull request, merge, or
|
||||
submission was performed by Claude.
|
||||
|
||||
\section{Assignment 7 Run-11 Review, TCP Evidence, and Final Corrections}
|
||||
Date: October 28, 2026; Tool: OpenAI Codex; Human: Vincent Sun.
|
||||
Inputs: Vincent's request to double-check Billy's completed Assignment 7,
|
||||
instructor manual version 1.42 Chapter 5, the run-11 artifact, repository AI
|
||||
guidance, versioned monitoring configuration and evidence, and public Gitea
|
||||
statuses and reviews. Vincent authorized the corrections and requested one
|
||||
locally compiled PDF in the repository, excluded from Git. Codex inspected
|
||||
the chapter and supporting figures, compared configuration and dashboard
|
||||
queries with the rubric, and verified the final PR head, approval, merge,
|
||||
and successful run-11 status. Chrome connected to Gitea; a subsequent
|
||||
project-tab operation timed out, so no authenticated Jenkins/Grafana audit
|
||||
or remote settings change was performed in this correction.
|
||||
|
||||
Human/AI corrections: Codex identified changing branch links, incomplete TCP
|
||||
evidence from HTTP code 000, outdated review timestamps, and conclusions
|
||||
stronger than the timing, sampling, or resource measurements supported.
|
||||
Vincent ran the supplied external PowerShell loop on his laptop and moved
|
||||
its CSV into the repository's ignored evidence directory. All 18 outcomes
|
||||
matched: TCP 80/443 succeeded and seven private ports failed on both IPv4
|
||||
and IPv6. Codex preserved the raw file and made a versioned copy replacing
|
||||
only the local Wi-Fi name with a generic network description. The reusable
|
||||
script preserves that loop with parameters; its syntax is checked without
|
||||
claiming another network test. The CSV timestamps are completion times.
|
||||
|
||||
Outputs used: version 5.1; the new TCP table and reproduction command;
|
||||
deployment links pinned to merge \texttt{34c4c74}; final approval/check and
|
||||
run-11 links; qualified notification-delay, missing-sample, and memory-pressure
|
||||
conclusions; a Document History entry; and this record. The local build helper
|
||||
now discovers the shared TinyTeX path from the actual repository nesting;
|
||||
local build instructions and PDF ignore rules retain one replaceable PDF.
|
||||
The complete TinyTeX build includes the bibliography, glossary, acronym list,
|
||||
index, and final reference passes, followed by diagnostic and visual review.
|
||||
Billy/Claude records and original evidence are preserved. Hosts and Passwords
|
||||
tables are unchanged because no deployed service, account, or credential
|
||||
changed. The missed pre-deployment build observation remains a limitation;
|
||||
later results do not recreate it. Commits, pushes, peer approval, and submission
|
||||
remain with the group. This local revision is not described as an Actions
|
||||
artifact or as already approved in Gitea.
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
\definecolor{devopsLightBlue}{RGB}{232,240,247}
|
||||
|
||||
% Replace these values for each assignment.
|
||||
\newcommand{\AssignmentTitle}{Gitea + Jenkins Autobuild and Testing -- Group}
|
||||
\newcommand{\AssignmentNumber}{6}
|
||||
\newcommand{\DocumentVersion}{4.2}
|
||||
\newcommand{\AssignmentTitle}{Grafana and Prometheus SRE -- Group}
|
||||
\newcommand{\AssignmentNumber}{7}
|
||||
\newcommand{\DocumentVersion}{5.1}
|
||||
\newcommand{\DocumentStatus}{Draft}
|
||||
\newcommand{\CourseNumber}{SSW 590}
|
||||
\newcommand{\CourseName}{DevOps}
|
||||
\newcommand{\Authors}{Vincent Sun and Billy Ye}
|
||||
\newcommand{\Organization}{Stevens Institute of Technology}
|
||||
\newcommand{\DocumentDate}{10/23/2026}
|
||||
\newcommand{\DocumentDate}{10/28/2026}
|
||||
\newcommand{\DueDate}{Friday by 11:59pm}
|
||||
% CI writes this ignored file in its checkout; ordinary local builds stay unchanged.
|
||||
\providecommand{\CIBuildSuffix}{}
|
||||
@@ -147,11 +147,12 @@
|
||||
\include{devopsGitea}
|
||||
\include{devopsAutomatedManualBuild}
|
||||
\include{devopsJenkins}
|
||||
\include{devopsSRE}
|
||||
\include{devopsHostsPasswords}
|
||||
|
||||
% Restore when a chapter cites devopsReferences.bib.
|
||||
%\bibliographystyle{IEEEtran}
|
||||
%\bibliography{devopsReferences}
|
||||
\bibliographystyle{IEEEtran}
|
||||
\bibliography{devopsReferences}
|
||||
|
||||
\appendix
|
||||
\include{devopsDocumentGuide}
|
||||
|
||||
@@ -12,6 +12,8 @@ link each entry to the changed chapter, table, figure, or controlled artifact.
|
||||
\multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\
|
||||
\toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule
|
||||
\endhead \bottomrule \endlastfoot
|
||||
October 28, 2026 / 5.1 & VS, CDX & Reviewed run-11 against instructor Chapter 5; added Vincent's external IPv4/IPv6 TCP retest (18 expected outcomes), pinned deployment links to the reviewed merge, recorded final PR approval and CI/build results, and qualified timing, sampling, and memory-pressure conclusions. Documented local TinyTeX builds to one ignored PDF. Hosts and Passwords tables are unchanged because no deployed service, account, or credential changed. & \ChapterRef{SREMonitoring}, \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.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}\\
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
\newacronym{cd}{CD}{continuous delivery or continuous deployment}
|
||||
\newacronym{iac}{IaC}{infrastructure as code}
|
||||
\newacronym{slo}{SLO}{service-level objective}
|
||||
\newacronym{sli}{SLI}{service-level indicator}
|
||||
\newacronym{sla}{SLA}{service-level agreement}
|
||||
\newacronym{sre}{SRE}{site reliability engineering}
|
||||
\newacronym{vpn}{VPN}{virtual private network}
|
||||
\newacronym{dns}{DNS}{Domain Name System}
|
||||
\newacronym{swot}{SWOT}{strengths, weaknesses, opportunities, and threats}
|
||||
@@ -30,3 +33,9 @@
|
||||
\newglossaryentry{jenkinsfile}{name={Jenkinsfile},description={A version-controlled file at the repository root that defines a Jenkins pipeline's stages and steps}}
|
||||
\newglossaryentry{controller}{name={controller},description={The central Jenkins server that serves the web interface, stores configuration, and schedules builds; it can also run builds on its own executors}}
|
||||
\newglossaryentry{build-agent}{name={build agent},description={A separate machine or container that connects to a Jenkins controller and runs builds, isolating build code from the controller}}
|
||||
|
||||
\newglossaryentry{error-budget}{name={error budget},description={The amount of failure an SLO still allows in its window; for a 99\% target over 2,880 probes, 28.8 failed probes}}
|
||||
\newglossaryentry{exporter}{name={exporter},description={A small service that exposes measurements of another system, such as a host or a probed website, in Prometheus format for scraping}}
|
||||
\newglossaryentry{scrape}{name={scrape},description={Prometheus's periodic HTTP request to a target's metrics endpoint, which records each returned value with a timestamp}}
|
||||
\newglossaryentry{contact-point}{name={contact point},description={A Grafana alerting destination, such as a Discord channel, that receives firing and resolved notifications}}
|
||||
\newglossaryentry{blameless-review}{name={blameless review},description={An incident review that records impact, timeline, cause, and improvements without assigning personal blame}}
|
||||
|
||||
@@ -15,41 +15,62 @@ October 22--23, 2026 (\ChapterRef{JenkinsCI}) the droplet record was updated
|
||||
for the 1\,GiB resize, the Jenkins service, and \texttt{ci.yebilly.me}; the
|
||||
Color Buttons app was marked retired; and the Passwords table gained the
|
||||
Jenkins administrators, the \texttt{jenkins-bot} Gitea account, and its token.
|
||||
On October 28, 2026 (\ChapterRef{SREMonitoring}) the droplet record gained
|
||||
the four monitoring containers, \texttt{metrics.yebilly.me}, the second swap
|
||||
file, and real monitoring status; the Passwords table gained the Grafana
|
||||
accounts, the monitoring secrets file, and the Discord webhook.
|
||||
|
||||
\section{Hosts}
|
||||
\small
|
||||
\begin{tabularx}{\linewidth}{@{}L{3.3cm}Y@{}}
|
||||
\caption{Hosts\label{Table:Hosts}}\\
|
||||
\toprule \textbf{Field} & \textbf{Droplet The-Ocean (git.yebilly.me, ci.yebilly.me)}\\ \midrule
|
||||
\toprule \textbf{Field} & \textbf{Droplet The-Ocean (git, ci, metrics .yebilly.me)}\\ \midrule
|
||||
\endfirsthead
|
||||
\toprule \textbf{Field} & \textbf{Droplet The-Ocean (git.yebilly.me, ci.yebilly.me)}\\ \midrule
|
||||
\toprule \textbf{Field} & \textbf{Droplet The-Ocean (git, ci, metrics .yebilly.me)}\\ \midrule
|
||||
\endhead
|
||||
\bottomrule \endlastfoot
|
||||
Role & Gitea work hub (Gitea 1.27.3 behind Caddy 2.11.4 TLS proxy); since
|
||||
22 Oct 2026 also the Jenkins 2.580.1 LTS controller, which runs the CI builds.
|
||||
The Assignment 3 Color Buttons app (29 Sep 2026) is retired: container
|
||||
22 Oct 2026 also the Jenkins 2.580.1 LTS controller, which runs the CI builds;
|
||||
since 28 Oct 2026 also the monitoring stack (Prometheus 3.15.1, Grafana OSS
|
||||
13.2.5, Node Exporter 1.12.1, Blackbox Exporter 0.29.1). The Assignment 3 Color Buttons app (29 Sep 2026) is retired: container
|
||||
stopped with restart policy \texttt{no}; its Caddy route remains\\
|
||||
Environment & Course production (team use)\\
|
||||
Provider & DigitalOcean, NYC1; Ubuntu 24.04 LTS; 1 vCPU; resized from
|
||||
512\,MB to the 1\,GiB Basic plan in October 2026 (961\,MiB reported, 25\,GB
|
||||
plan disk, 1\,GiB swap file)\\
|
||||
plan disk); swap files \texttt{/swapfile} and \texttt{/swapfile2}, 1\,GiB
|
||||
each (second added 28 Oct 2026); \texttt{multipathd}, \texttt{fwupd},
|
||||
\texttt{udisks2}, and \texttt{ModemManager} disabled and masked\\
|
||||
Public address / DNS & IPv4 \texttt{147.182.178.136}; \texttt{A} records
|
||||
\texttt{git}, \texttt{ci}, and \texttt{colors} \texttt{.yebilly.me}; public
|
||||
\texttt{git}, \texttt{ci}, \texttt{metrics}, and \texttt{colors} \texttt{.yebilly.me}; public
|
||||
IPv6 \texttt{2604:a880:400:d1:0:5:22d:6001} assigned but not published in DNS\\
|
||||
Private services & Gitea \texttt{:3000} and Jenkins \texttt{:8080} (512\,MiB
|
||||
RAM, 0.75 CPU cap; agent port disabled) on Docker network \texttt{gitea\_web},
|
||||
no host ports; SQLite file in volume \texttt{gitea\_gitea-data}; Jenkins state
|
||||
in volume \texttt{gitea\_jenkins-home}\\
|
||||
in volume \texttt{gitea\_jenkins-home}. Monitoring (Compose project
|
||||
\texttt{monitoring}, no host ports): Prometheus \texttt{:9090} (128\,MiB),
|
||||
Node Exporter \texttt{:9100} and Blackbox Exporter \texttt{:9115} (32\,MiB
|
||||
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
|
||||
\texttt{gitea\_probe} (172.30.90.0/28); volumes
|
||||
\texttt{monitoring\_prometheus\_data} (7\,d / 500\,MB) and
|
||||
\texttt{monitoring\_grafana\_data}\\
|
||||
Exposed ports & 443/TCP and 80/TCP to all; 22/TCP to approved team addresses only
|
||||
(Cloud Firewall \texttt{gitea-fw}); \texttt{ci.yebilly.me} answers only
|
||||
Stevens 155.246.0.0/16 and team addresses (Caddy allowlist), 403 otherwise\\
|
||||
(Cloud Firewall \texttt{gitea-fw}); \texttt{ci.yebilly.me} and
|
||||
\texttt{metrics.yebilly.me} answer only Stevens 155.246.0.0/16 and team
|
||||
addresses (Caddy allowlist; \texttt{ci} also the probe address), 403
|
||||
otherwise; monitoring ports 9090, 9100, 9115 not reachable\\
|
||||
Owner & BY (server administration); VS (review)\\
|
||||
HTTPS URLs & \url{https://git.yebilly.me}, \url{https://ci.yebilly.me/login}\\
|
||||
HTTPS URLs & \url{https://git.yebilly.me}, \url{https://ci.yebilly.me/login},
|
||||
\url{https://metrics.yebilly.me/login}\\
|
||||
Backup status & No backup job; container-replacement persistence verified for
|
||||
Gitea (\ChapterRef{GiteaFoundation}) and restart persistence for Jenkins
|
||||
(\ChapterRef{JenkinsCI}) only\\
|
||||
Monitoring status & No alerting configured; checked manually with
|
||||
\texttt{docker compose ps}, \texttt{docker stats}, and logs\\
|
||||
Gitea (\ChapterRef{GiteaFoundation}), restart persistence for Jenkins
|
||||
(\ChapterRef{JenkinsCI}) and for Prometheus and Grafana
|
||||
(\ChapterRef{SREMonitoring}); manual volume backup procedure in
|
||||
\texttt{monitoring/README.md}\\
|
||||
Monitoring status & Prometheus and Grafana: host CPU, memory, root disk, and
|
||||
HTTPS probes of Gitea and Jenkins every 30\,s; alerts \emph{HTTPS service
|
||||
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)\\
|
||||
\end{tabularx}
|
||||
\normalsize
|
||||
|
||||
@@ -90,6 +111,10 @@ 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{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\\
|
||||
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\\
|
||||
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}\\
|
||||
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\\
|
||||
Namecheap (\texttt{yebilly.me}) & BY & BY's password manager & Domain owner\\
|
||||
@@ -99,8 +124,10 @@ Gitea database (SQLite) & --- & No credential; file access limited to droplet \t
|
||||
\end{tabularx}
|
||||
\normalsize
|
||||
|
||||
Multi-factor authentication and rotation status have not yet been recorded for
|
||||
these accounts. Some credentials also have local copies on members' devices;
|
||||
Multi-factor authentication: as reported by BY on 28 Oct 2026, his Discord
|
||||
account (which owns the \texttt{\#devops-alerts} webhook) and his GitHub
|
||||
account use MFA. MFA status for the other accounts, and rotation status for
|
||||
all of them, has not yet been recorded. Some credentials also have local copies on members' devices;
|
||||
moving them into the password managers is an open follow-up.
|
||||
|
||||
\fussy
|
||||
|
||||
@@ -4,3 +4,53 @@
|
||||
publisher = {IT Revolution Press},
|
||||
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}
|
||||
}
|
||||
|
||||
@misc{MicrosoftTestNetConnection,
|
||||
author = {{Microsoft}},
|
||||
title = {{Test-NetConnection}},
|
||||
howpublished = {\url{https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection}},
|
||||
note = {Accessed Oct. 28, 2026}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 454 KiB |
|
After Width: | Height: | Size: 480 KiB |
|
After Width: | Height: | Size: 426 KiB |
|
After Width: | Height: | Size: 62 KiB |
@@ -36,15 +36,16 @@ try {
|
||||
exit 0
|
||||
}
|
||||
|
||||
$repoDirectory = Split-Path -Parent $projectDirectory
|
||||
$manualDirectory = Split-Path -Parent $projectDirectory
|
||||
$repoDirectory = Split-Path -Parent $manualDirectory
|
||||
$projectsDirectory = Split-Path -Parent $repoDirectory
|
||||
$toolDirectories = @()
|
||||
if ($env:DEVOPS_LATEX_BIN) {
|
||||
$toolDirectories += $env:DEVOPS_LATEX_BIN
|
||||
}
|
||||
$toolDirectories += @(
|
||||
(Join-Path $env:APPDATA 'TinyTeX\bin\windows'),
|
||||
(Join-Path $projectsDirectory 'Tools\LaTeX\TinyTeX\bin\windows'),
|
||||
(Join-Path $env:APPDATA 'TinyTeX\bin\windows'),
|
||||
(Join-Path $env:LOCALAPPDATA 'Programs\MiKTeX\miktex\bin\x64'),
|
||||
'C:\Program Files\MiKTeX\miktex\bin\x64'
|
||||
)
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
# Assignment 7 raw evidence (droplet The-Ocean, captured by Claude over SSH, approved by Billy)
|
||||
|
||||
## Baseline 2026-10-28 04:34 UTC
|
||||
|
||||
Ubuntu 24.04.5 LTS, kernel 6.8.0-147-generic x86_64, 1 vCPU; Docker 29.8.1, Compose v5.5.1; disk /dev/vda1 24883167232 B, 18784387072 B available (25% used); gitea_web 172.18.0.0/16; global IPv6 2604:a880:400:d1:0:5:22d:6001/64, no AAAA records; uptime 6 days, load 0.05.
|
||||
|
||||
Containers: gitea-jenkins-1 325.4MiB/512MiB, gitea-caddy-1 10.85MiB, gitea-gitea-1 98.21MiB. Host RSS: java 318.1, gitea 122.0, dockerd 50.0, multipathd 26.5, containerd 23.5, caddy 16.7 MiB.
|
||||
|
||||
```
|
||||
Wed Oct 28 04:34:27 UTC 2026
|
||||
total used free shared buff/cache available
|
||||
Mem: 1008177152 778825728 101543936 3424256 281452544 229351424
|
||||
Swap: 1073737728 479457280 594280448
|
||||
Filesystem 1B-blocks Used Available Use% Mounted on
|
||||
/dev/vda1 24883167232 6082015232 18784374784 25% /
|
||||
NAME TYPE SIZE USED PRIO
|
||||
/swapfile file 1024M 457.2M -2
|
||||
gitea-jenkins-1 0.17% 326.3MiB / 512MiB
|
||||
gitea-caddy-1 0.00% 11MiB / 961.5MiB
|
||||
gitea-gitea-1 0.20% 102.9MiB / 961.5MiB
|
||||
```
|
||||
|
||||
## Unused host services disabled
|
||||
|
||||
```
|
||||
2026-10-28 04:52:51 UTC disabled+masked: multipathd(.service,.socket), fwupd(+fwupd-refresh.timer), udisks2, ModemManager
|
||||
before: Mem total 1008177152 used 798810112 available 209367040
|
||||
after (04:52:59): used 786944000 available 221233152 ; 04:53:0x: available 238510080, Mlocked 0
|
||||
apt-daily.service ran 04:52:52-04:53:24 (40.8M peak, triggered by systemd reload); after: available 364957696, swap used 503414784
|
||||
checks before change: multipath -ll empty; dmsetup ls "No devices found"; root=UUID cc6f3ac6 (/dev/vda1, LABEL cloudimg-rootfs); multipath-tools-boot not installed; initramfs multipath files 0
|
||||
post: gitea-jenkins-1, gitea-caddy-1, gitea-gitea-1 Up; git login 200 1.09s, ci login 200 0.38s
|
||||
undo: systemctl unmask multipathd fwupd udisks2 ModemManager && systemctl enable --now multipathd udisks2 ModemManager
|
||||
```
|
||||
|
||||
## Image pins chosen 2026-10-28 (registry index digests)
|
||||
|
||||
- prom/prometheus:v3.15.1 sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2 (released 2026-10-21)
|
||||
- grafana/grafana:13.2.5 sha256:9f7aa1e1e3246aade5792d35a738049f7f32f89cd51d1956cf426a4e86268a84 (2026-10-27; 13.3.0 skipped as one day old)
|
||||
- quay.io/prometheus/node-exporter:v1.12.1 sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0 (2026-07-14)
|
||||
- quay.io/prometheus/blackbox-exporter:v0.29.1 sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13 (2026-10-21)
|
||||
|
||||
## Local validation 2026-10-28 (laptop Docker 29.8.2)
|
||||
|
||||
- docker compose config --quiet: monitoring and deploy valid; promtool check config SUCCESS; caddy validate: Valid configuration.
|
||||
- Grafana smoke run: first run rejected "{{ $$labels.instance }}" (bad character $); fixed to {{ .Labels.instance }}; rerun: both rules health ok, probes Normal from laptop, disk rule Pending (NoData) without node-exporter, dashboard group1-sre in folder SRE.
|
||||
|
||||
## Deploy 2026-10-28 (UTC)
|
||||
|
||||
- Issue #19; branch feature/issue-19-monitoring from main 9b0dc4d (Jenkins pipeline/head + Automated Manual Build success on 9b0dc4d).
|
||||
- 14:40:23 second swapfile: /swapfile2 1 GiB added (fstab); swap total 2147475456 B. Disk 24883167232 B, 17710153728 B available after.
|
||||
- 14:40:40 backup ~/gitea/backup-20261028T144040Z (docker-compose.yml, Caddyfile). Staged files validated on droplet (caddy validate: Valid configuration; compose config valid). Diffs = probe network + aliases; ci allowlist +172.30.90.10/32; metrics block.
|
||||
- 14:40:57-14:41:09 `docker compose up -d --no-deps caddy` (recreate). gitea_probe 172.30.90.0/28; caddy gitea_probe=172.30.90.2 (aliases git/ci), gitea_web=172.18.0.3. Let's Encrypt: "certificate obtained successfully" metrics.yebilly.me. Laptop: git 200 0.049s, ci 200 0.289s, metrics 502 (Grafana not started).
|
||||
- docker-proxy now targets 172.30.90.2 (probe network) for 80/443; IPv6/hairpin clients would appear as 172.30.90.1, not allowlisted (only .10/32).
|
||||
- ~/monitoring copied (700). .env.secret created by Billy: 600 root; names GF_SECURITY_ADMIN_PASSWORD, DISCORD_WEBHOOK_URL; no empty values; no "$".
|
||||
- 14:50:45-14:51:51 pull. promtool: SUCCESS. RepoDigests (amd64) match pins; sizes: prometheus 381400167, grafana 1949552290, node-exporter 40992821, blackbox 58273564 B. Before up: avail 241209344 B, swap used 520241152 B; disk 39% used.
|
||||
- 14:52:04-14:52:08 `docker compose up -d`. Samples (avail MiB / swap used MiB): 14:52:23 228/578, 14:52:43 230/666, 14:53:02 159/668, 14:53:22 195/692, 14:53:40 211/700, 14:53:57 218/700, 14:54:14 189/705, 14:54:32 156/707. Peaks: grafana 136.6/192 MiB, prometheus 26.6/128, blackbox 15.3/32, node-exporter 13.6/32. No OOM in dmesg. Within abort limits.
|
||||
- Grafana "permission denied" on /etc/grafana/provisioning/* (scp-created 700 dirs). Fix 14:55: dirs 755 / files 644 under grafana, prometheus, blackbox; restart 14:55:08; provisioning datasources, alerting, dashboards finished.
|
||||
- Targets (14:5x): prometheus, node, blackbox, https x2 all up. probe_success 1 both; status 200; duration ci 0.686s, git 0.193s.
|
||||
- 14:56: rules "HTTPS service down" (ci, git Normal) and "Root disk space low" (Normal), health ok; contact point team-alerts discord url set; dashboard Group 1 SRE /d/group1-sre.
|
||||
- Host verification 14:56:37: root fs labels device=/dev/vda1 fstype=ext4 mountpoint=/; size 24883167232 = df; avail 15281520640 vs df 15281516544. MemTotal 1008177152 = free total; MemAvailable 293392384 vs free available 301010944 (seconds apart).
|
||||
- Laptop after start: git 200 0.53s, ci 200 0.064s, metrics /login 200 1.68s, metrics /metrics 302.
|
||||
|
||||
## External exposure tests 2026-10-28 14:57 UTC (Billy's laptop, home network on the team allowlist, IPv6 available)
|
||||
|
||||
- Raw ports 3000, 3001, 8080, 9090, 9100, 9115, 50000 on 147.182.178.136 and [2604:a880:400:d1:0:5:22d:6001]: all no connection (curl 000, 5 s connect timeout).
|
||||
- https://metrics.yebilly.me/metrics -> 302 to /login?redirectTo=%2Fmetrics (GF_METRICS_ENABLED=false); /api/dashboards/uid/group1-sre -> 401; /api/datasources/proxy/uid/prometheus/api/v1/query?query=up -> 401 (no anonymous access).
|
||||
- https://git.yebilly.me/metrics -> 404; https://ci.yebilly.me/prometheus/ -> 403 (no app metrics endpoints).
|
||||
- http://metrics.yebilly.me -> 308 to https.
|
||||
- IPv6 (--resolve to droplet IPv6, no AAAA records): ci /login 403, metrics /login 403, git /user/login 200. IPv4 from allowlisted laptop: ci 200, metrics 200. Confirms docker-proxy gateway (172.30.90.1) is not allowlisted.
|
||||
|
||||
## Grafana login and contact-point test 2026-10-28
|
||||
|
||||
- ~15:01 UTC (11:01 EDT): Billy logged in at https://metrics.yebilly.me as billy; dashboard Group 1 SRE showed all 7 panels with data (screenshot).
|
||||
- Contact point is provisioned, so the UI offers no Test button. Legacy POST /api/alertmanager/grafana/config/api/v1/receivers/test -> 410 Gone ("use /apis/notifications.alerting.grafana.app/v1beta1/namespaces/{namespace}/receivers/{uid}/test").
|
||||
- One failed admin auth at ~15:04 UTC from the droplet host (password read from file included compose-trimmed whitespace); later calls used the container's environment.
|
||||
- 15:05:55 UTC: POST .../receivers/dGVhbS1hbGVydHM/test with integration team-alerts-discord, secureFields.url=true -> {"status":"success","duration":"866ms"}.
|
||||
|
||||
## Normal Jenkins build vs host metrics 2026-10-28 (UTC; EDT = UTC-4)
|
||||
|
||||
- Before (15:10:40): cpu 48.6% (2m rate, during a periodic burst), MemAvailable 169.3 MiB, swap used 651.4 MiB; jenkins 348.3 MiB, 0.15% CPU.
|
||||
- Commit d3a5e6b pushed by Billy; Gitea statuses on d3a5e6b: pending 15:17:36, pending 15:17:51, success 15:17:53 (vpn-dns-gateway/pipeline/head).
|
||||
- Jenkins vpn-dns-gateway » feature/issue-19-monitoring #1: queued 15:17:33.9, started 15:17:41.3, duration 11.825 s, finished ~15:17:53.1, SUCCESS, "Ran 2 tests ... OK". Executed on the controller (built-in node; workspace /var/jenkins_home/workspace/eway_feature_issue-19-monitoring), single executor, no agents.
|
||||
- Prometheus 30 s samples 15:12:00-15:22:00 (cpu = 100*(1-avg(rate(idle[1m]))), MiB, MiB, load1):
|
||||
15:12:00 38.5/186/652/0.79, 15:13:00 48.8/205/710/0.41, 15:14:00 8.3/224/708/0.15, 15:15:00 38.8/136/673/0.38, 15:16:00 15.0/169/695/0.14, 15:16:30 8.3/175/688/0.15, 15:17:00 39.4/104/650/0.29, **15:17:30 19.0/116/675/0.33, 15:18:00 32.1/196/691/0.41 (build window)**, 15:18:30 43.7/221/680/0.31, 15:19:00 46.4/133/652/0.84, 15:20:00 17.1/221/702/0.51, 15:21:00 35.7/114/651/0.47, 15:22:00 11.2/209/691/0.21.
|
||||
- Result: no change attributable to the 11.8 s build; it is shorter than the 30 s scrape interval and its samples fall inside the background range (8-49%). Whole-host measurements cannot attribute CPU/RAM to Jenkins.
|
||||
- Background pattern: bursts about every 2 min (CPU 35-49%, MemAvailable -80..-120 MiB). docker stats 15:23:39-15:25:47 every ~8 s: containers mostly <2% CPU; burst at 15:24:38-15:24:46 = gitea 13.7% CPU, 23->93 MiB, grafana 15.4%, 73->140 MiB, MemAvailable 118 MiB.
|
||||
- CPU by mode, 15 min to ~15:26: idle 74.3%, iowait 14.7%, system 4.5%, user 4.0%, steal 1.6%. vmstat burst: si 2189 pages/s, wa 10%. Interpretation: memory pressure causes swap-in I/O wait; CPU work itself is ~8.5%.
|
||||
- Dashboard v2 (15:26): CPU panel adds "of which I/O wait" = 100*avg(rate(node_cpu_seconds_total{mode="iowait"}[2m])).
|
||||
|
||||
## Capacity alert test (Root disk space low) 2026-10-28 (UTC; EDT = UTC-4)
|
||||
|
||||
- Before: rule inactive, instance Normal since 14:56:20. Root fs ~61% available. Final file backed up on the droplet.
|
||||
- 15:36:48 temporary change on the droplet only: threshold `lt 15` -> `lt 70` in grafana/provisioning/alerting/sre.yaml; POST /api/admin/provisioning/alerting/reload -> "Alerting config reloaded" (no restart). Git kept 15.
|
||||
- 15:36:50 Pending; polled every ~15 s; 15:41:50 Alerting/firing (pending period 5 m as configured). Notification expected ~15:42:00 (group_wait 10 s).
|
||||
- 15:42:24 restored `lt 15` from the backup; reload -> "Alerting config reloaded". 15:42:41 rule inactive, no instances; Grafana Alertmanager active alerts: [] (resolved).
|
||||
- Droplet rule file SHA-256 1614a4490202de44ec75c958ade3b79a3c207cc60e712a6be9804f3f01e49d9e = Git working copy.
|
||||
- Side note: 15:30:05 GET /api/annotations returned 500 after 3.96 s during a dashboard load (memory pressure).
|
||||
- Discord #devops-alerts (screenshots): 11:42 EDT "[FIRING:1] Root disk space low" Value A=61.343850329350225, C=1, labels device=/dev/vda1 fstype=ext4 mountpoint=/ owner=billy severity=warning, runbook_url present; then "[RESOLVED] Root disk space low" with grafana_state_reason=Updated (resolution came from the restored rule definition; at that moment free space 61.3% > 15%, so the restored condition is false). The summary text is static ("below 15% free") and did not reflect the temporary 70% threshold.
|
||||
|
||||
## Controlled incident: Jenkins outage 2026-10-28 (UTC; EDT = UTC-4)
|
||||
|
||||
- Pre-check: no Jenkins build process (python3/sh/git/durable) in gitea-jenkins-1; ci probe 1; HTTPS rule instances ci Normal, git Normal. (A first attempt aborted before injection because the check matched the ps header line.)
|
||||
- 16:05:00 INJECT `cd ~/gitea && docker compose stop jenkins`; container stopped 16:05:06.
|
||||
- Prometheus ci probe_success samples: 16:04:50 = 1; 16:05:20 = 0 (first failing probe); 0 at 16:05:50, 16:06:20, 16:06:50.
|
||||
- probe_http_status_code (ci): 200 at 16:04:20, 16:04:50; 502 (Caddy, upstream down) 16:05:20-16:09:50; 0 (no HTTP response while Jenkins was starting) at 16:10:20; 200 at 16:10:50.
|
||||
- Grafana rule HTTPS service down, instance ci: Normal until ~16:05:48; Pending observed 16:05:54; Alerting observed 16:06:52 (poll every ~6 s). Gitea instance Normal throughout.
|
||||
- 16:07 (12:07 PM EDT) Discord "[FIRING:1] HTTPS service down SRE https://ci.yebilly.me/login (https billy critical)", Value A=0, C=1, runbook_url present (screenshot).
|
||||
- Acknowledgement: Billy sent the FIRING screenshot to the operator (Claude session) before the restart; a Discord "ack" reply was posted afterward (its timestamp is later than the restart).
|
||||
- 16:09:48 RESTART `cd ~/gitea && docker compose start jenkins` (4 min 48 s after injection).
|
||||
- Jenkins log: 16:10:45.113 "Completed initialization"; 16:10:45.275 "Jenkins is fully up and running".
|
||||
- ci probe_success: 0 at 16:09:50, 16:10:20; 1 at 16:10:50 (first successful probe). Rule ci instance Alerting until ~16:11:20; Normal observed 16:11:27. Gitea instance Normal throughout.
|
||||
- (Host-side check with --resolve to 127.0.0.1 returned 403 throughout: the droplet's own loopback request arrives through docker-proxy as the probe gateway 172.30.90.1, which the allowlist denies. Not a service signal.)
|
||||
- Measured: injection -> first failing sample 20 s; injection -> firing ~1 m 52 s (16:06:52); injection -> Discord ~2 m (16:07); restart -> Jenkins fully up 57 s; restart -> first successful probe sample 62 s; restart -> rule Normal ~1 m 32-39 s; probe-observed outage 16:05:20 -> 16:10:50 (5 m 30 s). Configured worst-case detection = scrape 30 s + evaluation 30 s + pending 60 s + group_wait 10 s = 2 m 10 s; observed ~2 m.
|
||||
- 16:12 (12:12 PM EDT) Discord "[RESOLVED] HTTPS service down SRE https://ci.yebilly.me/login", Value A=1, C=0 (resolved by evaluation, no state-reason override) (screenshot). Notification receipt -> resolved message ~5 m.
|
||||
- 16:11:46 laptop: https://ci.yebilly.me/login 200 0.254 s; https://git.yebilly.me/user/login 200 0.050 s.
|
||||
|
||||
## Restart persistence 2026-10-28 (UTC)
|
||||
|
||||
- Before 16:12:05: oldest TSDB sample 14:52:16; 160 `up{job="prometheus"}` samples in 2 h; dashboard Group 1 SRE v2 (7 panels); data source Prometheus http://prometheus:9090; rules HTTPS service down + Root disk space low (inactive); contact point team-alerts.
|
||||
- 16:12:09 `docker compose restart prometheus`; answering 16:12:15. After: oldest sample still 14:52:16 (history kept on volume monitoring_prometheus_data). Raw scrapes node 16:11:36, 16:12:06, 16:12:36, 16:13:06; https 16:11:50, 16:12:20, 16:12:50: no gap > 35 s (restart fell between scrapes).
|
||||
- 16:12:56 `docker compose restart grafana`; at 16:13:44 dashboard v2 7 panels, data source, both rules, contact point all present; admin login unchanged (volume monitoring_grafana_data). A restart shows persistence, not a backup restore.
|
||||
|
||||
## SLI short window around the incident (UTC)
|
||||
|
||||
- Window [10m] 16:03:00-16:13:00, evaluation time 2026-10-28 16:13:00 UTC, scrape interval 30 s (expected ~20 samples). Queries: 100*avg_over_time(probe_success{job="https",instance="<url>"}[10m]), count_over_time(...), sum_over_time(...).
|
||||
- Gitea https://git.yebilly.me/user/login: 100% (20 received, 20 successes).
|
||||
- Jenkins https://ci.yebilly.me/login: 45% (20 received, 9 successes, 11 failures). Raw: 1 at 16:03:20-16:04:50; 0 at 16:05:20-16:10:20; 1 at 16:10:50-16:12:50. No missing samples, so no unknown time; boundary: the first sample in the window is 16:03:20.
|
||||
- (First attempt evaluated at the wrong epoch, 16:23:00, giving 100%/20 for both; rerun with date -d.)
|
||||
|
||||
## Post-recovery verification (UTC)
|
||||
|
||||
- Billy pushed b6cf080 (d3a5e6b..b6cf080) after re-authorising Git Credential Manager (stale OAuth refresh token removed).
|
||||
- Gitea status vpn-dns-gateway/pipeline/head on b6cf080: pending 16:36:27, success 16:37:08 (webhook + status integration working after the outage).
|
||||
- Jenkins feature/issue-19-monitoring #2: start 16:36:34.6, duration 33.923 s, SUCCESS, "Ran 2 tests ... OK", commit b6cf08061815acd628bf3caaa90e38c46d57a8e7 (slower than #1's 11.8 s, consistent with swap pressure after the restarts).
|
||||
- Manual PDF build (Gitea Actions, runner latex-local on Vincent's laptop) runs only on pushes to main; it is verified at merge.
|
||||
|
||||
## Improvement issues from the blameless review
|
||||
|
||||
- #20 "Add an off-droplet uptime check for git, ci, and metrics" (priority 1, owner @vsun1) and #21 "Remove swap churn on The-Ocean (memory headroom)" (priority 2, owner @bill), opened by bill 2026-10-28.
|
||||
|
||||
## 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.
|
||||
|
||||
## 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.
|
||||
|
||||
## Review gate on PR #22 (UTC)
|
||||
|
||||
- PR #22 feature/issue-19-monitoring -> main, opened by Billy.
|
||||
- Gitea reviews: vsun1 APPROVED 17:09:21 (head b6cf080) and 17:13:53 (head 336eaae); each dismissed as stale when a later commit arrived (branch protection dismisses stale approvals).
|
||||
- vpn-dns-gateway/pipeline/pr-main: success on 336eaae at 17:12:32; success on 249488d by 17:54:22. Merge still requires a fresh approval of the final head.
|
||||
- 17:56 live verification: deployed config files byte-identical to Git (9 files, SHA-256); running containers match documented users, memory caps, networks, no host ports except Caddy, no Docker socket, not privileged; image digests match pins; 3 alert rules in grafana.db (for 60 s / 60 s / 300 s, no data -> Alerting, error -> Error); users billy (admin), vsun1; 0 OOM events.
|
||||
@@ -0,0 +1,147 @@
|
||||
# Monitoring (Assignment 7 / Instructor Manual Chapter 5)
|
||||
|
||||
Prometheus, Grafana OSS, Node Exporter, and Blackbox Exporter on the droplet
|
||||
**The-Ocean**, beside Gitea, Jenkins, and Caddy (`deploy/`). Grafana is the only
|
||||
web entry point: `https://metrics.yebilly.me` (same allowlist as Jenkins, then
|
||||
Grafana login). No monitoring port is published on the host.
|
||||
|
||||
| Service | Image (pinned in `compose.yaml`) | Private address | Networks | Memory cap | State |
|
||||
|---|---|---|---|---|---|
|
||||
| Prometheus | `prom/prometheus:v3.15.1` | `prometheus:9090` | monitoring | 128 MiB | volume `monitoring_prometheus_data` (7 d / 500 MB) |
|
||||
| Grafana OSS | `grafana/grafana:13.2.5` | `grafana:3000` | monitoring, `gitea_web` | 192 MiB | volume `monitoring_grafana_data` |
|
||||
| Node Exporter | `quay.io/prometheus/node-exporter:v1.12.1` | `node-exporter:9100` | monitoring | 32 MiB | none (read-only host `/`) |
|
||||
| Blackbox Exporter | `quay.io/prometheus/blackbox-exporter:v0.29.1` | `blackbox-exporter:9115`, `172.30.90.10` | monitoring, `gitea_probe` | 32 MiB | none |
|
||||
|
||||
Configuration in Git: `prometheus/prometheus.yml`, `blackbox/blackbox.yml`,
|
||||
`grafana/provisioning/` (data source, dashboard provider, alert rules, contact
|
||||
point), and `grafana/dashboards/sre.json`. Provisioned items are read-only in
|
||||
the UI; change them here, copy to the droplet, and restart Grafana.
|
||||
|
||||
## Secrets (never in Git)
|
||||
|
||||
`~/monitoring/.env.secret` on the droplet, mode `600`, owner root:
|
||||
|
||||
```
|
||||
GF_SECURITY_ADMIN_PASSWORD=<from the team password manager>
|
||||
DISCORD_WEBHOOK_URL=<webhook for #devops-alerts>
|
||||
```
|
||||
|
||||
The admin password applies only when Grafana first creates its database. At
|
||||
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
|
||||
|
||||
Prerequisite: `deploy/` is current on the droplet and Caddy has been recreated
|
||||
once (`cd ~/gitea && docker compose up -d caddy`), which creates the
|
||||
`gitea_probe` network and the `metrics.yebilly.me` route.
|
||||
|
||||
```bash
|
||||
scp -r monitoring root@<droplet-ip>:~/monitoring # from the laptop
|
||||
cd ~/monitoring && chmod 700 .
|
||||
# scp from Windows creates 700 directories; Grafana (uid 472) must read its config.
|
||||
find grafana prometheus blackbox -type d -exec chmod 755 {} + && find grafana prometheus blackbox -type f -exec chmod 644 {} +
|
||||
install -m 600 /dev/null .env.secret && nano .env.secret # typed by a team member
|
||||
docker compose config --quiet
|
||||
docker compose pull
|
||||
docker compose run --rm --no-deps --entrypoint /bin/promtool prometheus check config /etc/prometheus/prometheus.yml
|
||||
docker compose up -d
|
||||
docker compose ps
|
||||
docker compose logs --tail=50 prometheus grafana node-exporter blackbox-exporter
|
||||
docker image inspect --format '{{.RepoDigests}}' prom/prometheus:v3.15.1 # repeat per image
|
||||
```
|
||||
|
||||
Startup order does not matter: Grafana retries the data source and Prometheus
|
||||
retries scrapes. All four services restart `unless-stopped`.
|
||||
|
||||
## Operate, update, back up, roll back
|
||||
|
||||
- Pause/resume: `docker compose stop` / `docker compose start`. **Never**
|
||||
`docker compose down -v`; it deletes both named volumes.
|
||||
- Config change: edit in Git, copy the file, then
|
||||
`docker compose restart prometheus` (or `grafana`). Validate Prometheus config
|
||||
with the `promtool` line above first.
|
||||
- Upgrade one image at a time: back up, read the release notes, change the tag
|
||||
and digest in `compose.yaml`, `docker compose pull <svc> && docker compose up -d <svc>`,
|
||||
then check targets, dashboard, and alert rules. Do not assume an older Grafana
|
||||
or Prometheus can read data written by a newer one: restore the backup instead.
|
||||
- Contact-point test (the provisioned contact point has no Test button in the UI;
|
||||
Grafana 13 removed the old test endpoint). Sends one message to `#devops-alerts`
|
||||
using the stored URL, which is never printed:
|
||||
|
||||
```bash
|
||||
GIP=$(docker inspect monitoring-grafana-1 --format '{{(index .NetworkSettings.Networks "monitoring_monitoring").IPAddress}}')
|
||||
read -rs -p 'Grafana password for billy: ' P; echo # typed, never stored
|
||||
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}}}' \
|
||||
"http://$GIP:3000/apis/notifications.alerting.grafana.app/v1beta1/namespaces/default/receivers/dGVhbS1hbGVydHM/test"
|
||||
unset P # expect {"status":"success",...}; dGVhbS1hbGVydHM is base64 of "team-alerts"
|
||||
```
|
||||
|
||||
- Backup (state not rebuildable from Git: Grafana users/passwords, alert state,
|
||||
metric history):
|
||||
|
||||
```bash
|
||||
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:3.22 tar czf /b/monitoring-$(date -u +%Y%m%dT%H%M%SZ).tgz /g /p
|
||||
docker compose start grafana prometheus
|
||||
```
|
||||
|
||||
Restore (same image versions only): `docker compose stop grafana prometheus`,
|
||||
empty both volumes, then
|
||||
`docker run --rm -v monitoring_grafana_data:/g -v monitoring_prometheus_data:/p -v /root/backups:/b alpine:3.22 tar xzf /b/monitoring-<stamp>.tgz -C /`
|
||||
and `docker compose start grafana prometheus`.
|
||||
|
||||
- Remove the stack entirely: `docker compose stop && docker compose rm -f`
|
||||
(volumes kept), then revert the `metrics` block and probe allowlist entry in
|
||||
`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
|
||||
|
||||
Alert `HTTPS service down` (critical, owner Billy, backup Vincent): a login
|
||||
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.
|
||||
2. Open the `Group 1 SRE` dashboard. Is only one service down, or both?
|
||||
- Both down, and the scrape health panel also shows failures: check Caddy and the droplet first.
|
||||
- Missing data rather than 0: the monitoring stack itself is failing (`docker compose ps` in `~/monitoring`).
|
||||
3. On the droplet: `cd ~/gitea && docker compose ps`, then `docker compose logs --tail=50 <gitea|jenkins|caddy>`.
|
||||
4. If the service container is stopped: `docker compose start <service>`. If it
|
||||
is running but unhealthy: `docker compose restart <service>`. Never use
|
||||
`down -v`.
|
||||
5. Confirm the probe returns to 1 and Discord shows the resolved message. For
|
||||
Jenkins, also run a pipeline and confirm the Gitea status check.
|
||||
6. Record the timeline in the incident log or manual.
|
||||
|
||||
## Runbook: Root disk space low
|
||||
|
||||
Alert `Root disk space low` (warning, owner Billy): available space on `/`
|
||||
(`/dev/vda1`, ext4) has stayed below 15% for 5 minutes. 15% of 24.9 GB is
|
||||
about 3.7 GB: enough to act before Gitea, Jenkins, or Prometheus fail to write.
|
||||
|
||||
1. Acknowledge in `#devops-alerts`.
|
||||
2. `df -h /` and `docker system df` to find the growth.
|
||||
3. Safe first actions: `docker builder prune` (build cache), `journalctl --vacuum-size=200M`,
|
||||
remove obsolete images with `docker image prune`. Do not delete volumes.
|
||||
4. Prometheus is capped at 500 MB / 7 days; if it is the cause, lower the cap
|
||||
rather than deleting its volume.
|
||||
5. If space cannot be recovered, plan a disk resize (permanent, costs more) with the team.
|
||||
@@ -0,0 +1,14 @@
|
||||
# Success = DNS answer, valid certificate for the hostname, redirects followed,
|
||||
# and a final 2xx on the login page. TLS verification stays on.
|
||||
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
|
||||
@@ -0,0 +1,97 @@
|
||||
# Monitoring stack on The-Ocean (Assignment 7 / Instructor Manual Chapter 5).
|
||||
# Four project-published images, pinned by tag and digest (the repository ignores
|
||||
# .env files, so versions live here). No service publishes a host port:
|
||||
# Caddy reaches grafana:3000 on gitea_web; Prometheus and the exporters stay on
|
||||
# the private "monitoring" network. Pause with stop/start; never "down -v".
|
||||
name: monitoring
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:v3.15.1@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=7d
|
||||
- --storage.tsdb.retention.size=500MB # whichever limit is hit first
|
||||
environment:
|
||||
- GOMEMLIMIT=96MiB # Go GC target below the container cap
|
||||
volumes:
|
||||
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus_data:/prometheus
|
||||
networks: [monitoring]
|
||||
mem_limit: 128m
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:13.2.5@sha256:9f7aa1e1e3246aade5792d35a738049f7f32f89cd51d1956cf426a4e86268a84
|
||||
restart: unless-stopped
|
||||
# Root-only, untracked: GF_SECURITY_ADMIN_PASSWORD and DISCORD_WEBHOOK_URL (see README).
|
||||
env_file: [.env.secret]
|
||||
environment:
|
||||
GF_SERVER_ROOT_URL: https://metrics.yebilly.me/
|
||||
GF_SECURITY_ADMIN_USER: billy
|
||||
GF_SECURITY_COOKIE_SECURE: "true"
|
||||
GF_SECURITY_DISABLE_GRAVATAR: "true"
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "false"
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
GF_METRICS_ENABLED: "false" # no public /metrics through the HTTPS hostname
|
||||
# 1 GiB droplet: skip plugin downloads, news, and phone-home checks.
|
||||
GF_PLUGINS_PREINSTALL_DISABLED: "true"
|
||||
GF_NEWS_NEWS_FEED_ENABLED: "false"
|
||||
GF_ANALYTICS_REPORTING_ENABLED: "false"
|
||||
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
|
||||
GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false"
|
||||
GOMEMLIMIT: 150MiB
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./grafana/dashboards:/var/lib/grafana-dashboards:ro
|
||||
networks: [monitoring, web]
|
||||
mem_limit: 192m
|
||||
|
||||
node-exporter:
|
||||
image: quay.io/prometheus/node-exporter:v1.12.1@sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0
|
||||
restart: unless-stopped
|
||||
pid: host
|
||||
command:
|
||||
- --path.rootfs=/host
|
||||
- --path.procfs=/host/proc
|
||||
- --path.sysfs=/host/sys
|
||||
# Only what the dashboard and alerts use: CPU, memory, root disk.
|
||||
- --collector.disable-defaults
|
||||
- --collector.cpu
|
||||
- --collector.meminfo
|
||||
- --collector.filesystem
|
||||
- --collector.loadavg
|
||||
- --collector.uname
|
||||
volumes:
|
||||
- /:/host:ro,rslave # read-only host view; no Docker socket, not privileged
|
||||
networks: [monitoring]
|
||||
mem_limit: 32m
|
||||
|
||||
blackbox-exporter:
|
||||
image: quay.io/prometheus/blackbox-exporter:v0.29.1@sha256:ea1c7aa3ef3f307cd03e85f34abb604478ccb90b567fc690da0cd9776da76b13
|
||||
restart: unless-stopped
|
||||
user: "65534:65534" # image default is root; HTTP probes need no privileges
|
||||
command: ["--config.file=/config/blackbox.yml"]
|
||||
volumes:
|
||||
- ./blackbox/blackbox.yml:/config/blackbox.yml:ro
|
||||
networks:
|
||||
monitoring:
|
||||
probe:
|
||||
# The only private address allowed past the ci.yebilly.me allowlist.
|
||||
ipv4_address: 172.30.90.10
|
||||
mem_limit: 32m
|
||||
|
||||
networks:
|
||||
monitoring:
|
||||
web:
|
||||
external: true
|
||||
name: gitea_web
|
||||
probe:
|
||||
external: true
|
||||
name: gitea_probe # defined in deploy/docker-compose.yml; Caddy answers git/ci there
|
||||
|
||||
volumes:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
@@ -0,0 +1,30 @@
|
||||
# External TCP evidence, 28 October 2026
|
||||
|
||||
Vincent ran the PowerShell loop in the Codex conversation on his external
|
||||
Wi-Fi connection, outside SSH. `ports-20261028-154000.csv` retains all 18
|
||||
connection outcomes and UTC completion timestamps from that run. Only the
|
||||
local Wi-Fi name in `Network` has been replaced by a generic description;
|
||||
the original CSV is retained under ignored `build/evidence/assignment7-port-tests/`.
|
||||
|
||||
The tests ran 19:32:40-19:40:00 UTC (15:32:40-15:40:00 EDT). TCP 443 and 80
|
||||
succeeded on both droplet addresses. TCP 3000, 3001, 8080, 9090, 9100, 9115,
|
||||
and 50000 failed on both. The 443 controls passed before the negative tests.
|
||||
These results establish reachability from the tested client network at that
|
||||
time; they do not identify which networking layer blocked a connection or
|
||||
test TLS, redirects, or application authentication.
|
||||
|
||||
`test-ports.ps1` preserves the executed loop as a reusable script, with network
|
||||
description and output location exposed as parameters. This saved script was
|
||||
syntax-checked; the historical evidence comes from Vincent's earlier run of
|
||||
the conversational loop, not a subsequent execution of this file.
|
||||
|
||||
To repeat from repository root in Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
./monitoring/evidence/test-ports.ps1 -NetworkDescription 'External Wi-Fi'
|
||||
```
|
||||
|
||||
A failed HTTPS control makes that address family's remaining tests
|
||||
inconclusive and skips them. Keep the new date and results; do not replace
|
||||
the historical evidence. See Microsoft's
|
||||
[Test-NetConnection documentation](https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection?view=windowsserver2025-ps).
|
||||
@@ -0,0 +1,19 @@
|
||||
TimeUTC,Network,Target,Port,ExpectedReachable,TcpTestSucceeded,Result
|
||||
2026-10-28T19:32:40.4700276Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,443,True,True,MATCH
|
||||
2026-10-28T19:32:49.7334208Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,80,True,True,MATCH
|
||||
2026-10-28T19:33:24.9527541Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,3000,False,False,MATCH
|
||||
2026-10-28T19:34:00.0160397Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,3001,False,False,MATCH
|
||||
2026-10-28T19:34:35.0118147Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,8080,False,False,MATCH
|
||||
2026-10-28T19:35:10.1101959Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,9090,False,False,MATCH
|
||||
2026-10-28T19:35:44.9897149Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,9100,False,False,MATCH
|
||||
2026-10-28T19:36:19.9643517Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,9115,False,False,MATCH
|
||||
2026-10-28T19:36:54.9233170Z,External Wi-Fi (Vincent laptop; local network name redacted),147.182.178.136,50000,False,False,MATCH
|
||||
2026-10-28T19:36:55.4230345Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,443,True,True,MATCH
|
||||
2026-10-28T19:36:55.8361207Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,80,True,True,MATCH
|
||||
2026-10-28T19:37:22.1944035Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,3000,False,False,MATCH
|
||||
2026-10-28T19:37:48.6712583Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,3001,False,False,MATCH
|
||||
2026-10-28T19:38:15.0191304Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,8080,False,False,MATCH
|
||||
2026-10-28T19:38:41.1817674Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,9090,False,False,MATCH
|
||||
2026-10-28T19:39:07.6837526Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,9100,False,False,MATCH
|
||||
2026-10-28T19:39:34.1413090Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,9115,False,False,MATCH
|
||||
2026-10-28T19:40:00.0333941Z,External Wi-Fi (Vincent laptop; local network name redacted),2604:a880:400:d1:0:5:22d:6001,50000,False,False,MATCH
|
||||
|
@@ -0,0 +1,39 @@
|
||||
param(
|
||||
[Parameter(Mandatory)][string]$NetworkDescription,
|
||||
[string]$OutputDirectory = 'build/evidence/assignment7-port-tests'
|
||||
)
|
||||
|
||||
# Run on an external Windows client, outside the droplet's SSH session.
|
||||
# Use a generic network description; do not include a personal address or SSID.
|
||||
$targets = @('147.182.178.136', '2604:a880:400:d1:0:5:22d:6001')
|
||||
$results = @()
|
||||
foreach ($target in $targets) {
|
||||
foreach ($port in @(443, 80, 3000, 3001, 8080, 9090, 9100, 9115, 50000)) {
|
||||
Write-Host "Testing $target port $port..."
|
||||
$test = Test-NetConnection -ComputerName $target -Port $port `
|
||||
-InformationLevel Detailed -WarningAction SilentlyContinue
|
||||
$reachable = [bool]$test.TcpTestSucceeded
|
||||
$expected = $port -in @(80, 443)
|
||||
$result = [pscustomobject]@{
|
||||
TimeUTC = (Get-Date).ToUniversalTime().ToString('o')
|
||||
Network = $NetworkDescription
|
||||
Target = $target
|
||||
Port = $port
|
||||
ExpectedReachable = $expected
|
||||
TcpTestSucceeded = $reachable
|
||||
Result = if ($port -eq 443 -and !$reachable) {
|
||||
'INCONCLUSIVE: HTTPS control failed'
|
||||
} elseif ($reachable -eq $expected) { 'MATCH' } else { 'UNEXPECTED' }
|
||||
}
|
||||
$results += $result
|
||||
$result | Format-Table Target, Port, TcpTestSucceeded, Result -AutoSize
|
||||
if ($port -eq 443 -and !$reachable) {
|
||||
Write-Host 'Skipping remaining ports for this address.'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path $OutputDirectory | Out-Null
|
||||
$file = Join-Path $OutputDirectory ("ports-{0}.csv" -f (Get-Date -Format 'yyyyMMdd-HHmmss'))
|
||||
$results | Export-Csv -LiteralPath $file -NoTypeInformation
|
||||
Write-Host "Results saved to $file"
|
||||
@@ -0,0 +1,578 @@
|
||||
{
|
||||
"uid": "group1-sre",
|
||||
"title": "Group 1 SRE",
|
||||
"tags": [
|
||||
"sre",
|
||||
"assignment7"
|
||||
],
|
||||
"timezone": "America/New_York",
|
||||
"refresh": "30s",
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"schemaVersion": 41,
|
||||
"version": 1,
|
||||
"editable": false,
|
||||
"graphTooltip": 1,
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "timeseries",
|
||||
"title": "Droplet CPU utilization (%)",
|
||||
"description": "Whole-droplet CPU busy %, averaged across CPUs: 100 minus the idle-time rate over 2m. Counts every workload on the host, not one container. The I/O wait line is the part spent waiting on disk (on this 1 GiB droplet, mostly swap-in), not computation.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percent",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "linear",
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0,
|
||||
"max": 100
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "100 * (1 - avg(rate(node_cpu_seconds_total{job=\"node\",mode=\"idle\"}[2m])))",
|
||||
"legendFormat": "CPU busy"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "100 * avg(rate(node_cpu_seconds_total{job=\"node\",mode=\"iowait\"}[2m]))",
|
||||
"legendFormat": "of which I/O wait"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "timeseries",
|
||||
"title": "Available memory (bytes)",
|
||||
"description": "MemAvailable: the kernel's estimate of memory available to start new applications without swapping (not just unused RAM).",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "bytes",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "linear",
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 104857600
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "node_memory_MemAvailable_bytes{job=\"node\"}",
|
||||
"legendFormat": "available"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "timeseries",
|
||||
"title": "Root filesystem available (%)",
|
||||
"description": "Available bytes / size bytes for the host root filesystem (/dev/vda1, ext4, mounted at /). Alert fires below 15% for 5m.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percent",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "linear",
|
||||
"thresholdsStyle": {
|
||||
"mode": "line"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "red",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "green",
|
||||
"value": 15
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0,
|
||||
"max": 100
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "100 * node_filesystem_avail_bytes{job=\"node\",mountpoint=\"/\",fstype=\"ext4\"} / node_filesystem_size_bytes{job=\"node\",mountpoint=\"/\",fstype=\"ext4\"}",
|
||||
"legendFormat": "/ available"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "timeseries",
|
||||
"title": "Gitea HTTPS availability (probe_success)",
|
||||
"description": "1 = Blackbox Exporter fetched the Gitea login page with valid TLS and a 2xx; 0 = the probe failed.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "none",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "stepAfter",
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_success{job=\"https\",instance=\"https://git.yebilly.me/user/login\"}",
|
||||
"legendFormat": "Gitea"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "timeseries",
|
||||
"title": "Jenkins HTTPS availability (probe_success)",
|
||||
"description": "1 = Blackbox Exporter fetched the Jenkins login page with valid TLS and a 2xx; 0 = the probe failed.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "none",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "stepAfter",
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_success{job=\"https\",instance=\"https://ci.yebilly.me/login\"}",
|
||||
"legendFormat": "Jenkins"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"type": "timeseries",
|
||||
"title": "HTTPS probe duration (s)",
|
||||
"description": "Total time of each probe (DNS, connect, TLS, request), one line per service.",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "linear",
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_duration_seconds{job=\"https\",instance=\"https://git.yebilly.me/user/login\"}",
|
||||
"legendFormat": "Gitea"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "probe_duration_seconds{job=\"https\",instance=\"https://ci.yebilly.me/login\"}",
|
||||
"legendFormat": "Jenkins"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"type": "timeseries",
|
||||
"title": "Scrape health (up)",
|
||||
"description": "Optional: 1 = Prometheus scraped the target. For the https job, up=1 can coexist with probe_success=0 (collection worked, the probed request failed).",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 24,
|
||||
"w": 24,
|
||||
"h": 6
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "none",
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 10,
|
||||
"showPoints": "never",
|
||||
"lineInterpolation": "stepAfter",
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"min": 0,
|
||||
"max": 1,
|
||||
"mappings": [
|
||||
{
|
||||
"type": "value",
|
||||
"options": {
|
||||
"0": {
|
||||
"text": "DOWN",
|
||||
"color": "red"
|
||||
},
|
||||
"1": {
|
||||
"text": "UP",
|
||||
"color": "green"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "multi",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"expr": "up",
|
||||
"legendFormat": "{{job}} {{instance}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
# Grafana-managed alerts. Grafana expands $VAR in the contact point, which keeps the
|
||||
# webhook URL out of Git; templates use .Labels instead of $labels to avoid "$".
|
||||
apiVersion: 1
|
||||
|
||||
contactPoints:
|
||||
- orgId: 1
|
||||
name: team-alerts
|
||||
receivers:
|
||||
- uid: team-alerts-discord
|
||||
type: discord
|
||||
settings:
|
||||
url: $DISCORD_WEBHOOK_URL # from the untracked .env.secret
|
||||
disableResolveMessage: false # resolved notifications on
|
||||
|
||||
groups:
|
||||
- orgId: 1
|
||||
name: sre
|
||||
folder: SRE
|
||||
interval: 30s # matches the scrape interval
|
||||
rules:
|
||||
- uid: https-service-down
|
||||
title: HTTPS service down
|
||||
condition: C
|
||||
data:
|
||||
- refId: A
|
||||
relativeTimeRange: {from: 300, to: 0}
|
||||
datasourceUid: prometheus
|
||||
model:
|
||||
refId: A
|
||||
expr: probe_success{job="https"}
|
||||
instant: true
|
||||
- refId: C
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
refId: C
|
||||
type: threshold
|
||||
expression: A
|
||||
conditions:
|
||||
- evaluator: {type: lt, params: [1]}
|
||||
for: 1m
|
||||
# A missing series or a failed query is a monitoring failure, not health.
|
||||
noDataState: Alerting
|
||||
execErrState: Error
|
||||
labels: {severity: critical, owner: billy}
|
||||
annotations:
|
||||
summary: "{{ .Labels.instance }} HTTPS probe is failing"
|
||||
description: "probe_success has been 0 for at least 1 minute. Owner: Billy (backup: Vincent)."
|
||||
runbook_url: https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md#runbook-https-service-down
|
||||
notification_settings:
|
||||
receiver: team-alerts
|
||||
group_by: [alertname, instance]
|
||||
group_wait: 10s
|
||||
group_interval: 1m
|
||||
repeat_interval: 4h
|
||||
|
||||
- uid: root-disk-low
|
||||
title: Root disk space low
|
||||
condition: C
|
||||
data:
|
||||
- refId: A
|
||||
relativeTimeRange: {from: 300, to: 0}
|
||||
datasourceUid: prometheus
|
||||
model:
|
||||
refId: A
|
||||
expr: 100 * node_filesystem_avail_bytes{job="node",mountpoint="/",fstype="ext4"} / node_filesystem_size_bytes{job="node",mountpoint="/",fstype="ext4"}
|
||||
instant: true
|
||||
- refId: C
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
refId: C
|
||||
type: threshold
|
||||
expression: A
|
||||
conditions:
|
||||
- evaluator: {type: lt, params: [15]}
|
||||
for: 5m
|
||||
noDataState: Alerting
|
||||
execErrState: Error
|
||||
labels: {severity: warning, owner: billy}
|
||||
annotations:
|
||||
summary: "Root filesystem on The-Ocean below 15% free"
|
||||
description: "Available space on / has stayed under 15% for 5 minutes. Owner: Billy (backup: Vincent)."
|
||||
runbook_url: https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/src/branch/main/monitoring/README.md#runbook-root-disk-space-low
|
||||
notification_settings:
|
||||
receiver: team-alerts
|
||||
group_by: [alertname]
|
||||
group_wait: 10s
|
||||
group_interval: 1m
|
||||
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
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: 1
|
||||
providers:
|
||||
- name: sre
|
||||
folder: SRE
|
||||
type: file
|
||||
allowUiUpdates: false # Git is the source of truth for the dashboard
|
||||
options:
|
||||
path: /var/lib/grafana-dashboards
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: 1
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
uid: prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090 # service name; localhost would be the Grafana container
|
||||
isDefault: true
|
||||
editable: false
|
||||
jsonData:
|
||||
timeInterval: 30s
|
||||
@@ -0,0 +1,30 @@
|
||||
global:
|
||||
scrape_interval: 30s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ["prometheus:9090"]
|
||||
- job_name: node
|
||||
static_configs:
|
||||
- targets: ["node-exporter:9100"]
|
||||
- job_name: blackbox
|
||||
static_configs:
|
||||
- targets: ["blackbox-exporter:9115"]
|
||||
# Multi-target pattern: each URL becomes the probe target and the instance label;
|
||||
# the scrape itself goes to Blackbox Exporter's /probe endpoint.
|
||||
- job_name: https
|
||||
metrics_path: /probe
|
||||
params:
|
||||
module: [http_2xx]
|
||||
static_configs:
|
||||
- targets:
|
||||
- https://git.yebilly.me/user/login
|
||||
- https://ci.yebilly.me/login
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: blackbox-exporter:9115
|
||||