I have created a custom metric and created an alert on that with threshold value as 1. I want that every time , I send a different value for this metric, it should trigger the alert, if new value is greater than threshold value. but it trigger the alert only once as next time , alert state is already "Activated". How can I workaround this?
1
votes
1 Answers
0
votes
Alerts only fire when a state changes
so if the alert is for x > 10
, the alert will fire once x becomes 10, and will not be resolved until x <= 10
.
note: a lack of data does not constitute a state change.
telemetry.TrackMetric(x, 11); // causes alert to fire
// 12 hours pass, alert is "active" the entire time
something.wait(12hours);
telemetry.TrackMetric(x, 1); // causes alert to be resolved.
and once an alert is active, more values that would cause it to be active do not cause more alerts.
telemetry.TrackMetric(x, 11); // causes alert to fire
telemetry.TrackMetric(x, 12); // will NOT cause alert, x is already > 10
telemetry.TrackMetric(x, 13); // will NOT cause alert, x is already > 10
telemetry.TrackMetric(x, 14); // will NOT cause alert, x is already > 10
telemetry.TrackMetric(x, 15); // will NOT cause alert, x is already > 10
telemetry.TrackMetric(x, 16); // will NOT cause alert, x is already > 10