GithubHelp home page GithubHelp logo

judge's People

Contributors

laiwei avatar ulricqin avatar xingfusye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

judge's Issues

希望告警策略支持通配表达式

比如如下场景
nginx监控插件采集了各种errorcode的数据,告警中带上具体的api的话能够快速定位问题,如果没给api和errorcode都要去配的话不现实,就算有精力配也没精力维护。
希望能够支持 tags: api=$(.),erorrcode=404 ,judge遇到这种$()包含的tag值,就将$()包含的内容解析为正则表达式,本例子将所有tagkey为api,errorcode=404的judgeItem进行阈值判断。
例如 tags: api=$(
),erorrcode=404
api=/test/index.html,errorcode=404
api=/helloworld,errorcode=404
都会触发搞告警
tags: api=$(.),erorrcode=$(.)
api=/test/index.html,errorcode=500
api=/helloworld,errorcode=404
都会触发告警 。
告警信息中的tag就显示对应的api=/test/index.html,errorcode=500这种。

judge不同步策略的bug

出现过一次,其中一台judge状态运行,healthcheck都是ok,api调用也正常,但是不从hbs获取策略。
问题发现过程:发现部分策略修改后,告警显示的内容是很久之前的。然后通过judge的api查看策略
curl http://judge-001ip:6081/strategy/hostname-eg/net.port.listen 发现策略是修改之前的旧策略
curl http://judge-002ip:6081/strategy/hostname-eg/net.port.listen 发现策略是修改之后的新策略
但是history发现历史数据让然发送到judge-001。所以告警的内容和触发条件是错误的。
重新启动judge-001后就正常了。
这个问题不好复现,但是真实存在且后果严重。目前没有定位到产生的原因。最好多开启debugHost配置项,然后多注意自己的judge的运行状态。

问题定位到了,g/rpc.go中的call方法死锁了。
this.rpcClient.Call(method, args, reply)并没有超时机制,该方法正在执行时网络意外中断将导致调用一直等待 。 rpc.go的call方法加锁无法释放,导致再也无法从hbs获取策略了。

报警判断错误

Metric:df.bytes.free.percent Tags:fstype=NTFS,mount=C: all(#3): 5.14668<1 Note: Max:3, Current:1 Timestamp:2016-04-25 19:33:00
这个问题需要怎样排查

关于HistoryData函数的疑惑

每次需要从SafeLinkedList中取出历史数据,进行判断。但是HistoryData()中当isEnough = false时,仍然去处理数据,而上层此时都直接return,并未对返回data做处理。为了避免多余的计算,其实isEnough = false的时候HistoryData()应该是直接return的?(虽然很少遇到不够的情况)

if judgeType == 'G' || judgeType == 'g' {
    if size < limit {
        // 有多少获取多少
        limit = size
        isEnough = false
    }
    vs = make([]*model.HistoryData, limit)
    vs[0] = &model.HistoryData{Timestamp: firstItem.Timestamp, Value: firstItem.Value}
    i := 1
    currentElement := firstElement
    for i < limit {
        nextElement := currentElement.Next()
        vs[i] = &model.HistoryData{
            Timestamp: nextElement.Value.(*model.JudgeItem).Timestamp,
            Value:     nextElement.Value.(*model.JudgeItem).Value,
        }
        i++
        currentElement = nextElement
    }
} else {
…
}

函数judgeItemWithStrategy

这个函数每次都需要得到一个报警判断的函数,是否可以在同步策略的时候,构造这个函数,不需要每次去解析,这样是否影响效率?

pdiff问题

我设置的报警条件是pdiff(#1) <= -50报警
以下数据我得到两个报警邮件
[130, 140, 100, 50, 160, 170]
邮件1: pdiff(#1): -50<=-50
邮件2:pdiff(#1): 220<=-50
邮件1可以理解,但是邮件二不是很理解(220 <= -50)。看完代码也觉得220这个不应该报警。
望解答。

在策略告警中,父子告警模板需要支持覆盖

加入告警模板B继承于A,A模板上策略是 metric=errorcode.counts all(#1)>100, 而B模板上策略是 metric=errorcode.counts tags: error_code=1003009 all(#1)>200, 在judge代码中由于没有进行子策略覆盖父策略逻辑,导致A模板上的策略被触发产生告警,然而这并不是我所希望的。希望利用贪婪匹配优先匹配最合适的策略,然后再匹配其次的策略。

judge读取hbs配置问题

正在配置judge模块的时候碰到一个错误:
2015/12/04 17:37:56 strategy.go:25: [ERROR] Hbs.GetStrategies: invalid character 'H' looking for beginning of value
2015/12/04 17:37:56 strategy.go:59: [ERROR] Hbs.GetExpressions: invalid character 'H' looking for beginning of value
事实上falcon_portal库中expression表和strategy表都是空的,请问是哪一部分配置导致这个问题的呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.