Skip to main content

Diagnostics

Exam guide§3.4

When something is slow, erroring, or expensive to run, these tools tell you why. The exam mostly tests picking the right one from a one-line symptom.

App is misbehaving - which tool?

SYMPTOMTOOL“Requests are slow - where's the latency?”Cloud Trace“What’s burning CPU / memory / heap?”Cloud Profiler“Group & track application exceptions”Error Reporting“Which SQL queries are slow?”Query Insights“Is a Google service degraded for my project?”Personalized Service Health
Match the one-line symptom to the tool - the exam question almost always arrives as one of these five.

Application performance

Two tools answer the "why is it slow / heavy?" question, and they split cleanly: Trace follows time across services, Profiler follows CPU and memory inside the code.

Cloud Trace

A trace follows one request as it propagates through your services; each hop is a span. Reading the waterfall, the widest span is where the time goes - that is the whole point of tracing. Trace also auto-analyzes all your traces to generate latency reports that surface performance degradations over time, in near real-time.

Trace: request through the /checkout service0ms100ms200ms300ms400ms500msGET /checkout (root)480msauth-service50msproducts RPC100msCloud SQL query240mspayment API40ms
One trace = a waterfall of spans; the widest bar (Cloud SQL query) is where the request spends its time.
GotchaWhat Cloud Trace can capture

Traces come from three sources: App Engine (automatic), global external Application Load Balancers, and any application instrumented with the Cloud Trace SDKs / API (OpenTelemetry). No instrumentation on a custom service = no spans for it.

Cloud Profiler

Cloud Profiler continuously samples a running application and merges the results into a flame graph - stacked frames whose width is the share of CPU (or memory heap) they consume. The widest frame is the hot function to optimize. Because sampling is statistical and extremely low-impact, it runs safely across every production instance rather than a single dev run - which is why its results actually reflect production.

Merged CPU profile: one flame graph across all instancesmain()load()parse()rankItems()score()dot()cosineSim()hottest frame - optimize herewidth = share of CPU time (stack depth grows upward)
Profiler merges statistical samples from every instance into one flame graph; the widest frame (cosineSim) is the hot function to optimize.
FactsCloud Profiler
  • Languages: Java, Go, Node.js, Python.
  • Runs anywhere: applications on Google Cloud, other clouds, or on-premises.
  • How: statistical sampling + extremely low-impact instrumentation across all production instances - a complete picture without slowing the app down.
  • Why not dev profiling: dev-environment results rarely map to production, and classic production profilers either slow execution or only inspect a subset of the codebase.
DECISIONTrace vs Profiler - latency vs resources

Both are performance tools, easy to swap. Trace = where does time go across the call path. Profiler = where do CPU/memory go inside the code. "Requests slow" → Trace; "instance CPU pegged" → Profiler.

Pick this when: requests are slow → Cloud Trace; CPU or memory is pegged → Cloud Profiler

Errors

Error Reporting

Error Reporting counts, analyzes, and aggregates the crashes thrown by your running services. A crash in most modern languages is an exception that is not caught and is handled by the runtime rather than the code itself. Instead of scrolling raw logs, you get a centralized interface that de-dupes identical stack traces into error groups you can sort and filter, plus real-time notifications the moment a new error appears.

Running cloud servicesApp Engine, Apps Script, ComputeEngine, Cloud Run, Cloud Runfunctions, GKE, Amazon EC2emit exceptionstack tracesError Reportingcounts · analyzes · aggregatesError dashboardsort · filter · group errorsReal-time notificationsalert when new errors appear
Error Reporting ingests exceptions from your running services, groups and counts them, then feeds a searchable dashboard and real-time alerts.
Real-time processingErrors are processed anddisplayed in the interfacewithin seconds.Quickly view & understandDetails page: bar chart overtime, affected versions, andrequest URL + request log.Instant notificationAlways watching; alerts oneach new error - jump straightto the error details.
Three features of Error Reporting: real-time processing, a details view for understanding errors, and instant notification on each new error.
NumbersError Reporting support
  • Platforms (generally available): App Engine (standard and flexible), Apps Script, Compute Engine, Cloud Run, Cloud Run functions, GKE, and Amazon EC2.
  • Languages the stack-trace parser handles: Go, Java, .NET, Node.js, PHP, Python, Ruby.
  • Two outputs: a centralized dashboard (sort + filter) and real-time notifications on new errors.
GotchaNot Google-Cloud-only

Error Reporting parses exceptions from Amazon EC2, not just Google Cloud services - handy for a question that stresses a hybrid or multi-cloud fleet.

Data & platform health

The last two tools sit beside the application-performance trio: one scoped to your database queries, one to the health of Google's own services under you.

Query Insights

Query Insights moves the diagnosis into the database itself, for Cloud SQL and AlloyDB. It charts database load over time and splits it by wait type - CPU, CPU-wait, I/O, and lock - so you see why the database is busy, not just that it is. A top-contributors view then ranks the queries, users, and client IPs driving that load, and drills into a single normalized query (literals replaced with ?) down to its sampled query plan. No third-party tooling required.

Database loadmax CPU capacitytime →CPUCPU waitI/O waitLock waitTop queriesSELECT ... FROM orders42%UPDATE carts SET ?23%SELECT ... JOIN items15%
Query Insights charts database load over time split by wait type (CPU, CPU-wait, I/O, lock) and ranks the top queries driving it - all without third-party tools.
FactsQuery Insights
  • Scope: Cloud SQL (MySQL, PostgreSQL, SQL Server) and AlloyDB.
  • Load model: load = query execution time ÷ wall-clock time, aggregated per minute.
  • Breaks load down by: query, SQL tag, wait type, user, client IP, and database.
  • Normalized queries: literals become ? so the same shape aggregates into one row.
  • No extra cost for the feature itself.

Personalized Service Health

Personalized Service Health is your project-scoped window into Google Cloud's own reliability. Where the public Service Health dashboard lists every global incident, Personalized Service Health applies a relevance filter - matching an incident's impacted products and locations against what you actually run - so you only see disruptions that touch your resources. Each event carries its state, start/end times, impacted products and locations, and running updates, and it reaches you through four surfaces: the console dashboard, the Service Health API, Cloud Logging, and alerts wired through Cloud Monitoring.

All Google Cloudincidentsrelevancefilteryour products+ locationsaffectingyouConsole dashboardService Health APICloud LoggingAlerts (Cloud Monitoring)
Personalized Service Health filters every Google Cloud incident down to the ones affecting your projects, then surfaces them through the console, API, Cloud Logging, and alerts.
FactsPersonalized Service Health
  • Four surfaces: console dashboard, Service Health API, Cloud Logging entries, and alerting via Cloud Monitoring.
  • Relevance: filters incidents by the products and locations your project uses.
  • Event fields: state, start/end time, impacted products, impacted locations, and updates.
  • Also surfaces in Cloud Hub alongside your application views.
GotchaPersonalized vs public status

The public Google Cloud Service Health page shows global incidents. Personalized Service Health filters to incidents relevant to your projects and products - the answer when the question stresses "affecting our workloads."