Skip to content

Commit

Permalink
feat: 检测结果支持推送nightingale
Browse files Browse the repository at this point in the history
  • Loading branch information
710leo committed Mar 23, 2020
1 parent 40ecc6c commit 070d64f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enterprise-level websites monitoring system
- customize header
- customize post body
- support get post put method
- send to open-falcon、statsd、prometheus
- send to nightingale、open-falcon、statsd、prometheus

## Architecture
![Architecture](img/urlooker_arch.png)
Expand Down
4 changes: 2 additions & 2 deletions configs/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ alarm: #告警判断组件,为true表示使用alarm组件
sleepTime: 30
cluster:
node-1: "127.0.0.1:1986"
falcon: #open-falcon接收数据的地址,为true表示要向falcon推送数据
falcon: #为 true 表示要向 falcon 或者 nightingale 推送数据
enable: false
addr: "http://falcon.transfer.addr/api/push"
addr: "http://transfer.addr/api/push"
interval: 60
statsd:
enable: false
Expand Down
5 changes: 2 additions & 3 deletions modules/web/utils/falcon.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func pushData(addr string, data []*MetricValue) error {
return err
}

log.Println("to falcon: ", string(d))

_, err = httplib.Post(addr).Body(d).String()
resp, err := httplib.Post(addr).Header("Content-Type", "application/json").Body(d).String()
log.Printf("send:%s resp:%s\n", string(d), resp)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion readme_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 自定义Header
- GET、POST、PUT访问
- 自定义POST BODY
- 检测结果支持向open-falcon推送
- 检测结果支持推送 nightingale、open-falcon

## Architecture
![Architecture](img/urlooker_arch.png)
Expand Down

0 comments on commit 070d64f

Please sign in to comment.