Google Cloud Associate Cloud Engineer — Question 151
You are monitoring an application and receive user feedback that a specific error is spiking. You notice that the error is caused by a Service Account having insufficient permissions. You are able to solve the problem but want to be notified if the problem recurs. What should you do?
Answer options
- A. In the Log Viewer, filter the logs on severity 'Error' and the name of the Service Account.
- B. Create a sink to BigQuery to export all the logs. Create a Data Studio dashboard on the exported logs.
- C. Create a custom log-based metric for the specific error to be used in an Alerting Policy.
- D. Grant Project Owner access to the Service Account.
Correct answer: C
Explanation
Creating a custom log-based metric for the specific error allows you to set up an Alerting Policy that will notify you if the error occurs again, making it the most effective solution. Filtering logs or exporting them does not provide proactive alerts, while granting Project Owner access does not address the underlying issue of the insufficient permissions.