ASSOCIATE-CLOUD-ENGINEER practice question 10 of 35
For analysis purposes, you need to send all the logs from all of your Compute Engine instances to a BigQuery dataset called platform-logs. You have already installed the Stackdriver Logging agent on all the instances. You want to minimize cost. What should you do?
Full set: 332 questionsThe most direct, cost-effective, and officially recommended method to send logs from Cloud Logging to BigQuery is by creating a log sink. A sink allows you to define a filter for specific logs (in this case, from Compute Engine instances using resource.type="gceinstance") and route them directly to a supported destination. Choosing BigQuery as the sink destination is a native integration that is optimized for this purpose. This approach avoids the additional cost and complexity of intermediate services like Pub/Sub and Cloud Functions, thereby minimizing both operational overhead and cost, as required by the question.
A. The instance metadata key logs-destination is not a valid or standard configuration parameter for the Cloud Logging agent to specify a BigQuery destination.
B. This solution introduces unnecessary intermediate services (Pub/Sub and Cloud Functions), which add complexity and incur their own costs for message delivery and function execution, violating the "minimize cost" requirement.
D. This describes a complex, daily batch process. It introduces latency (up to 24 hours), is more expensive due to using Cloud Scheduler and Cloud Functions, and is less reliable than a real-time sink.
1. Google Cloud Documentation - Overview of log routing and sinks: "To route logs
you create a sink. A sink includes a destination and a filter that selects the log entries to route... You can route log entries to the following destinations: ... BigQuery dataset". This document establishes the sink as the primary mechanism for routing logs.
Source: Google Cloud Documentation
"Overview of log routing and sinks"
Section: "How sinks work".
2. Google Cloud Documentation - Exporting logs to BigQuery: "To export logs to BigQuery
you create a sink and set BigQuery as the destination... The sink creates a new BigQuery dataset and then creates tables with a schema for the logs." This page details the exact procedure described in option C.
Source: Google Cloud Documentation
"Route logs to supported destinations"
Section: "Route logs to BigQuery".
3. Google Cloud Documentation - Cloud Logging Pricing: "There is no charge for routing logs to a supported destination; however
the destination might have its own ingestion costs." This supports the cost-minimization argument by showing that the routing itself is free
so avoiding extra billable services (like Pub/Sub and Functions) is the most economical approach.
Source: Google Cloud Documentation
"Cloud Logging pricing"
Section: "Log routing".
4. Google Cloud Documentation - Logging agent configuration: The official documentation for configuring the google-fluentd agent does not list a logs-destination metadata key for routing logs
confirming that the method in option A is incorrect. Configuration is managed through agent configuration files
not instance metadata for this purpose.
Source: Google Cloud Documentation
"Logging agent - Advanced configuration".
Keep practicing
Take the free ASSOCIATE-CLOUD-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ASSOCIATE-CLOUD-ENGINEER practice questions
- Question 1You need to verify that a Google Cloud Platform service account was created at a particul…
- Question 2You are building a new version of an application hosted in an App Engine environment. You…
- Question 3You need to create a new billing account and then link it with an existing Google Cloud P…
- Question 4You want to configure 10 Compute Engine instances for availability when maintenance occur…
- Question 5You need to create a custom VPC with a single subnet. The subnet’s range must be as large…
- Question 6You significantly changed a complex Deployment Manager template and want to confirm that …
