I want to create a dashboard/chart in Google Cloud Monitoring where I can see the total number of rows of my BigQuery table at all times.
With resource type "bigquery_dataset" and metric "uploaded_row_count" I only see the number of new rows per second with aligner "rate". If I choose "sum" as aligner it only shows the number of new rows added for the chosen alignment period.
I'm probably missing something but how do I see the total number of rows of a table?
PubSub subscriptions have this option with metric "num_undelivered_messages" and also Dataflow jobs with "element_count".
Thanks in advance.
There's an ongoing feature request for BigQuery table attribute on GCP's Cloud Monitoring metrics, but there's no ETA when this feature be rolled out . Please star and comment if you wanted the feature to be implemented in the future.
Cloud Monitoring only charts and monitors any (numeric) metric data that your Google Cloud project collects. On this case, system metrics generated for BigQuery. By looking at the documentation, only the metric for uploaded rows are available, which has the behaviour that you're seeing in the chart. The total number of rows however is currently not available.
Therefore as of this writing, unfortunately what you want is not possible, due to the the Cloud Monitoring limitations on BigQuery, there are only work around that you can try to do.
For other readers who are ok with @Mikhail Berlyant comment, here is a thread for querying metadata including row counts.