
Answer-first summary for fast verification
Answer: Create an Alerting Policy in Stackdriver using a Process Health condition, checking that the number of executions of the script remains below the desired threshold. Enable notifications.
The question explicitly states the requirement to 'get notified in case this hack re-occurs,' where the hack involves repeated execution of a malicious script causing instance crashes. Option A directly addresses this by creating an Alerting Policy in Stackdriver (now Google Cloud Monitoring) using a Process Health condition to monitor the number of script executions against a threshold, with notifications enabled. This provides real-time alerts if the script execution pattern reoccurs, aligning with the core requirement. In contrast, Option B relies on CPU usage, which may not correlate with the script execution (as noted in community comments, normal workloads can spike CPU, and the script might not affect it). Options C and D focus on logging and dashboards or BigQuery queries, which lack real-time notification capabilities—they require manual checks and do not proactively alert, failing the 'get notified' criterion. The community discussion strongly supports A (75% consensus, high upvotes), emphasizing that notification is only present in A, while others critique B for its indirect metric and C/D for absence of alerts.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You want to be notified if a specific Compute Engine instance crashes. How should you configure monitoring to achieve this?
A
Create an Alerting Policy in Stackdriver using a Process Health condition, checking that the number of executions of the script remains below the desired threshold. Enable notifications.
B
Create an Alerting Policy in Stackdriver using the CPU usage metric. Set the threshold to 80% to be notified when the CPU usage goes above this 80%.
C
Log every execution of the script to Stackdriver Logging. Create a User-defined metric in Stackdriver Logging on the logs, and create a Stackdriver Dashboard displaying the metric.
D
Log every execution of the script to Stackdriver Logging. Configure BigQuery as a log sink, and create a BigQuery scheduled query to count the number of executions in a specific timeframe.