Google Cloud Associate Cloud Engineer — Question 270
Your company uses a multi-cloud strategy that includes Google Cloud. You want to centralize application logs in a third-party software-as-a-service (SaaS) tool from all environments. You need to integrate logs originating from Cloud Logging, and you want to ensure the export occurs with the least amount of delay possible. What should you do?
Answer options
- A. Create a Cloud Logging sink and configure BigQuery as the destination. Configure the SaaS tool to query BigQuery to retrieve the logs.
- B. Create a Cloud Logging sink and configure Pub/Sub as the destination. Configure the SaaS tool to subscribe to the Pub/Sub topic to retrieve the logs.
- C. Create a Cloud Logging sink and configure Cloud Storage as the destination. Configure the SaaS tool to read the Cloud Storage bucket to retrieve the logs.
- D. Use a Cloud Scheduler cron job to trigger a Cloud Function that queries Cloud Logging and sends the logs to the SaaS tool.
Correct answer: B
Explanation
Option B is correct because using Pub/Sub allows for real-time log export with minimal delay, enabling the SaaS tool to process logs as they arrive. Option A introduces delay due to querying BigQuery, option C relies on batch processing from Cloud Storage, which can also add latency, and option D creates unnecessary complexity and delays by querying logs through a Cloud Function.