Reputation: 11
I have a table in google bigquery in which I calculate a column (think of it as anomaly detection column), is there a way, within GCP, to send a rule based alert (e.g. once the value in the column is 1) if not how would you recommend dealing with this issue. Thanks
Upvotes: 1
Views: 904
Reputation: 75940
Because you run a request to calculate the line and the alert to send, the solution is to get the result of this request and to use it.
You can export data to a file (csv for example) and then to trigger a cloud functions on the file creation on Cloud Storage. The cloud functions will read the file and for each line trigger an alert, or send only one alert with the summary of the file, or to send the file in attachement.
You can also fetch all the line of the request result and publish a PubSub message for each line. Like that, you can process in parallel all the messages with Cloud Function or Cloud Run (this time it's not possible to have only 1 alert with a summary of all the lines, the message are unitary)
Upvotes: 2
Reputation: 1978
A solution could be to use eventarc triggers: when data is inserted into your table, the job is written into cloud audit logs and you can trigger a Cloud Run like this.
With this Cloud Run it's possible to inspect the column you mention and send notifications accordingly.
Here is a good reference on how to proceed.
Upvotes: 2