0

I have been trying to register an alert on spike of some metrics using Stackdriver. Here's the query and details:

  1. If there a sudden spike and 500s cross 20
  2. If the total number of requests (200s or others) cross 3000 over 5 mins

To achieve [1], I put the aggregation as mean, aligner as mean (sum over aligner doesn't seem to work - I dont understand why). This query works if the average of requests over 5 mins is over 20 (which is the expected behavior). But I am not able to register any single spike which is the requirement.

Again, for [2] the average over a certain duration works but the summation of requests doesn't seem to work.

If there a way of achieving either or both of the requirements.

PS: Please let me know if you need more data or snippets of the dashboard to understand what I have done till now. I will go ahead and add some accordingly.

phoenix
  • 717
  • 1
  • 8
  • 26

2 Answers2

0

I do not believe there is aggregation when trying to set up an alert. As an example for [1], please go to

Stackdriver Monitoring
Alerting
Create a policy and add your conditions
Select your Resource Type
Select your metric, condition and threshold = 20
Response_code_class = 500
Save condition
dany L
  • 2,456
  • 6
  • 12
0

The alerting UI has changed since the previous answer was written. You can now specify aggregations when creating alerting policies. That said, I don't think you want mean; that's going to smooth out your curve which will defeat your intended use case. A simple threshold alert with a short duration (even zero) ought to do it, I think.

For your second case, you ought to be able to compute a five-minute sum and alert on that. If you still can't get it to work, respond here or file a support ticket and we'll see how we can help you.

Aaron Sher, Stackdriver engineer

Aaron Sher
  • 86
  • 1