PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 15 of 25

[Optimizing service performance] You manage several production systems that run on Compute Engine in the same Google Cloud Platform (GCP) project. Each system has its own set of dedicated Compute Engine instances. You want to know how must it costs to run each of the systems. What should you do?

Full set: 205 questions
Answer options
A: In the Google Cloud Platform Console, use the Cost Breakdown section to visualize the costs per system.
B: Assign all instances a label specific to the system they run. Configure BigQuery billing export and query costs per label. Correct answer
C: Enrich all instances with metadata specific to the system they run. Configure Stackdriver Logging to export to BigQuery, and query costs based on the metadata.
D: Name each virtual machine (VM) after the system it runs. Set up a usage report export to a Cloud Storage bucket. Configure the bucket as a source in BigQuery to query costs based on VM name.
Correct Answer:
B. Assign all instances a label specific to the system they run. Configure BigQuery billing export and query costs per label.
Explanation

The standard and most effective method for granular cost allocation within a single Google Cloud project is to use labels. By assigning a unique label (e.g., system: crm, system: billing) to all Compute Engine instances belonging to a specific system, you can then enable the export of detailed billing data to BigQuery. This exported dataset includes label information, allowing you to run precise SQL queries to group costs by system and generate detailed financial reports. This approach is scalable, flexible, and the recommended best practice.

Why Incorrect

A. The Cost Breakdown section in the console groups by project, service, or SKU by default. It cannot distinguish between custom logical systems without labels being configured for the report.
C. Instance metadata is primarily for use by the instance itself. While it could be logged, this is an indirect and non-standard method for cost tracking compared to the direct billing export feature.
D. Using VM names for cost tracking is brittle and prone to error from typos or inconsistent naming conventions. The detailed billing export to BigQuery is more robust and purpose-built for this task.

References

1. Google Cloud Documentation, "Creating and managing labels": "Labels are key-value pairs that you can attach to Google Cloud resources... You can use labels to track your spending in billing exports."

2. Google Cloud Documentation, "Export Cloud Billing data to BigQuery": "When you export Cloud Billing data to BigQuery, the cost data is loaded into a BigQuery dataset you specify... The export includes any labels that you have set on your resources."

3. Google Cloud Documentation, "Get a granular cost breakdown with labels": "By applying labels to resources, you can filter and group your costs by label... For example, you can assign the label system:backend to all the resources that support your backend."

Scroll to Top