Google Professional Cloud DevOps Engineer

Google Professional Cloud DevOps Engineer

Get started today

Ultimate access to all questions.


You manage multiple production systems running on Compute Engine within the same Google Cloud Platform (GCP) project, each with its own dedicated instances. How can you determine the cost of running each individual system?




Explanation:

The question requires tracking costs for distinct systems running on dedicated Compute Engine instances in the same GCP project. The optimal solution involves accurately associating costs with each system. Option B is correct because:

  1. Labeling instances: Assigning labels (e.g., system=prod-app) to Compute Engine instances allows GCP to track resource usage metadata, including costs, based on these labels. Labels are designed for cost allocation and categorization.
  2. BigQuery billing export: Exporting billing data to BigQuery captures detailed cost information, including labels. Querying BigQuery for costs grouped by the system-specific label provides precise, granular cost breakdowns per system.

Option A is incorrect because the Cost Breakdown section in the GCP Console relies on pre-existing labels or other dimensions but does not inherently group costs by a custom "system" without labels being applied first. It is a visualization tool, not a setup step.

Option C is incorrect because Stackdriver Logging (now Cloud Logging) exports logs, not billing data. Metadata on instances is not integrated with billing exports, making it ineffective for cost tracking.

Option D is suboptimal because:

  • VM names are not designed for cost grouping; they lack the structured key-value format of labels.
  • Querying costs based on VM names in BigQuery would require complex string parsing and is error-prone (e.g., inconsistent naming).
  • Exporting to Cloud Storage first adds unnecessary complexity compared to direct BigQuery billing exports.

Thus, labeling and BigQuery billing export (Option B) is the GCP best practice for cost allocation.