forked from pneymrl2f/nightingale
commit
40e7ede5e3
@ -1,25 +1,28 @@
|
||||
## 简介
|
||||
## Introduction
|
||||
|
||||
Nightingale, Prometheus enterprise edition
|
||||
💡 A Distributed and High-Performance Monitoring System. Prometheus enterprise edition.
|
||||
|
||||
## Architecture
|
||||
|
||||
## 文档
|
||||
![n9e-architecture](doc/img/arch.png)
|
||||
|
||||
- 国外:[https://n9e.github.io/](https://n9e.github.io/)
|
||||
- 国内:[https://n9e.gitee.io/](https://n9e.gitee.io/)
|
||||
- [v4老文档](https://gitee.com/n9e/book/tree/master/content/v4/docs)
|
||||
## Docs
|
||||
|
||||
- github: [https://n9e.github.io/](https://n9e.github.io/)
|
||||
- gitee: [https://n9e.gitee.io/](https://n9e.gitee.io/)
|
||||
- v4(old version): [https://n9e.didiyun.com/](https://n9e.didiyun.com/)
|
||||
|
||||
## TODO
|
||||
|
||||
- [x] deploy nightingale in docker
|
||||
- [x] export /metrics endpoint
|
||||
- [ ] notify.py support feishu
|
||||
- [x] notify.py support feishu
|
||||
- [ ] notify.py support sms
|
||||
- [ ] notify.py support voice
|
||||
- [ ] support remote write api
|
||||
- [x] support remote write api
|
||||
- [ ] support pushgateway api
|
||||
|
||||
|
||||
## 大本营
|
||||
## Any questions?
|
||||
|
||||
微信公众号:`__n9e__`(夜莺监控),回复“加群”可以加入交流群,回复“星球”可加入知识星球提问题
|
||||
[Click me](https://s3-gz01.didistatic.com/n9e-pub/image/n9e-wx.png)
|
||||
|
After Width: | Height: | Size: 198 KiB |
@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"targets": [
|
||||
"nwebapi:18000","nserver:19000"
|
||||
]
|
||||
}
|
||||
]
|
@ -1,66 +0,0 @@
|
||||
package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/didi/nightingale/v5/src/models"
|
||||
"github.com/didi/nightingale/v5/src/server/config"
|
||||
"github.com/didi/nightingale/v5/src/server/memsto"
|
||||
"github.com/toolkits/pkg/logger"
|
||||
)
|
||||
|
||||
func loopRepeat(ctx context.Context) {
|
||||
duration := time.Duration(9000) * time.Millisecond
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.After(duration):
|
||||
repeat()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 拉取未恢复的告警表中需要重复通知的数据
|
||||
func repeat() {
|
||||
events, err := models.AlertCurEventNeedRepeat(config.C.ClusterName)
|
||||
if err != nil {
|
||||
logger.Errorf("repeat: AlertCurEventNeedRepeat: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if len(events) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < len(events); i++ {
|
||||
event := events[i]
|
||||
rule := memsto.AlertRuleCache.Get(event.RuleId)
|
||||
if rule == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if rule.NotifyRepeatStep == 0 {
|
||||
// 用户后来调整了这个字段,不让继续发送了
|
||||
continue
|
||||
}
|
||||
|
||||
event.DB2Mem()
|
||||
|
||||
if isNoneffective(event.TriggerTime, rule) {
|
||||
continue
|
||||
}
|
||||
|
||||
if isMuted(event) {
|
||||
continue
|
||||
}
|
||||
|
||||
fillUsers(event)
|
||||
notify(event)
|
||||
|
||||
if err = event.IncRepeatStep(int64(rule.NotifyRepeatStep * 60)); err != nil {
|
||||
logger.Errorf("repeat: IncRepeatStep: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue