应用洞察中的自定义指标提醒

时间:2017-10-23 18:21:58

标签: azure azure-application-insights

我创建了一个自定义指标,并在阈值为1的情况下创建了一个警报。我希望每次都为此指标发送不同的值,如果新值大于阈值,则应触发警报。但它只在下次触发警报一次,警报状态已经“激活”。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

警报仅在状态更改

时触发

因此,如果警报适用于x > 10,则警告会在x变为10时触发,并且在x <= 10之前不会解决。

注意:缺少数据并不构成状态变化。

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.

并且一旦警报处于活动状态,更多会导致其处于活动状态的值不会导致更多警报。

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