Google Cloud Professional Cloud Developer — Question 360

Your application is logging to Stackdriver. You want to get the count of all requests on all /api/alpha/* endpoints.
What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because adding a Stackdriver counter metric for path:/api/alpha/ will accurately track and count all requests matching that path. Option B is incorrect as it suggests a different metric that doesn't match the required path structure. Options C and D involve exporting logs, which adds unnecessary steps for counting requests that can be directly counted with a metric.