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.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
An e-commerce organization runs a legacy order processing service that outputs structured JSON logs to stdout. The operations team needs to define a Service Level Indicator (SLI) to track the 95th and 99th percentile latency across different checkout categories without refactoring the application code to add OpenTelemetry or Prometheus metric client libraries.
A sample log payload emitted by the service contains:
{
"message": "Order processed successfully",
"transaction_type": "express_checkout",
"duration_ms": 245.8
}
How should the DevOps engineer configure Google Cloud Observability to generate the required latency SLI metrics?
Deploy the Google-Built OpenTelemetry Collector on the host and configure the transform/aco-gke processor to extract latency histograms from standard output.
Create a counter log-based metric in Cloud Logging with a label extracting jsonPayload.duration_ms and another label extracting jsonPayload.transaction_type.
Create a distribution log-based metric in Cloud Logging, configure the field extractor to extract jsonPayload.duration_ms as the numeric value, and define a metric label extracting jsonPayload.transaction_type.
Export the application logs to BigQuery via a log router sink and configure a scheduled query to calculate percentiles and publish them as custom metrics.
Deploy the Google-Built OpenTelemetry Collector on the host and configure the transform/aco-gke processor to extract latency histograms from standard output.
Create a counter log-based metric in Cloud Logging with a label extracting jsonPayload.duration_ms and another label extracting jsonPayload.transaction_type.
Create a distribution log-based metric in Cloud Logging, configure the field extractor to extract jsonPayload.duration_ms as the numeric value, and define a metric label extracting jsonPayload.transaction_type.
A distribution log-based metric extracts continuous or discrete numeric values from matched log entries and records them into histogram buckets over time series intervals within Google Cloud Monitoring.
jsonPayload.duration_ms in the metric's value extractor, Cloud Logging parses the numeric duration directly from structured JSON payloads.jsonPayload.transaction_type allows operators to filter, group, and slice latency distributions across different checkout paths.Direct metric instrumentation via SDKs requires code modification, testing, and redeployment. A distribution log-based metric leverages existing JSON logging infrastructure to provide histogram-based percentile metrics immediately at the platform ingestion layer.
Export the application logs to BigQuery via a log router sink and configure a scheduled query to calculate percentiles and publish them as custom metrics.