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.
Your DevOps team is instrumenting an e-commerce application to export custom metrics to Google Cloud Monitoring using the Cloud Monitoring API. A previous version of the application caused severe cardinality explosion and quota exhaustion in Cloud Monitoring.
You need to define a new custom MetricDescriptor and label schema that strictly adheres to Google Cloud specifications while preventing high cardinality and optimizing resource consumption. Which design strategy should you implement?
This approach places unique, unbounded transactional parameters such as user_id and transaction_id directly into the MetricDescriptor labels as STRING value types to facilitate per-user filtering in Cloud Monitoring charts.
transaction_id produces a time series that may only receive a single data point, wasting metadata indexing overhead.The workload was a strictly controlled internal batch system with a small, static set of known users and bounded, non-changing transaction identifiers.
To analyze individual transactions or user actions, developers should leverage Cloud Logging with structured JSON payloads or Cloud Trace, rather than custom metric time series labels.
In Google Cloud Monitoring, a MetricDescriptor defines the schema and metadata for a specific metric type (for example, custom.googleapis.com/checkout/transaction_count). Each metric is uniquely identified by the combination of its metric type and specific key-value pairs for all labels defined in its descriptor. The LabelDescriptor dictates the key name and data type (STRING, BOOL, or INT64) for each dimension.
payment_method (e.g., credit_card, paypal) and status_code (e.g., 200, 500) keeps the total number of active time series manageable and prevents exceeding Cloud Monitoring API rate limits and memory quotas.STRING, BOOL, or INT64) and ensures valid label key syntax ([a-zA-Z][a-zA-Z0-9_]*).user_id, order_id, and transaction_id are redirected to Cloud Logging or distributed traces via Cloud Trace (or OpenTelemetry exemplars), where high-cardinality lookups are fully supported without inflating time series storage.Cloud Monitoring time series storage is optimized for time-series aggregation, not per-transaction record indexing. Separating metrics (telemetry aggregation) from logs and traces (event investigation) follows Google Cloud observability best practices.
This approach attempts to dynamically generate label keys containing runtime values (such as user_12345) and assign the LabelDescriptor value type to DOUBLE to hold continuous numerical measurements.
LabelDescriptor supports only three value types: STRING, BOOL, and INT64. Floating-point numbers like DOUBLE are not valid label value types in a descriptor.MetricDescriptor must have a predefined, static list of label keys. You cannot dynamically create arbitrary label keys at data point write time without explicitly updating or re-creating the metric descriptor.MetricDescriptor must be defined ahead of time and assigned values on every write request.MetricPoint value field (as DOUBLE or DISTRIBUTION), not inside the label descriptor metadata.Cloud Monitoring supported dynamic, unstructured schemaless key-value tagging on time series, which is contrary to the strict MetricDescriptor specifications.
Metric label keys must strictly match the regular expression [a-zA-Z][a-zA-Z0-9_]* and cannot exceed 100 characters.
This option suggests modifying an active MetricDescriptor definition in-place to add or alter labels whenever new transaction tracking requirements emerge, expecting Google Cloud to automatically migrate existing historical time series data.
MetricDescriptor is created, altering or deleting it stops active data collection and permanently makes the metric type's historical data unusable.Google Cloud Monitoring supported mutable metric schemas with backward-compatible schema versioning and automatic historical data backfilling.
When breaking schema changes or new foundational labels are required, the standard practice is to create a new MetricDescriptor with a versioned metric type (e.g., custom.googleapis.com/checkout/v2/transaction_count) and transition dashboards and alerts accordingly.
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