0
votes

I want to create a Stackdriver alert that trips when a certain logging metric occurs less than 20 times in the previous 30 minutes. I don't really need history over long periods of time for graphs or anything, i.e., I don't want to store data for a long time. I just want the alert over the prior 30 minutes.

I've created the logging metric, but need help configuring the Stackdriver Alerting condition. I'm not sure what to see for Group By, Aggregation, etc.

1
You can use aggregation of different time series together. cloud.google.com/monitoring/api/v3/… GCP’s logging supports aggregation of time series using the project timeseries api. cloud.google.com/monitoring/api/v3/metrics If you have already considered this, is there a reason why it won’t work for you? - Ashik Mahbub
@AshikMahbub Thanks for the reply. As far as I understand, it's one time series to start with. Please correct me if I'm wrong. I ended up doing Aligner:sum, Reducer:sum, Alignment Period:30 minutes, and trigger if below 20 for most recent value. It seems to work. - jacob
I’m glad your report seems to be logging the activity you are trying to track. The Google Doc does recommend summing the time series together. This page gives a bit more context for those who may also be playing with these filters in the UI. (cloud.google.com/monitoring/alerts/…) - Ashik Mahbub
Thanks @AshikMahbub! - jacob
No problem! You did all the hard work. Would you mind posting your fix as an answer so the whole community can benefit? - Ashik Mahbub

1 Answers

1
votes

I'm not sure if this is the best answer, but I ended up doing Aligner:sum, Reducer:sum, Alignment Period:30 minutes, and trigger if below 20 for most recent value. It seems to work.