Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

LOGGING

Hello Team,

Stuck between A & B. Please help out.

Your developers have been thoroughly logging everything that happens in the API. The API allows end
users to request the data as JSON, XML, CSV, and XLS. Supporting all of these formats is taking a lot of
developer effort. Management would like to start tracking which options are used over the next month.
Without modifying the code, what's the fastest way to be able to report on this data at the end of the
month?
A. Create a custom counter logging metric that uses a regex to extract the data format into a label. At the
end of the month, use the metric viewer to see the group by the label.
B. Create a log sink that filters for rows that mention the data format. Export that to BigQuery, and run a
query at the end of the month.
C. Create a custom monitoring metric in code and edit the API code to set the metric each time the API is
called.
D. Export the logs to excel, and search for the different fields.

Solved Solved
0 1 131
1 ACCEPTED SOLUTION

Hi @fmugambi,

Welcome to Google Cloud Community!

Option A the possible answer. It is much faster than option B since you need to configure your sink and BigQuery dataset. 

Below are the details you must also consider to check their differences:

Option A: Custom counter logging metric

  • Complexity in creating regex 
  • With only 400 days of data retention at no additional cost

Option B: Log Sink to BigQuery

  • Will incur higher cost based on storage and query
  • There could be a slight delay in data availability 
  • You need to be familiar with querying (SQL).

I hope the above information is helpful.

View solution in original post

1 REPLY 1

Hi @fmugambi,

Welcome to Google Cloud Community!

Option A the possible answer. It is much faster than option B since you need to configure your sink and BigQuery dataset. 

Below are the details you must also consider to check their differences:

Option A: Custom counter logging metric

  • Complexity in creating regex 
  • With only 400 days of data retention at no additional cost

Option B: Log Sink to BigQuery

  • Will incur higher cost based on storage and query
  • There could be a slight delay in data availability 
  • You need to be familiar with querying (SQL).

I hope the above information is helpful.