Topic 1 Question 250
You have an application running on Google Kubernetes Engine (GKE). The application is currently using a logging library and is outputting to standard output. You need to export the logs to Cloud Logging, and you need the logs to include metadata about each request. You want to use the simplest method to accomplish this. What should you do?
Change your application’s logging library to the Cloud Logging library, and configure your application to export logs to Cloud Logging.
Update your application to output logs in JSON format, and add the necessary metadata to the JSON.
Update your application to output logs in CSV format, and add the necessary metadata to the CSV.
Install the Fluent Bit agent on each of your GKE nodes, and have the agent export all logs from /var/log.
ユーザの投票
コメント(7)
- 正解だと思う選択肢: A
Option D, installing the Fluent Bit agent on each of your GKE nodes, is not the most straightforward method for exporting logs to Cloud Logging, as it requires manual configuration and management of the Fluent Bit agent. While Fluent Bit can be used to collect and forward logs to Cloud Logging, it is typically used for more complex logging scenarios where custom log processing is required.
Using the Cloud Logging library, as described in Option A, is a simpler and more direct method for exporting logs to Cloud Logging, as it eliminates the need to manage an additional log agent and provides a more integrated solution for logging in a GKE environment.
👍 4mrvergara2023/02/04 The answer is B since GKE is integrated with Cloud Logging by default.
"By default, GKE clusters are natively integrated with Cloud Logging (and Monitoring). When you create a GKE cluster, both Monitoring and Cloud Logging are enabled by default." "GKE deploys a per-node logging agent that reads container logs, adds helpful metadata, and then sends the logs to the logs router, which sends the logs to Cloud Logging and any of the Logging sink destinations that you have configured. Cloud Logging stores logs for the duration that you specify or 30 days by default. Because Cloud Logging automatically collects standard output and error logs for containerized processes, you can start viewing your logs as soon as your application is deployed."
👍 4aldi222023/04/17- 正解だと思う選択肢: D👍 1TNT872023/01/31
シャッフルモード