\chapter{Service Monitoring and Reliability} \ChapterLabel{Monitoring} \index{monitoring}\index{Prometheus}\index{Grafana} This chapter records the Chapter 5 deployment on October 30, 2026. The single-operator team uses the existing AWS Lightsail \texttt{Gitea-Project} instance. The monitoring configuration is in the draft \href{https://git.590hcm.dev/SSW590Team/pricing-app/pulls/4}{pricing-app pull request 4}. The host is also the failure domain for Gitea and Jenkins; a host outage would interrupt this monitoring stack. The status below separates observed results from tests that are still pending. \section{Deployment and Architecture} The host runs Ubuntu 24.04.4, two virtual CPUs, 2 GB RAM, and a 60 GB root disk. Docker Compose deploys Prometheus 3.15.1, Grafana OSS 13.2.4, Node Exporter 1.12.1, and Blackbox Exporter 0.29.1 alongside Gitea, Jenkins, its Python agent, the Actions runner, and Caddy. Monitoring ports are private to Docker. Prometheus and Grafana use persistent named volumes. Grafana authenticates users; anonymous access and signup are disabled. Its administrator password is a host-only, read-only mounted secret and is excluded from Git. The default credential was rejected in a live API check. The 2 GB host reached 274 MiB available RAM during a normal Jenkins build before Grafana started. A persistent 2 GiB swap file was added. At 23:00 UTC, with all four monitoring containers running, 592 MiB RAM was available and 687 MiB swap was in use. Grafana used approximately 207 MiB, Prometheus 43 MiB, Node Exporter 13 MiB, and Blackbox Exporter 19 MiB in one sample. This is a point observation, not a sustained load test; build-time swap and latency must continue to be checked. \section{Collection and Dashboard Evidence} Prometheus reported all five configured scrape targets up. The Gitea login HTTPS probe passed with HTTP 200 and valid TLS. The Jenkins login probe returned HTTP 403 because Caddy currently permits Jenkins access only through an SSH tunnel. This failure reflects the probe access policy and must not be reported as a Jenkins outage. A narrow internal \texttt{/login} exception is proposed but has not been applied. The existing public restriction remains. Grafana's provisioned dashboard has six live-tested panels: whole-host CPU, available host memory, available root disk percentage, Gitea HTTPS availability, Jenkins HTTPS availability, and HTTPS probe duration. The root filesystem series uses device \texttt{/dev/root}, filesystem type \texttt{ext4}, and mountpoint \texttt{/}. The Jenkins panel currently shows zero because of the policy denial. Grafana is reachable on its private Docker address; public \texttt{metrics.590hcm.dev} DNS and the Caddy HTTPS route are pending. The authoritative DNS provider is Name.com. \section{SLI, SLO, and Alerting} The lab service-level indicator is the number of successful scheduled HTTPS probes divided by the number of received scheduled probes for each service and window. Missing samples are unknown and are not counted as successes. The proposed lab objective is at least 99\% probe success over 24 hours, separately for Gitea and Jenkins; this is not a customer SLA. At 30-second spacing, a complete day has 2,880 samples and a 1\% failure budget of 28.8 samples, or 14.4 minutes. For illustration only, 2,850 successes in 2,880 Jenkins probes yield 98.958\%, below the objective. No measured 24-hour result is claimed here. Two Grafana-managed rules are provisioned: an HTTPS probe failure for one minute, and root disk availability below 15\% for five minutes. Both mark missing data and evaluation errors as alerting. The owner email contact \texttt{mbarber1@stevens.edu} is provisioned with resolved messages enabled. Grafana OSS has no SMTP sender configured, so notification delivery has not been demonstrated. Routing and delivery should be tested only after a working mail transport is supplied and the Jenkins probe access issue is resolved. \section{Pending Exercise and Acceptance Evidence} A controlled Jenkins stop and restart remains pending. First verify that the Blackbox login probe can succeed without widening general public access and that no build is running. Then record UTC timestamps for the stop, first failed probe, alert firing, notification receipt, restart, first successful probe, and resolved message. Calculate detection and recovery intervals from those named events. Verify a passing Jenkins pipeline afterward. Restart Prometheus and Grafana separately without deleting volumes; confirm retained history, dashboard, data source, and rules. The incident review should state impact, cause, response, measurement gaps, and owned follow-ups. An independent external check is needed to cover failure of the shared host. The complete operator procedure and current evidence are in the \href{https://git.590hcm.dev/SSW590Team/pricing-app/src/branch/feature/issue-3-monitoring/monitoring/RUNBOOK.md}{monitoring runbook}. This chapter is a review draft until public Grafana HTTPS, trustworthy Jenkins probing, notification delivery, outage measurements, and final PDF validation are complete.