Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 35 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 35
Topic #: 1
[All Professional Cloud Developer Questions]

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

  • A. Add a Stackdriver counter metric for path:/api/alpha/.
  • B. Add a Stackdriver counter metric for endpoint:/api/alpha/*.
  • C. Export the logs to Cloud Storage and count lines matching /api/alpha.
  • D. Export the logs to Cloud Pub/Sub and count lines matching /api/alpha.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
woriheck93
Highly Voted 3 years, 2 months ago
Ans: B B have the correct endpoint /api/alpha/*, A only get one endpoint counter
upvoted 17 times
siwang
1 year, 10 months ago
Agree. counter metric with applying regression filter to httpRequest.requestUrl should be able to get the count value. refer to: https://cloud.google.com/logging/docs/log4j2-vulnerability#log4j-search
upvoted 1 times
...
fraloca
1 year, 10 months ago
B is the correct answer "Create a filter that collects only the log entries that you want to count in your metric using the logging query language. You can also use regular expressions to create your metric's filters." https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics#console
upvoted 2 times
...
...
google_learner123
Highly Voted 4 years, 2 months ago
Answer should be A
upvoted 10 times
fraloca
3 years, 11 months ago
https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics#console
upvoted 3 times
hug_c0sm0s
3 years, 8 months ago
a bit confused about A / B, it seems they mean the same thing.
upvoted 4 times
...
...
...
Shereef
Most Recent 1 week ago
Selected Answer: A
The correct answer is: A. Add a Stackdriver counter metric for path:/api/alpha/ Explanation: A. Add a Stackdriver counter metric for path:/api/alpha/: This option is effective because Stackdriver (now known as Google Cloud Monitoring) supports creating custom metrics that can count log entries matching specific patterns in log fields, such as path:/api/alpha/. By adding a counter metric for the path field, you can automatically track the count of all requests to /api/alpha/* without needing to export and process the logs externally. Why Not the Other Options? B. Add a Stackdriver counter metric for endpoint:/api/alpha/: This answer is ambiguous and less likely to work, as "endpoint" is not a standard log field in Stackdriver. Instead, path or httpRequest.requestUrl would be the correct field to use.
upvoted 1 times
...
thewalker
4 months, 1 week ago
Selected Answer: A
The best approach here is A. Add a Stackdriver counter metric for path:/api/alpha/. Here's why: Stackdriver Metrics: Stackdriver metrics are specifically designed for tracking and aggregating data points over time. They are ideal for counting events like requests. Path-Based Filtering: You can define Stackdriver metrics with specific filters based on the request path. In this case, path:/api/alpha/ will capture all requests matching that pattern. Efficient Aggregation: Stackdriver automatically aggregates the metric data, providing you with the total count of requests to the /api/alpha/* endpoints.
upvoted 2 times
thewalker
4 months, 1 week ago
Why other options are less suitable: **B. Endpoint:/api/alpha/*: ** While this might seem like a good option, Stackdriver doesn't typically use the term "endpoint" for filtering. It primarily uses "path" for request path-based filtering. C. Export logs to Cloud Storage and count lines: This is a less efficient and more complex approach. You'd need to write custom code to parse the logs and count the matching lines, which adds overhead and potential for errors. D. Export logs to Cloud Pub/Sub and count lines: Similar to option C, this involves exporting logs and then processing them externally, which is less efficient than using Stackdriver metrics. In summary: Adding a Stackdriver counter metric with the path:/api/alpha/ filter is the most efficient and straightforward way to get the count of all requests on all /api/alpha/* endpoints.
upvoted 1 times
...
...
santoshchauhan
8 months, 2 weeks ago
Selected Answer: A
A. Add a Stackdriver counter metric for path:/api/alpha/. In Google Cloud's operations suite (formerly Stackdriver), you can create custom metrics to count specific events within your logs. You would set up a counter metric to capture and count log entries where the request path matches your specified pattern, such as /api/alpha/*. This would allow you to query and visualize the count of requests to these endpoints directly within Stackdriver Monitoring without the need to export the logs elsewhere. B. This option seems to be suggesting the correct action (creating a counter metric), but the syntax endpoint:/api/alpha/* is not correct for Stackdriver Monitoring. Custom metrics in Stackdriver are based on log data and the filter that matches the log entries, so you would specify the filter as part of creating the metric.
upvoted 3 times
...
theseawillclaim
9 months, 1 week ago
Selected Answer: B
If you don't export the metric, then you have nothing to count. I choose B because "endpoint" is more specific than "path".
upvoted 1 times
...
__rajan__
1 year, 2 months ago
Selected Answer: B
Ans: B
upvoted 1 times
...
maxdanny
1 year, 3 months ago
Selected Answer: B
This option will accurately track the number of requests made to all endpoints nested under /api/alpha/*.
upvoted 1 times
...
kennyloo
1 year, 3 months ago
B is for counter
upvoted 1 times
...
Pime13
1 year, 8 months ago
Selected Answer: B
submiting just to confirm community response.
upvoted 1 times
...
Foxal
1 year, 9 months ago
Selected Answer: B
B is the only one
upvoted 1 times
...
ash_meharun
1 year, 10 months ago
Selected Answer: B
B is the correct answer
upvoted 1 times
...
telp
1 year, 10 months ago
Selected Answer: B
answer is B with the correct endpoint and the goal of counter metris is to resolve the need to count calls
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Option B is the correct choice because it involves creating a counter metric in Stackdriver specifically for requests to the /api/alpha/* endpoints. This will allow you to track the number of requests to these endpoints and view the data in Stackdriver.
upvoted 3 times
omermahgoub
1 year, 10 months ago
Option C is incorrect because it involves exporting the logs to Cloud Storage and manually counting the lines that match /api/alpha. This is a more time-consuming and error-prone approach compared to using a counter metric in Stackdriver.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Option A is incorrect because the path:/api/alpha/ metric will track requests to any path that starts with /api/alpha/, not just requests to /api/alpha/* endpoints.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
Option D is also incorrect for similar reasons. Exporting the logs to Cloud Pub/Sub and counting the lines that match /api/alpha is more time-consuming and error-prone compared to using a counter metric in Stackdriver.
upvoted 1 times
...
...
tomato123
2 years, 3 months ago
Selected Answer: C
C is correct
upvoted 2 times
...
[Removed]
2 years, 7 months ago
Ans should be B -> (https://cloud.google.com/blog/products/management-tools/cloud-logging-gets-regular-expression-support) path=~"/api/alpha/*"
upvoted 5 times
...
celia20200410
3 years, 4 months ago
ans: a https://cloud.google.com/logging/docs/view/basic-queries#searching_specific_fields https://cloud.google.com/monitoring/charts/metrics-selector#filter-option To match any US zone that ends with “a”, you could use the the regular expression ^us.*.a$.
upvoted 3 times
ruben82
2 years, 6 months ago
documentation says: "ends with a". This question is different.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...