【问题标题】:Custom Metric Alerts in Application InsightsApplication Insights 中的自定义指标警报
【发布时间】:2017-10-23 18:21:57
【问题描述】:

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

【问题讨论】:

标签: azure azure-application-insights


【解决方案1】:

警报仅在状态发生变化时触发

因此,如果警报针对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

【讨论】:

    猜你喜欢
    • 2018-04-04
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-28
    • 2022-08-19
    • 2020-06-11
    • 1970-01-01
    相关资源
    最近更新 更多