PROFESSIONAL-CLOUD-DEVELOPER · Question #339
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
The correct answer is A. Deploy the code on Cloud Run. Configure your code to write errors to standard error.. Cloud Run scales to zero when there is no traffic, which means no cost during nighttime-ideal for this workload. Error Reporting automatically ingests exceptions written to stderr (standard error) from Cloud Run services with no additional configuration required for Python. This
Question
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?
Options
- ADeploy the code on Cloud Run. Configure your code to write errors to standard error.
- BDeploy the code on Cloud Run. Configure your code to stream errors to a Cloud Storage bucket.
- CDeploy the code on a GKE Autopilot cluster. Configure your code to write error logs to standard
- DDeploy the code on a GKE Autopilot cluster. Configure your code to write error logs to a Cloud
How the community answered
(20 responses)- A85% (17)
- C5% (1)
- D10% (2)
Explanation
Cloud Run scales to zero when there is no traffic, which means no cost during nighttime-ideal for this workload. Error Reporting automatically ingests exceptions written to stderr (standard error) from Cloud Run services with no additional configuration required for Python. This makes the setup trivially simple: deploy the existing container to Cloud Run and write errors to stderr as you normally would. Option B requires additional code to stream to Cloud Storage and a separate pipeline to get data into Error Reporting. Options C and D use GKE Autopilot, which does not scale to zero by default and introduces cluster management overhead, increasing both cost and effort.
Topics
Community Discussion
No community discussion yet for this question.