Cloud Monitoring & Cost Management
GCP Fundamentals
Chapter 9 · Cloud Monitoring & Cost Management
AWS Fundamentals Chapter 9 covered CloudWatch's real memory-and-disk-space collection gap and Budgets' alert-only behavior. Azure Fundamentals Chapter 9 covered Azure Monitor's own richer four-layer model and Budgets' identically alert-only behavior, paired with Action Groups for real automated response. GCP's own story confirms the same recurring pattern a third time — and then genuinely goes one step further on the automation side.
Cloud Monitoring: Automatic Metrics vs. the Ops Agent
Cloud Monitoring automatically collects real system metrics for Compute Engine VMs — CPU utilization and disk usage, with no setup required. But detailed system metrics, application metrics, third-party application metrics (Apache, Nginx, MongoDB, PostgreSQL, and others), and any custom instrumentation all require installing the real Ops Agent on the VM first.
Alerting Policies
An alerting policy triggers when a chosen metric crosses a defined threshold (e.g. CPU above 80%), routing notifications to email, Slack, PagerDuty, or other channels, and creates a real, persistent incident record for tracking and troubleshooting — a distinctly named concept GCP uses explicitly, where AWS and Azure both lean more on the underlying alarm/alert object itself. Alerting policies can be configured via the console, API, CLI, or Terraform, and many Google Cloud services come with pre-configured alerting recommendations already available.
Cloud Billing Budgets: Alerts, Not a Spending Cap
A standard Cloud Billing budget is alerts-only by default. Google's own real documentation states plainly that an alerts-only budget "doesn't automatically cap Google Cloud... usage or spending" — it exists purely to inform, triggering email notifications at real, configurable thresholds (the real default set is 50%, 90%, and 100% of the budget) as actual or forecasted spend crosses them.
Budgets can also publish real Pub/Sub notifications at each threshold — a downstream Cloud Function (Chapter 7) can subscribe to that topic to automate a real response, such as programmatically disabling billing on a project, echoing Azure's own Action Group-attached-to-a-budget pattern, but built from GCP's own Pub/Sub-plus-function pieces rather than one native attachment point.
A Genuine Step Further: Spend Cap Budgets
Three Monitoring & Budget Models, Compared
| Property | AWS | Azure | GCP |
|---|---|---|---|
| Memory metrics by default | No — needs CloudWatch Agent | No — needs Azure Monitor Agent | No — needs Ops Agent |
| Default budget behavior | Alerts only | Alerts only | Alerts only |
| Built-in automated stop option | None native — build via SNS + Lambda | None native — attach an Action Group | Spend cap budgets (preview) can pause a service directly |
Hands-On Exercises
A team notices their Cloud Monitoring dashboard shows no memory-usage data for their Compute Engine VMs, despite CPU and disk usage showing up correctly. Explain, in your own words, why this is happening, and what real step fixes it.
📄 View solutionA team sets a standard, alerts-only Cloud Billing budget of $1,000/month, and is surprised when their actual spend reaches $1,500 with no service interruption. Explain, in your own words, why this happened, and what real alternative budget type would have actually stopped spending.
📄 View solutionA team wants their Cloud Billing budget to automatically disable billing on a project once spend hits 100%, without using GCP's own preview spend-cap feature. Explain, in your own words, what real combination of services they would need to build this themselves.
📄 View solutionChapter 9 Quick Reference
- Cloud Monitoring — automatic CPU/disk metrics; memory, detailed, and third-party metrics need the Ops Agent (completing a real three-way "memory needs an agent" pattern with AWS and Azure)
- Alerting policies create a named incident record and route to email/Slack/PagerDuty
- Cloud Billing budgets are alerts-only by default (50/90/100% thresholds) — confirmed the same real behavior as AWS Budgets and Azure Budgets, none of which stop spending by default
- Pub/Sub-triggered budget notifications can drive a real Cloud Function to programmatically respond
- Real, distinguishing extra: a preview spend cap budget type that can actually pause a service — more built-in than AWS's or Azure's own native options