
Answer-first summary for fast verification
Answer: Deploy the code on Cloud Run. Configure your code to write errors to standard error.
Cloud Run is the optimal choice here due to its serverless nature, which scales to zero during periods of no traffic (minimizing cost) and requires minimal operational effort. Error Reporting automatically ingests logs from Cloud Logging, which captures standard error (stderr) and standard output (stdout) by default. Writing errors to stderr (Option A) ensures they are forwarded to Error Reporting without additional configuration. Options B and D involve streaming logs to Cloud Storage, which adds unnecessary complexity and does not integrate directly with Error Reporting. While GKE Autopilot (Options C and D) could work, it would involve more setup and potentially higher costs compared to Cloud Run's pay-per-use model. Thus, Option A meets both cost and effort minimization goals.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have a containerized Python 3 service running on-premises, accessible only to users in the United States, with high daytime traffic and no nighttime traffic. You need to migrate this application to Google Cloud while minimizing cost and effort, and ensure error logs are tracked in Error Reporting post-migration. What is the recommended approach?
A
Deploy the code on Cloud Run. Configure your code to write errors to standard error.
B
Deploy the code on Cloud Run. Configure your code to stream errors to a Cloud Storage bucket.
C
Deploy the code on a GKE Autopilot cluster. Configure your code to write error logs to standard error.
D
Deploy the code on a GKE Autopilot cluster. Configure your code to write error logs to a Cloud Storage bucket.
No comments yet.