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 team manages microservices deployed on Google Kubernetes Engine (GKE) and collects telemetry using Google Cloud Managed Service for Prometheus with managed collection. A recent FinOps review in the Cloud Monitoring Metrics Management page reveals a major cost spike attributed to custom metric ingestion volume.
Upon investigation, you identify two main drivers:
user_id label dimension across millions of user sessions.You need to optimize observability costs by decreasing the scraping frequency to 30 seconds and stripping the high-cardinality user_id label before samples are ingested into the backend, without altering the application code.
Which configuration should you apply to the PodMonitoring custom resource?
In Google Cloud Managed Service for Prometheus (GMP), managed collection relies on Kubernetes Custom Resources such as PodMonitoring and ClusterPodMonitoring to define scraping targets and ingestion configurations. The metricRelabeling section implements standard Prometheus relabeling rules (metric_relabel_configs) applied to scraped samples immediately before they are ingested into the global Monarch datastore.
spec.endpoints[].interval to 30s reduces the collection frequency from 12 samples per minute to 2 samples per minute per time series, resulting in an immediate 83.3% reduction in baseline sample ingestion rate.action: labeldrop with regex: user_id in the metricRelabeling pipeline removes the user_id label from the scraped metric samples prior to storage. This aggregates the remaining dimensions and collapses millions of ephemeral time series into a small set of persistent streams.keep, drop, labeldrop, and labelkeep.PodMonitoring resources can be versioned and deployed automatically via standard Kubernetes CI/CD and Terraform workflows.This configuration directly targets the two core drivers of observability costs in sample-metered environments: sample ingestion frequency and active time series cardinality. Modifying the PodMonitoring custom resource is the native, Google-recommended approach for managed collection on GKE.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.