Google Professional Cloud DevOps Engineer Question 121
Select 2Google Cloud PlatformYour team has recently noticed an increase in Cloud Logging costs due to an abundance of logs being ingested from multiple Google Cloud services. Many of these logs are not critical for operations or troubleshooting. You have been tasked with optimizing the logging configuration to reduce costs while still retaining logs necessary for compliance and debugging. Which of the following actions should you take to achieve this goal? (Select TWO)
- A
Set up log exclusions for non-essential log entries that do not require long-term storage.
- B
Increase the retention period for all log entries to ensure no data is lost over time.
- C
Implement log sampling to reduce the volume of logs ingested into Cloud Logging.
- D
Disable all logging at the Google Cloud project level to prevent unnecessary costs.
- E
Use custom logging sinks to export only critical logs to a more cost-effective storage solution like Cloud Storage.
Show answer and explanation
Correct answers: A, C
Explanation
To optimize logging costs, the focus should be on reducing the volume of logs ingested into Cloud Logging and excluding non-essential logs. Log exclusions and sampling are both effective strategies to achieve this. Exclusions prevent unnecessary logs from being stored, and sampling helps reduce the volume of logs collected while maintaining representative data. Solutions like custom sinks can help with storage costs but do not address ingestion costs, which are a major factor in Cloud Logging expenses.
- A. Correct.
Setting up log exclusions for non-essential logs is a valid way to optimize costs, as it prevents unnecessary log entries from being stored in Cloud Logging. This directly reduces storage and ingestion charges.
- B. Incorrect.
Increasing the retention period would increase costs rather than reduce them, as more data would need to be stored for longer periods.
- C. Correct.
Log sampling allows you to reduce the volume of logs being ingested by only storing a subset of logs. This is an effective way to lower costs while still retaining representative data for analysis.
- D. Incorrect.
Disabling all logging at the project level would eliminate useful logs that are critical for debugging, compliance, and operational insights. This is not a recommended practice.
- E. Incorrect.
Using custom logging sinks to export logs to a cheaper storage option like Cloud Storage can help with cost management, but it does not reduce the costs associated with log ingestion into Cloud Logging itself.