How can I trigger an email or other notification based on a BigQuery query?

I would like to be notified, ideally by email, when some threshold is encountered in Google BigQuery. For example, if the request is:

SELECT name, count(id) FROM terrible_things
WHERE date(terrible_thing) < -1d

      

Then I would like to get an alert when there were more than 0 results, and I would like this alert to contain the name of each object and how many there were.

+3


source to share


1 answer


BigQuery does not provide the kinds of services you need to build it without involving other technologies. However, you should be able to use something like appengine (which has a task scheduling engine ) to periodically issue your monitoring request, check job results, and warnings if there are non-null strings in the results. Alternatively, you can do it locally using some scripts and using the BQ command line tool.

You can also refine things by using BQ table decorators to only validate data that has been received since the last run of your control request, as long as you keep the knowledge of the last run of the probe in the calling system.



In short: something else needs to issue queries and respond based on the result, but BQ can of course evaluate the data.

+5


source







All Articles