Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
A DevOps team manages a microservices application running on Google Cloud where services emit structured JSON logs to Cloud Logging. The logs contain a response status code (jsonPayload.status), the name of the service (jsonPayload.service_name), and the execution duration in milliseconds (jsonPayload.latency_ms).
The team needs to implement observability solutions in Cloud Monitoring to fulfill two requirements:
Which custom log-based metric designs should the team configure in Cloud Logging?
This configuration proposes creating a boolean log-based metric for latency calculation and relying on a log-based alert policy for tracking error rate trends.
The requirement was to receive an immediate single notification whenever a specific rare administrative action occurred, rather than monitoring quantitative latency distributions and error rate trends.
jsonPayload.latency_ms and jsonPayload.status, and use Cloud Monitoring metric-threshold filters to count 5xx status codes.This option attempts to construct a single distribution log-based metric that captures two independent numeric fields (latency_ms and status) simultaneously to serve both use cases.
Cloud Logging allowed a single distribution metric descriptor to bind multiple independent numeric payload fields to separate evaluation pipelines, which is unsupported.
jsonPayload.latency_ms with configured histogram buckets, and create a distribution log-based metric filtering for jsonPayload.status >= 500.This option reverses the intended roles of counter and distribution log-based metrics by attempting to record continuous numeric measurements into counters and discrete event occurrences into distributions.
>= 500 without extracting a numeric measurement fails to aggregate discrete event frequencies into dimensional error rates.Counter metrics supported histogram bucket layouts for numeric fields and distribution metrics were designed for tracking pure event counts, which contradicts the Cloud Monitoring data model.
jsonPayload.latency_ms to record latency into histogram buckets, and create a counter log-based metric filtering for jsonPayload.status >= 500 with a custom label extracting jsonPayload.service_name.Log-based metrics are user-defined or system-defined metrics in Cloud Logging that convert log stream data into time-series metrics ingested by Cloud Monitoring. User-defined log-based metrics support two core metric types: counter metrics and distribution metrics.
jsonPayload.latency_ms and aggregate them into configurable histogram buckets. Cloud Monitoring uses these distributions to calculate percentiles (such as p50, p95, and p99) and evaluate latency threshold alert policies.jsonPayload.status >= 500 increments a count each time a server error log is ingested. Adding a custom label that extracts jsonPayload.service_name partitions the count into distinct time series per service, allowing Cloud Monitoring to chart error rates and alert on spikes per microservice.This approach directly maps the data requirements to the native capabilities of Google Cloud Observability: continuous numeric distributions for statistical latency analysis and labeled counters for tracking discrete categorized event occurrences.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated