use*_*022 1 time monitoring alerts bosun
早上好.
我最近几天一直在使用bosun监控应用程序,我非常喜欢它.但我需要一件事我无法解决.
我希望有1个警报响应不同,具体取决于它的时间.因此,白天每小时登录我的网站的数量需要为100,而夜间需要为10.当它低于我想要创建警报时.
如果我使用2个警报执行此操作,那么白天警报将在晚上发出警报.所以我需要一个查找,检查它是什么时间,然后给出正确的阈值.
任何人都知道如何做到这一点.
马塞尔科尔特
博森没有这个功能.我已经考虑过了,但我从来没有被证明是必要的用例.为什么?
我考虑过两个一般情况:
为了处理这种情况,我们使用异常警报.这实际上说的是"这不是过去几周一周中同一时间的情况,发出警报".对此的关键功能是波段功能.以下是从示例页面执行此操作的示例:
alert slower.route.performance {
template = route.performance
$notes = Response time is based on HAProxy's Tr Value. This is the web server response time (time elapsed between the moment the TCP connection was established to the web server and the moment it send its complete response header
$duration = "1d"
$route=*
$metric = "sum:10m-avg:haproxy.logs.route_tr_median{route=$route}"
$route_hit_metric = "sum:10m-avg:rate{counter,,1}:haproxy.logs.hits_by_route{route=$route}"
$total_hit_metric = "sum:10m-avg:rate{counter,,1}:haproxy.logs.hits_by_route"
$route_hits = change($route_hit_metric, $duration, "")
$total_hits = change($total_hit_metric, $duration, "")
$hit_percent = $route_hits / $total_hits * 100
$current_hitcount = len(q($metric, $duration, ""))
$period = "7d"
$lookback = 4
$history = band($metric, $duration, $period, $lookback)
$past_dev = dev($history)
$past_median = percentile($history, .5)
$current_median = percentile(q($metric, $duration, ""), .5)
$diff = $current_median - $past_median
warn = $current_median > ($past_median + $past_dev*2) && abs($diff) > 10 && $hit_percent > 1
warnNotification = default
ignoreUnknown = true
}
Run Code Online (Sandbox Code Playgroud)
希望这条路可以解决您的警报需求?
| 归档时间: |
|
| 查看次数: |
963 次 |
| 最近记录: |