xiaomi / open-falcon Goto Github PK
View Code? Open in Web Editor NEWA Distributed and High-Performance Monitoring System
Home Page: http://open-falcon.com/
A Distributed and High-Performance Monitoring System
Home Page: http://open-falcon.com/
依据该网页逐项检查http://book.open-falcon.com/zh/faq/alarm.html,
curl 127.0.0.1:6081/history/XXX可以获取到数据,发送邮件和短信的api都是无效的配置,但是9912端口没有“未恢复的报警”,报警没有生效,请问我该怎么排查错误
open-falcon现在采用扁平的、一维的hostgroup来管理机器,在机器规模较大的时候,管理成本较高
与CMDB接驳,是一个好的方案。
问下官方,有没有计划将代码通过golint规范化?
如果有,请告知,希望能奉献一份力,顺便熟悉代码~
在网络波动的情况下,引发的异常:
panic(0x780420, 0xc4200120c0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/open-falcon/agent/g.(*SingleConnRpcClient).Call(0x0, 0x7ead8c, 0xf, 0x758620, 0xc42012c000, 0x7771c0, 0xc420334570, 0x0, 0x0)
/home/sofeng/gowork/src/github.com/open-falcon/agent/g/rpc.go:58 +0x65
github.com/open-falcon/agent/g.updateMetrics(0xc420138540, 0x13, 0xc420398000, 0x21, 0x40, 0xc420334570, 0xc420016000)
/home/sofeng/gowork/src/github.com/open-falcon/agent/g/transfer.go:50 +0x15c
github.com/open-falcon/agent/g.SendMetrics(0xc420398000, 0x21, 0x40, 0xc420334570)
/home/sofeng/gowork/src/github.com/open-falcon/agent/g/transfer.go:24 +0x14e
github.com/open-falcon/agent/g.SendToTransfer(0xc420398000, 0x21, 0x40)
/home/sofeng/gowork/src/github.com/open-falcon/agent/g/var.go:60 +0xd9
github.com/open-falcon/agent/cron.collect(0x3c, 0xc42013a038, 0x1, 0x1)
/home/sofeng/gowork/src/github.com/open-falcon/agent/cron/collector.go:73 +0x3df
created by github.com/open-falcon/agent/cron.Collect
/home/sofeng/gowork/src/github.com/open-falcon/agent/cron/collector.go:30 +0xb2
是由于TransferLock锁的问题,问题在SendMetrics函数中。
分析原因:
如果两个goroutine都获取到同一个addr,一个goroutine在updateMetrics函数处获取TransferLock.RLock(),另一个goroutine在closeTransferClient函数处获取TransferLock.Lock()。
closeTransferClient函数先执行完,那么updateMetrics函数就会引发异常。所以在updateMetrics函数中需要判断,addr是否存在map中。
func updateMetrics(addr string, metrics []*model.MetricValue, resp *model.TransferResponse) bool {
TransferLock.RLock()
defer TransferLock.RUnlock()
if _, ok := TransferClients[addr]; ok {
err := TransferClients[addr].Call("Transfer.Update", metrics, resp)
if err != nil {
log.Println("call Transfer.Update fail", addr, err)
return false
}
}
return true
}
下面命令无法执行
git clone --recursive https://github.com/XiaoMi/open-falcon.git
错误信息如下:
Submodule path 'transfer': checked out '190a7ebb8e1f17070a603ec33fe10069a4cea542'
Unable to checkout '73504df1fe71a2ba8026814e06cd42b47dbe83a4' in submodule path 'graph'
主要这个自定义的指标不是连续的值. 在没有时, 就没上报. 请问是否可以增加设置, 如果当某个时间段的指标值没有的话 默认给个0 让线能够连续起来.
谢谢
agent 启动以后就会占用300多M的内存 , 跑 一段时间 以后更 占内存了
781.64 Mb ./falcon-agent -c cfg.json
这个是我配置的问题么
falcon有做汇聚么? 类似rrdtool那种
告警模板可以导出成文件格式,也可以导入
便于用户共享一些标准化的模板配置。
如题…alarm界面可以很快给出报警反馈,但是在redis中选择罗列所有key的时候却显示空
opentsdb作为一款很流行的、基于hbase的 时间序列的数据存储引擎,有很多成熟的数据展示组件适配了opentsdb,因此openfalcon适配tsdb的话,能让用户多一种数据可视化的选择方案。
这种git的仓库文件夹是另外一个仓库的指定commit,如何完整clone啊
是没有tomcat监控插件么?
如题,这种运行逻辑对于插件的运行管理会更加的灵活。谢谢
graph在扩容的时候,历史数据自动迁移
想利用open-falcon做业务监控,比如某个接口的qps,要怎么做到累加,在入口的地方调用agent上报但这只是单次的请求,open-falcon能做到按上报次数累加吗?如果要做类似于qps要怎么使用?
使用 urllib2请求报错,post数据要怎么写?
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request
`
def createdir(url):
req = urllib2.Request(url=url,data=json.dumps(dd),headers=headers)
try:
response = urllib2.urlopen(req)
print response.read()
except urllib2.HTTPError as e:
print e.reason,e.code
使用httplib post数据报错如下
{"error":"Key: 'APICreatePluginInput.GrpId' Error:Field validation for 'GrpId' failed on the 'required' tag\nKey: 'APICreatePluginInput.DirPaht' Error:Field validation for 'DirPaht' failed on the 'required' tag"}
get类型的可以正常获得
`
def listuser(url):
request = urllib2.Request(url)
for i in headers:
request.add_header(i,headers[i])
response = urllib2.urlopen(request)
result = response.read()
print result
`
open-falcon能否支持url监控,可以在portal上面做配置,指定hostgrp去做url探测。
不知道是否有计划?
http://open-falcon.org/falcon-plus/#/dashboard_graph_create
create user 应为create graph
http://open-falcon.org/falcon-plus/#/endpoint_counter
/api/v1/graph/endpoint_counter Get Counter of Endpoint
params: q 应为 params: metricQuery
而且response 值不对,应有以下几项:
endpoint_id
step
type
counter
例如 cpu.iowait,出现了好几次 115436446018207456.000 这么大的值……
大家好,我也开始尝试用open-falcon,正开始安装呢。
请问有没有ansible一键式部署open-falcon的脚本?
如果没有的话,我就贡献一个,然后发PR,这样可以么?
谢谢~
不需要登陆态么,还是我哪里配错了
./falcon-agent -check
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x73a64e]
goroutine 1 [running]:
github.com/open-falcon/falcon-plus/modules/agent/funcs.DeviceMetrics(0x7f6520, 0xc42010fda0, 0xc42010fca0)
/home/falcon/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/funcs/dfstat.go:21 +0xfe
github.com/open-falcon/falcon-plus/modules/agent/funcs.CheckCollector()
/home/falcon/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/funcs/checker.go:21 +0x1f5
main.main()
/home/falcon/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/main.go:27 +0x1d4
请问 Graph 数据的有副本(写多份)吗?我在 transfer 和 graph 里面没有找到相关的参数
找了一圈,发现rrdlite里面没有对rrd的ds的heartbeat的修改。
目前来看,已经生成的rrd是没办法修改heartbeat的,只有最新创建的ds可以通过create方法里的item.Heartbeat来进行写死。
if !g.IsRrdFileExist(filename) {
baseDir := file.Dir(filename)
err := file.InsureDir(baseDir)
if err != nil {
return err
}
err = create(filename, items[0])
if err != nil {
return err
}
}else{
//todo
}
要是能在else里面加个更新heartbeat的操作或者在graph/rrdtool/rrdtool.go里面加个tune(这个源自官方文档)的方法就好了。
HBS代码现在是对host绑定的插件目录计算md5值,只有在插件目录发生变更的情况下,才会返回正确的值,否则返回空数组,代码如下:
plugins := cache.GetPlugins(args.Hostname)
checksum := ""
if len(plugins) > 0 {
checksum = utils.Md5(strings.Join(plugins, ""))
}
if args.Checksum == checksum {
reply.Plugins = []string{}
} else {
reply.Plugins = plugins
}
Agent代码中也会根据checksum进行相应的判断,如果checksum没有发生变更,直接跳过了本次循环,进入下一次循环,这样就不会遍历插件目录下面新增的插件了,代码如下:
if resp.Checksum == checksum {
goto REST
}
解决方案,可以玩一个trick,实现不需要重启自动生效。在hbs代码中直接返回插件目录,不管是否发生变更(每次都是从hbs的内存中取,效率不是问题)。在agent中注释掉下面代码:
if resp.Checksum == checksum {
goto REST
}
dashboard 优化:
请问是否考虑提供监控docker容器内进程的方案
比如,我在judge/store/judge.go
里,把event.Status的problem和ok,都翻成中文后,报警的邮件里依然是英文。
再比如,我自己在judge/store/func.go
里添加了一个自定义的报警函数,并在ParseFuncFromString()
函数里也添加了自己的函数case,但是judge的log里提示无法识别的方法。
修改完之后build,然后把pack出来的包部署好后,都不起作用。
请问能给些指点吗
我按照官方的步骤进行了安装,在启动transfer和agent等组件的时候,启动过程正常,日志输出也是正常的,用netstat和ps查看端口和进程的情况也是正确的。但是curl服务没有返回ok,然后我telnet了一下监听的端口们,发现都不通?起了其他的服务试了一下同样的端口,发现可以访问,排除防火墙的原因。请问下大家知道这是什么原因吗?
想自定义一些api接口,但是在api.py里写了一个测试route,访问后404,然后问了一下群里的管理员,说是需要二次开发,文档关于二次开发的内容太少了,希望能增加以便满足更多的自定义需求。谢谢xiaomi
用git来管理插件,对部分用户的入门成本较高,可以考虑支持http方式来管理插件
Example custom data push from http://book.open-falcon.com/zh/usage/data-push.html
ts=`date +%s`;
curl -X POST -d "[{\"metric\": \"test-metric\", \"endpoint\": \"test-endpoint\", \"timestamp\": $ts,\"step\": 60,\"value\": 1,\"counterType\": \"GAUGE\",\"tags\": \"idc=lg,project=xx\"}]" http://127.0.0.1:1988/v1/push
Actually, curl will add header
Content-Type: application/x-www-form-urlencoded
which means a correct push should be
curl -X POST -d '0%5Bmetric%5D=test-metric&0%5Bendpoint%5D=test-endpoint&0%5Btimestamp%5D=1444817868&0%5Bstep%5D=60&0%5Bvalue%5D=1&0%5BcounterType%5D=GAUGE&0%5Btags%5D=idc%3Dlg%2Cproject%3Dxx' http://127.0.0.1:1988/v1/push
OR
curl -X POST -H "Content-Type: application/json" -d '[{"metric": "qps", "endpoint": "open-falcon-graph01.bj", "timestamp": 1431347802, "step": 60,"value": 9,"counterType": "GAUGE","tags": "project=falcon,module=graph"}]' http://10.4.243.27:6060/api/push
Whether the documentation example should be updated or server data push api should handle Content-Type
header
我在测试环境搭建了open-falcon服务端,但是在新添加监控节点的时候,发现新添加的节点,在dashboard中能搜索到,但是图表没有数据,然后验证节点IP+端口,发现web界面是有数据的,而且./falcon-agent --check发现都是OK,然后查看节点日志,没有错误日志,服务端的transfer日志,已经监听的端口
当网络中断时,数据首先落地成文件,待故障恢复后再行传输。类似scribe的数据落地机制
请问下如果agentd下架,如何将agentd删除,谢谢
请参考这里 http://book.open-falcon.org/zh/contributing.html
此外,可以加我的微信 hellolaiwei
(请注明姓名_公司),我会邀请各位进入Open-Falcon用户组
微信群。
请问open-falcon有没有业务方面的监控,比如对业务逻辑、业务流程的监控
关于告警judge模块的一些分析和建议:
1、expression是单独与某个endpoint关联,使用tag来匹配。
优点:可以灵活根据tag对metric进行匹配,
缺点:用户必须把expression书写正确
2、strategy是专门和template绑定的,template中还会指定action,因此template所有策略的触发只能对应一个action,而不能对不同的策略进行不同的action,这显然不够灵活;另外action是不能复用的, 每一个action都只能跟随某个template或者expression,删除了template也会删除对应的action,但是删除了 expression不会删除对应的action,这点估计是个bug;值得一提的是,某个strategy也是只能关联一个template,并且会随 着template删除而删除。
优点:可以直接在模板界面对其进行修改,strategy和template在逻辑上是一种从属的关系,所以对strategy的改动不会影响其他template,用户使用也较为方便,自上而下进行操作,
缺点:无法复用。
3、template的设计是每个template都拥有自己的strategy和action, 最好就是可以都设计到一张表中,但是由于要拥有多个strategy,所以只能是另外开张表来保存strategy,所以strategy是不能复用的。 对于用户的使用而言,endpoint为host时必须通过hostgroup来间接关联template。另外,template通过关联user决定发给那个用户
优点:与2类似,一个template决定了所有的逻辑,并且这些逻辑与其他template是独立的,所以方便编辑修改template,而不会影响其他template
缺点:无法复用
4、hostgroup的设计是所有host都可以属于多个hostgroup,hostgroup再bind多个template,顺藤摸瓜就找到strategy。hostgroup其实就是一种分类,一种扁平化的结构,和我们meleors的分组有点不同。
优点:host可以灵活分到多个组
缺点:新增一个机器,可能需要让它同时属于多个组,配置稍微麻烦(改进的方法就是采用树形结构咯),另外一个就是策略冲突比较难以发觉
5、一个数据是既可以和expression也可以和strategy关联的。对于endpoint非host的可以直接和 expression关联,不过这种关联只是通过expression中的一个表达式tag来表示的,并没有一个关联表
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.