[monitoring] query db and checks if error condition is met (#884)
[monitoring] query db and checks if error condition is met (#884)

* [monitoring] query db and checks if error condition is met

1. Query the ErrorLogs table and collect all matching entries within the time period specified in the monitoring config.
2. check against each alert condition

For more details refer to Step 5 in design doc

* Address Joyce's comments

* Address Joyce's comments

* fix tab/space and pass by reference

* combine two queries into one

knative/test-infra,knative/test-infra,knative/test-infra