You are using Stackdriver to monitor applications hosted on Google Cloud Platform (GCP)
You recently deployed a new application, but its logs are not appearing on the Stackdriver dashboard.
You need to troubleshoot the issue.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.B.
When using Stackdriver to monitor applications hosted on Google Cloud Platform (GCP), if a new application's logs are not appearing on the Stackdriver dashboard, the following steps can be taken to troubleshoot the issue:
A. Confirm that the Stackdriver agent has been installed in the hosting virtual machine:
The Stackdriver agent is responsible for collecting and forwarding logs, metrics, and other data from the virtual machine to the Stackdriver service. If the agent is not installed, logs will not be collected and forwarded to Stackdriver. To check whether the Stackdriver agent has been installed, you can SSH into the virtual machine and run the following command:
luasystemctl status stackdriver-agent.service
If the output shows that the service is not running or not found, then the agent is not installed, and you need to install it.
B. Confirm that your account has the proper permissions to use the Stackdriver dashboard:
To use the Stackdriver dashboard, you need to have the proper permissions. If you do not have the required permissions, you will not be able to see the logs on the dashboard. To check whether you have the proper permissions, you can go to the IAM & Admin page in the GCP console and verify that you have the Stackdriver Logging Viewer role.
C. Confirm that port 25 has been opened in the firewall to allow messages through to Stackdriver:
Port 25 is not required for Stackdriver to collect logs from a virtual machine, and opening it may not necessarily solve the problem. However, if the logs are being sent to Stackdriver using email, then port 25 needs to be open. To check whether port 25 is open, you can use the following command:
sudo iptables -L -n
D. Confirm that the application is using the required client library and the service account key has proper permissions:
If the application is not using the required client library, then logs will not be collected and forwarded to Stackdriver. Additionally, if the service account key does not have the proper permissions, then Stackdriver will not be able to collect and forward the logs. To verify that the application is using the required client library and the service account key has proper permissions, you can check the application's code and the service account key's permissions in the IAM & Admin page in the GCP console.
In summary, the best answer to this question is A. Confirm that the Stackdriver agent has been installed in the hosting virtual machine, as it is the most likely reason for logs not appearing on the Stackdriver dashboard. However, it is important to note that the other options may also be worth checking if the issue persists.