Google Cloud Professional Cloud Developer — Question 316
You have an on-premises containerized service written in the current stable version of Python 3 that is available only to users in the United States. The service has high traffic during the day and no traffic at night. You need to migrate this application to Google Cloud and track error logs after the migration in Error Reporting. You want to minimize the cost and effort of these tasks. What should you do?
Answer options
- 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.
Correct answer: A
Explanation
The correct answer is A because deploying on Cloud Run allows for automatic scaling and is cost-effective since it charges only for the resources used during active hours. Writing errors to standard error enables automatic integration with Google Cloud's Error Reporting feature, making it easy to track issues. Options B, C, and D either involve additional complexity or higher costs without leveraging the benefits of Cloud Run effectively.