Which metric type in Google Cloud Monitoring is best suited to track the total number of requests received by a web server over time?
Think about a metric that keeps adding up over time without resetting.
A cumulative metric counts the total number of events from a start time, making it ideal for tracking total requests over time. Gauges show current values, deltas show changes between points, and distributions show value spreads.
You want to create a Google Cloud Monitoring dashboard that shows the 95th percentile latency of an API over the last hour. Which chart type and aggregation method should you use?
Percentiles help understand latency distribution, and line charts show trends over time.
A line chart with 95th percentile aggregation shows how latency behaves at the high end over time, which is useful for performance monitoring. Mean or sum do not capture percentile behavior, and pie charts are not suitable for time series.
Which IAM role should you assign to a user to allow them to view Google Cloud Monitoring dashboards but prevent them from modifying any metrics or alert policies?
Look for the role that grants read-only access to monitoring data.
The roles/monitoring.viewer role allows users to view dashboards and metrics without permission to change configurations. Editor and admin roles allow modifications, and owner has full project control.
You want to create an alerting policy that triggers if the average CPU usage of a Compute Engine instance exceeds 80% for 5 continuous minutes. Which configuration correctly sets this condition?
CPU utilization is a ratio between 0 and 1, so thresholds should match that scale.
The metric compute.googleapis.com/instance/cpu/utilization measures CPU usage as a fraction (0 to 1). Using mean aggregation and threshold 0.8 (80%) for 5 minutes matches the requirement. Usage_time is cumulative CPU time, not a percentage.
You manage a dashboard with multiple charts showing high-cardinality metrics from thousands of instances. The dashboard loads slowly. Which approach best improves dashboard performance without losing critical data?
Aggregating data reduces the number of time series and improves load times.
Aggregating metrics by instance group reduces the number of time series, improving dashboard load times while preserving meaningful data. Reducing time range helps but may lose historical context. Removing percentiles loses important insights. Increasing refresh rate worsens performance.