Google Cloud Compute Engine | Diagnosing Application Errors | Ace: Associate Cloud Engineer Exam

Diagnosing Application Errors

Question

You have deployed an application on a single Compute Engine instance.

The application writes logs to disk.

Users start reporting errors with the application.

You want to diagnose the problem.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

To diagnose the problem with the application that is writing logs to disk on a single Compute Engine instance, there are several approaches you can take.

Option A: Navigate to Cloud Logging and view the application logs This option involves navigating to Cloud Logging and viewing the logs from the application. Cloud Logging is a fully managed service that allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud services and third-party applications. With this option, you can easily search and filter logs to quickly identify the source of the errors reported by users. To use this option, you need to ensure that the application is configured to write its logs to Cloud Logging.

Option B: Connect to the instance's serial console and read the application logs This option involves connecting to the instance's serial console to read the application logs. The serial console is a text-based interface that allows you to access an instance's serial port. With this option, you can view the application logs directly on the instance's console. However, this option may not be practical if you have multiple instances or if the logs are extensive.

Option C: Configure a Health Check on the instance and set a Low Healthy Threshold value This option involves configuring a Health Check on the instance and setting a Low Healthy Threshold value. Health Checks are used to monitor the health of Compute Engine instances and automatically replace unhealthy instances. With this option, you can use the Health Check to monitor the instance's health and automatically replace it if it becomes unhealthy due to the application errors reported by users. However, this option may not provide you with sufficient diagnostic information to identify the source of the errors.

Option D: Install and configure the Cloud Logging Agent and view the logs from Cloud Logging This option involves installing and configuring the Cloud Logging Agent on the instance and viewing the logs from Cloud Logging. The Cloud Logging Agent is a software component that runs on a Compute Engine instance and captures logs from the instance and sends them to Cloud Logging. With this option, you can easily configure the Cloud Logging Agent to capture the logs from the application and view them in Cloud Logging. This option provides you with the flexibility to capture and view the logs from multiple instances and may be useful if you have multiple instances running the same application.

In summary, the most appropriate option for diagnosing the problem with the application that is writing logs to disk on a single Compute Engine instance is Option A: Navigate to Cloud Logging and view the application logs. This option provides you with the flexibility to search and filter logs to quickly identify the source of the errors reported by users. If you want to capture the logs from multiple instances, you can consider Option D: Install and configure the Cloud Logging Agent and view the logs from Cloud Logging.