Google Cloud Exam: How to Monitor Egress Network Costs on Apache Web Server | Associate Cloud Engineer

Monitor Egress Network Costs on Apache Web Server

Question

Your company publishes large files on an Apache web server that runs on a Compute Engine instance.

The Apache web server is not the only application running in the project.

You want to receive an email when the egress network costs for the server exceed 100 dollars for the current month as measured by Google Cloud.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The correct answer to this question is C. Export the billing data to BigQuery. Create a Cloud Function that uses BigQuery to sum the egress network costs of the exported billing data for the Apache web server for the current month and sends an email if it is over 100 dollars. Schedule the Cloud Function using Cloud Scheduler to run hourly.

Here is a detailed explanation of each answer:

Option A: Set up a budget alert on the project with an amount of 100 dollars, a threshold of 100%, and notification type of email. This option is not ideal because it only alerts on the total project spend, and not specifically on the egress network costs for the Apache web server. It also does not take into account the current month's spend, which is a requirement in the question.

Option B: Set up a budget alert on the billing account with an amount of 100 dollars, a threshold of 100%, and notification type of email. This option is also not ideal because it only alerts on the total billing account spend, and not specifically on the egress network costs for the Apache web server. It also does not take into account the current month's spend, which is a requirement in the question.

Option C: Export the billing data to BigQuery. Create a Cloud Function that uses BigQuery to sum the egress network costs of the exported billing data for the Apache web server for the current month and sends an email if it is over 100 dollars. Schedule the Cloud Function using Cloud Scheduler to run hourly. This option is the correct answer to the question because it exports the billing data to BigQuery, which allows for detailed analysis and filtering of the costs for the Apache web server. A Cloud Function can then be created to sum the egress network costs for the current month and send an email if it exceeds 100 dollars. Additionally, scheduling the Cloud Function to run hourly ensures that the costs are continuously monitored throughout the month.

Option D: Use the Cloud Logging Agent to export the Apache web server logs to Cloud Logging. Create a Cloud Function that uses BigQuery to parse the HTTP response log data in Cloud Logging for the current month and sends an email if the size of all HTTP responses, multiplied by current Google Cloud egress prices, totals over 100 dollars. Schedule the Cloud Function using Cloud Scheduler to run hourly. This option is not ideal because it relies on parsing HTTP response log data in Cloud Logging, which may not accurately reflect the egress network costs for the Apache web server. It also does not take into account the current month's spend, which is a requirement in the question.