Ensuring the successful operation of a cloud solution · Topic 7 of 8
Monitoring, Alerting and Agents
Cloud Monitoring alerts and custom metrics, the Ops Agent, Managed Service for Prometheus, Personalized Service Health, Active Assist and Cloud Hub.
- 4 min
- Alerting policy = condition + notification channels (+ documentation).
- Uptime checks test availability from outside.
- Custom metrics come from the API or OpenTelemetry, from logs, or from Prometheus.
What it is
Cloud Monitoring collects metrics, shows dashboards and sends alerts. The exam covers alerting on resource metrics, custom metrics from applications and logs, the Ops Agent for VMs, Google Cloud Managed Service for Prometheus, the Personalized Service Health dashboard, and AI and recommendation tools: Gemini Cloud Assist, Active Assist and Cloud Hub.
How it works
Alerting policies
An alerting policy has a condition (for example "CPU utilization above 80 percent for 5 minutes"), notification channels (email, SMS, mobile app, Pub/Sub, webhooks, chat tools) and optional documentation for responders.
| Condition type | Example |
|---|---|
| Metric threshold | VM CPU above 80 percent for 5 minutes |
| Metric absence | No data from a VM for 10 minutes |
| Uptime check | A website fails health checks from several locations |
| Log-based | A specific error appears in logs |
"Be alerted when a website is unreachable from the internet" is an uptime check with an alerting policy.
Custom metrics
| Source | How |
|---|---|
| Application metrics | Write them with the Cloud Monitoring API, client libraries or OpenTelemetry |
| Log-based metrics | Count log entries matching a filter (counter) or extract values (distribution) in Cloud Logging |
| Prometheus metrics | Collect with Managed Service for Prometheus |
gcloud logging metrics create payment-errors \
--description="Payment failures" \
--log-filter='resource.type="cloud_run_revision" AND severity>=ERROR AND textPayload:"payment failed"'
A log-based metric can then drive an alerting policy.
Ops Agent
The Ops Agent is Google's single agent for Compute Engine VMs that collects logs and metrics (including memory and disk usage, which are not visible from the hypervisor, and third-party applications such as Apache, MySQL or Nginx). It replaces the older separate Monitoring and Logging agents.
You can install it on a VM directly, on many VMs with VM Manager OS policies, or when creating VMs in the console. Its configuration file selects which logs and metrics to collect.
Google Cloud Managed Service for Prometheus
A fully managed, scalable backend for Prometheus metrics. Teams keep using Prometheus exporters and PromQL, while Google handles storage and scaling. On GKE, managed collection is the simplest option; metrics appear in Cloud Monitoring alongside other metrics.
Personalized Service Health
The Personalized Service Health dashboard shows Google Cloud incidents that affect your projects, with updates and history, and can send alerts. It answers "Is this outage on our side or Google's?"
AI and recommendations
| Tool | What it does |
|---|---|
| Gemini Cloud Assist for Cloud Monitoring | Ask questions in natural language, get help building queries, and get explanations and troubleshooting suggestions |
| Active Assist | Google's recommendation portfolio: Recommender suggestions to right-size VMs, delete idle resources, remove excess IAM permissions, and use committed use discounts |
| Cloud Hub | A central view for application owners of active events, health and issues across their applications and resources |
gcloud recommender recommendations list --project=shop-prod-1234 \
--location=us-central1-a --recommender=google.compute.instance.MachineTypeRecommender
A worked scenario
An engineer installs the Ops Agent on all VMs through VM Manager to see memory use, creates an alerting policy on CPU and an uptime check on the public site, builds a log-based metric counting payment failures with an alert, and uses Managed Service for Prometheus on GKE. During an incident she checks Personalized Service Health to rule out a Google outage. Monthly, she reviews Active Assist recommendations and resizes idle VMs.
How the exam asks about this
- "Monitor VM memory usage." Install the Ops Agent.
- "Alert when a specific error appears in logs." A log-based metric (or log-based alert) with an alerting policy.
- "Keep using Prometheus without running its storage." Managed Service for Prometheus.
- "Is a Google Cloud incident affecting our project?" Personalized Service Health.
- "Find idle or oversized VMs." Active Assist recommendations.
What to remember for the exam
- Alerting policy = condition + notification channels (+ documentation).
- Uptime checks test availability from outside.
- Custom metrics come from the API or OpenTelemetry, from logs, or from Prometheus.
- The Ops Agent collects VM logs and metrics, including memory and third-party apps.
- Managed Service for Prometheus keeps Prometheus tooling with managed storage.
- Personalized Service Health shows Google incidents affecting you; Active Assist recommends optimizations; Cloud Hub gives an application-centric health view.
VM memory usage is not collected without the Ops Agent. Hypervisor metrics do not see inside the guest OS.
Common mistakes
Expecting memory metrics without an agent. Install the Ops Agent.
Alerting without notification channels. Nobody will see the alert.
Ignoring Active Assist. Its recommendations cut cost and excess permissions with little effort.
Check yourself
Which agent collects memory and disk usage metrics from Compute Engine VMs?
The Ops Agent.
How can you alert when a particular log message appears?
Create a log-based metric or log-based alert and an alerting policy on it.
What does Personalized Service Health show?
Google Cloud incidents that affect your own projects and services.
Topic 7 of 8 in Ensuring the successful operation of a cloud solution
Test yourself on Ensuring the successful operation of a cloud solution
The full Google Cloud Associate Cloud Engineer question bank has 661 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.