You support an application that stores product information in cached memory. For every cache miss, an entry is logged in Stackdriver Logging. You want to visualize how often a cache miss happens over time. What should you do?
A. Link Stackdriver Logging as a source in Google Data Studio. Filter the logs on the cache misses.
B. Configure Stackdriver Profiler to identify and visualize when the cache misses occur based on the logs.
C. Create a logs-based metric in Stackdriver Logging and a dashboard for that metric in Stackdriver Monitoring.
D. Configure BigQuery as a sink for Stackdriver Logging. Create a scheduled query to filter the cache miss logs and write them to a separate table.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
C
Explanation
A. Link Stackdriver Logging as a source in Google Data Studio. Filter the logs on the cache misses.
(Not possible Stackdriver Logging as a source in Data Studio.)
B. Configure Stackdriver Profiler to identify and visualize when the cache misses occur based on the logs.
(Profiler is used for CPU and Memory usage.)
C. Create a logs-based metric in Stackdriver Logging and a dashboard for that metric in Stackdriver Monitoring.
(https://cloud.google.com/logging/docs/logs-based-metrics#counter-metric
The best option for visualizing how often a cache miss happens over time would be C.
Stackdriver Logging provides the ability to extract metrics from logs, these metrics are called logs-based metrics. You can create a logs-based metric that counts the number of cache miss logs and configure it to be collected at a regular interval, this way you can see how often a cache miss happens over time. Additionally, Stackdriver Monitoring provides the ability to create dashboards that display the metrics collected by logs-based metrics, you can use this dashboard to visualize the cache misses over time and easily identify trends or spikes in the data.)
D. Configure BigQuery as a sink for Stackdriver Logging. Create a scheduled query to filter the cache miss logs and write them to a separate table.
(Extra steps, while log based metrics is already providing the same functionality. And there is no visualization.)