Your company has a Google Cloud project that uses BigQuery for data warehousing on a pay-per-use basis. You want to monitor queries in real time to discover the most costly queries and which users spend the most. What should you do?
A.
1. In the BigQuery dataset that contains all the tables to be queried, add a label for each user that can launch a query. 2. Open the Billing page of the project. 3. Select Reports. 4. Select BigQuery as the product and filter by the user you want to check.
B.
1. Create a Cloud Logging sink to export BigQuery data access logs to BigQuery. 2. Perform a BigQuery query on the generated table to extract the information you need.
C.
1. Create a Cloud Logging sink to export BigQuery data access logs to Cloud Storage. 2. Develop a Dataflow pipeline to compute the cost of queries split by users.
D.
1. Activate billing export into BigQuery. 2. Perform a BigQuery query on the billing table to extract the information you need.
B is the correct answer https://cloud.google.com/blog/products/data-analytics/taking-a-practical-approach-to-bigquery-cost-monitoring
A is incorrect as there is not billing page for a project, its billing account that handles all org billing.
"details about the query that was executed, like the SQL code, the job ID and, most important, the user who executed the query and the amount of data that was processed. With that information, you can compute the total cost of the query using a simple multiplication equation: cost per TB processed * numbers of TB processed" means it will be an estimation, not the real numbers.
Google recommends to export cloud billing data to bigquery to control cost in real-time: https://cloud.google.com/billing/docs/how-to/export-data-bigquery
B is the correct option. Why not A: While the Billing page offers reports with user-level cost breakdowns, it doesn't provide real-time information or detailed query data. Why not D: Billing export can provide cost data in BigQuery, but it doesn't capture details about individual queries or users, making it insufficient for the specific needs of identifying costly queries and high-spending users.
I tend to agree with the GPT4 summary:
In summary,
Option B is more focused on analyzing specific BigQuery usage patterns and costs down to the level of individual queries and users. It's better for real-time analysis of query activities.
Option D, on the other hand, provides a broader overview of all costs associated with the Google Cloud project, which is beneficial for general cost management but less so for in-depth analysis of specific BigQuery queries and user activities.
For the specific need to discover the most costly queries and which users are responsible, Option B is more targeted and appropriate
B: because of" https://cloud.google.com/blog/products/data-analytics/taking-a-practical-approach-to-bigquery-cost-monitoring
And because https://cloud.google.com/billing/docs/how-to/export-data-bigquery#example-queries. is not mentioning anything about query per user.
B
The answer is D. 1. Activate billing export into BigQuery. 2. Perform a BigQuery query on the billing table to extract the information you need.
Explanation:
A. This option is not correct because adding a label for each user in the BigQuery dataset will not allow you to monitor the cost of queries or find out which users spend the most.
B. This option is not correct because BigQuery data access logs do not include billing information or query costs.
C. This option is not correct because BigQuery data access logs stored in Cloud Storage do not include billing information or query costs, and developing a Dataflow pipeline to compute the cost of queries would be unnecessarily complex.
D. This is the correct option because activating billing export into BigQuery will allow you to query the billing data in real-time to discover the most costly queries and which users spend the most.
both B and D do not meet the exact requirements while B does not give the cost D does not provide user level details. Answer A seems to better suited though complicated
Option D might seem like a reasonable choice, but it doesn't provide real-time monitoring of queries, which is the requirement mentioned in the question.
Activating billing export to BigQuery provides detailed billing information for your Google Cloud project. However, this method doesn't provide real-time insights into query costs and user expenditures, as billing data is typically updated once per day.
On the other hand, option B allows you to monitor queries in real-time by exporting BigQuery data access logs directly to another BigQuery table, enabling you to analyze the most costly queries and user expenses as they happen.
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.
kuboraam
Highly Voted 2 years, 2 months agoVSMu
1 year, 9 months agoMahmoud_E
Highly Voted 2 years, 1 month agojlambdan
1 year, 6 months ago[Removed]
1 year, 3 months agoJamesKarianis
Most Recent 3 months agodija123
7 months, 2 weeks agomesodan
8 months, 3 weeks agoPime13
9 months, 3 weeks agoammonia_free
10 months ago91d8ca7
10 months, 3 weeks agoammonia_free
10 months agotheBestStudent
12 months agosomeone2011
1 year, 1 month agodsyouness
1 year, 2 months agosomeone2011
1 year, 1 month agodaidaidai
1 year, 2 months agodidek1986
1 year, 3 months agogary_cooper
1 year, 4 months agoUmesh09
1 year, 4 months agored_panda
1 year, 5 months agoJC0926
1 year, 7 months ago