Monitoring & Logging
Google ACE ACE · Ensuring the successful operation of a cloud solution
Observability: metrics, logs, and traces
Google Cloud's operations suite (formerly Stackdriver) gives you three views into your systems: Cloud Monitoring collects metrics (numbers over time, such as CPU utilization or request latency) and raises alerts; Cloud Logging collects log entries (timestamped event records from services, VMs, and applications); and Cloud Trace and Cloud Profiler help diagnose latency and performance in application code. The exam guide focuses on Monitoring and Logging, and the operations questions test practical skills: creating alerts, building dashboards, writing custom metrics, routing logs, and finding the log entry that explains an incident.
Cloud Monitoring: alerts and metrics
Cloud Monitoring collects metrics automatically from Google Cloud services — VM CPU and memory, Cloud SQL connections, load balancer latency, and hundreds more. You view them in dashboards (pre-built ones for each service, plus custom dashboards you assemble), and you act on them with alerting policies. An alerting policy has a condition (for example, "VM CPU utilization above 80% for 5 minutes"), a notification channel (email, SMS, PagerDuty, Slack, Pub/Sub, or a webhook), and documentation to include with the alert. When the condition is met, Monitoring sends a notification and opens an incident, which stays open until the condition clears or someone acknowledges it. The exam tests the pieces: what triggers an alert, where the notification goes, and that an alert needs both a condition and a channel.
Custom metrics let you monitor things Google does not measure for you — application-level numbers such as orders processed per minute or queue depth. You create a custom metric descriptor and write data points to it from your application (via the Monitoring API or client libraries), or you create a log-based metric that counts log entries matching a filter (for example, the number of "payment failed" log lines per minute). Log-based metrics are the exam's favorite pattern for "alert me when this error appears in the logs": create a log-based metric from the error pattern, then an alerting policy on that metric. The Ops Agent is the unified agent installed on VMs to collect both metrics and logs (including third-party application metrics such as Apache or MySQL); it replaces the older separate Monitoring and Logging agents. Managed Service for Prometheus is Google's managed Prometheus-compatible monitoring, for teams that already use Prometheus and want its query language (PromQL) and Grafana dashboards without running their own Prometheus servers.
Cloud Logging: finding answers in logs
Cloud Logging stores log entries from Google Cloud services, VMs (via the Ops Agent), and applications. The Logs Explorer is where you search them: you write a query (filtering by resource, severity, time range, and text), and the results show individual entries with their full details — timestamp, severity, resource labels, and the payload. Severity levels run from DEBUG through INFO, WARNING, ERROR, and CRITICAL. The exam tests practical log investigation: filtering by severity to find errors, filtering by resource to isolate one VM or service, and viewing a specific log entry's details to find the error message or request ID that explains a failure.
Log routers and sinks control where log entries go. By default, logs are stored in Cloud Logging's own log buckets. A sink routes matching log entries to a destination: a Cloud Storage bucket (for cheap long-term archival), a BigQuery dataset (for SQL analysis of logs), a Pub/Sub topic (for real-time processing), or another Google Cloud project. A sink has an inclusion filter (which entries to route) and can also have an exclusion filter. Log buckets hold logs with a configurable retention period (the default is 30 days; it can be extended to years for compliance, or shortened). Log analytics lets you run SQL queries over logs stored in log buckets, which is useful for investigating patterns across large volumes of entries.
Audit logs and diagnostics
Audit logs record administrative activity and access: who did what, when, and to which resource. There are four types: Admin Activity logs (always enabled — configuration changes such as creating a VM or changing an IAM policy), Data Access logs (reads and writes of data, such as reading a bucket object — disabled by default for most services because of their volume, and enabled per service where needed), System Event logs (Google-initiated actions), and Policy Denied logs (access denied by policy). The exam point is that Admin Activity logs are always on, while Data Access logs must be explicitly enabled — a common scenario is "we need to know who read this bucket's objects", and the answer involves enabling Data Access audit logs for Cloud Storage.
Two more diagnostic tools round out the picture. Cloud diagnostics (Error Reporting, Debugger, Profiler, and Trace) help research application issues: Error Reporting groups crashes and exceptions, Trace shows how long each part of a request took across services, and Profiler identifies CPU and memory hotspots in running code. The Google Cloud Status Dashboard (status.cloud.google.com) shows whether a problem is yours or Google's — the first thing to check when a service behaves strangely across the board. If the dashboard shows an incident in your region, the right response is to wait and communicate, not to rebuild your infrastructure.
Dashboards and uptime checks
Dashboards in Cloud Monitoring turn metrics into a visual overview: charts of CPU, memory, request latency, error rates, and any custom metric, arranged on a page the team can glance at during an incident. Google provides pre-built dashboards for each service (Compute Engine, Cloud SQL, GKE, and others), and you can build custom dashboards with the metrics that matter for your application. A good dashboard answers the first questions of an incident — is the service up, is it slow, is it erroring, and is it running out of a resource — without anyone having to run a query. Dashboards are shared across the team, so the on-call engineer sees the same view as the developer who built the service.
Uptime checks are a different kind of monitoring: instead of measuring a resource from the inside, they probe it from the outside. An uptime check sends HTTP, HTTPS, or TCP requests to a URL or IP address from multiple locations around the world, at intervals you choose, and reports whether the endpoint responds — and how quickly. If the endpoint stops responding, the uptime check fires an alert through the same alerting policies as any other metric. Uptime checks are the answer when the requirement is "tell me when the website is down", because they measure what users actually experience, including DNS failures and load balancer problems that internal metrics would miss. Combined with an alerting policy and a notification channel, an uptime check is the simplest form of availability monitoring — and one of the first things to set up for any public service.
Exam traps to watch for
- Alerting directly on logs: create a log-based metric from the log pattern, then alert on the metric.
- Expecting Data Access audit logs to be on by default: only Admin Activity logs are always enabled.
- Forgetting the notification channel: an alerting policy with a condition but no channel notifies nobody.
- Rebuilding infrastructure during a Google-wide incident: check the Status Dashboard first.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.A team wants to be notified by email whenever a VM's CPU utilization stays above 85% for more than 5 minutes. What should they create in Cloud Monitoring?
Explanation: An alerting policy combines a condition (CPU above 85% for 5 minutes) with a notification channel (email) — exactly the requirement. A dashboard displays metrics but does not notify. A log-based metric counts log entries; CPU is already a built-in metric. An uptime check tests whether an endpoint responds; it does not measure CPU.
Exam objective: ACE exam guide 3.4: Monitoring and logging — creating Cloud Monitoring alerts based on resource metrics
Q2.An application writes "payment failed" to its logs when a charge is declined. The team wants an alert when this happens more than 10 times in 5 minutes. What is the correct approach?
Explanation: Alerting policies work on metrics, not on raw log text — so the pattern is to create a log-based metric that counts matching entries, then alert on the metric exceeding the threshold. You cannot alert directly on log text. Exporting to BigQuery and polling is slow and indirect. The Ops Agent collects logs and metrics but does not create the alert.
Exam objective: ACE exam guide 3.4: Monitoring and logging — creating and ingesting Cloud Monitoring custom metrics (from logs)
Q3.A company must retain its application logs for two years for compliance, and wants to analyze them with SQL. Which combination should they use?
Explanation: Both routes work: a sink to BigQuery enables SQL analysis with long retention, and a log bucket with extended retention plus Log Analytics provides SQL over stored logs. The default log bucket retains logs for 30 days, not two years. Cloud Storage export archives logs but does not make them queryable with SQL. A Pub/Sub subscription delivers messages in real time; it is not a retention or analysis solution.
Exam objective: ACE exam guide 3.4: Monitoring and logging — exporting logs to external systems; configuring log buckets, log analytics, and log routers
Q4.A security team needs to know who read objects in a sensitive Cloud Storage bucket last week. What must be true for that information to be available?
Explanation: Reading objects is a data access event, recorded in Data Access audit logs — which are disabled by default for most services and must be enabled in advance; you cannot retroactively log reads that already happened. Admin Activity logs record configuration changes (creating or deleting the bucket), not object reads. Uniform access controls permissions, not logging. An alerting policy watches metrics, not individual reads.
Exam objective: ACE exam guide 3.4: Monitoring and logging — configuring audit logs
Q5.A VM is running an application, but its application logs are not appearing in Cloud Logging. The VM has no logging agent installed. What should the team do?
Explanation: The Ops Agent is the agent that collects logs (and metrics) from a VM and forwards them to Cloud Logging and Monitoring — without it, application logs stay on the VM's disk. A log sink routes logs that already exist in Cloud Logging; it cannot collect logs from a VM. Data Access audit logs record API activity, not application logs. A dashboard displays metrics; it does not collect logs.
Exam objective: ACE exam guide 3.4: Monitoring and logging — configuring and deploying Ops Agent
Q6.A team uses Prometheus and Grafana to monitor their applications and wants to keep using PromQL queries, without running their own Prometheus servers. What should they use?
Explanation: Managed Service for Prometheus is Google's managed Prometheus offering: it accepts Prometheus metrics and supports PromQL queries and Grafana dashboards without self-managed servers. Log-based metrics count log entries and do not replace Prometheus. Cloud Trace analyzes request latency. The Ops Agent collects metrics and logs from VMs but does not provide a Prometheus-compatible query service.
Exam objective: ACE exam guide 3.4: Monitoring and logging — deploying Managed Service for Prometheus
Q7.Several Google Cloud services in a region are behaving strangely at the same time, and the team suspects the problem is not in their own systems. What is the first thing they should check?
Explanation: The Status Dashboard shows Google-wide incidents by service and region — the fastest way to confirm whether a multi-service problem is on Google's side. IAM policies, billing, and firewall rules are all project-local causes; a simultaneous failure across services points to the platform, and checking the dashboard first avoids wasted troubleshooting.
Exam objective: ACE exam guide 3.4: Monitoring and logging — viewing Google Cloud status
Q8.A developer is investigating a failed request and needs to find the log entries for one specific Cloud Run service from the last hour, with severity ERROR or higher. What should they do?
Explanation: Logs Explorer is the tool for interactive log investigation: filters on resource, time range, and severity narrow the results to exactly the entries needed. A new log bucket changes storage, not searching. Exporting to BigQuery is a heavyweight route for a quick investigation. Data Access audit logs record API access, not application errors.
Exam objective: ACE exam guide 3.4: Monitoring and logging — viewing and filtering logs in Cloud Logging; viewing specific log message details