Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Your DevOps team deploys a critical microservice on Compute Engine instances with the Google Cloud Ops Agent. The Ops Agent is configured to ingest OpenTelemetry Protocol (OTLP) metrics using the Cloud Monitoring API mode (metrics_mode: googlecloudmonitoring). The application emits two cumulative counter metrics:
workload.googleapis.com/custom/http_requests_totalworkload.googleapis.com/custom/http_errors_totalYou need to construct a PromQL-based alerting policy condition in Cloud Monitoring that triggers an incident whenever the 5-minute HTTP error rate exceeds 5% of total requests across the fleet.
Which PromQL query correctly references these metrics according to Cloud Monitoring syntax conventions?
When querying metrics ingested through the Cloud Monitoring API (googlecloudmonitoring ingestion mode) using Prometheus Query Language (PromQL), metric names must follow specific conversion rules to be compatible with PromQL syntax. In Cloud Monitoring, the metric type is converted into a PromQL identifier, and monitored resources must be explicitly defined where applicable.
/) in the metric type string is replaced with a colon (:)..) and subsequent forward slashes (/), are replaced with underscores (_).workload.googleapis.com/custom/http_errors_total becomes workload_googleapis_com:custom_http_errors_total.{monitored_resource="gce_instance"} label filter.rate(...[5m]) calculates the per-second rate of change over a 5-minute window, and computing the ratio with / compared against > 0.05 enforces the 5% threshold.sum() aggregates request and error rates across all matching VM instances.monitored_resource="gce_instance" avoids ambiguity in multi-resource environments.This syntax precisely follows Google Cloud's documented mapping specification for non-Prometheus native custom metrics ingested via the Monitoring API, avoiding runtime query errors and missing data anomalies.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.