Skip to content

Commit 070d64f

Browse files
committed
feat: 检测结果支持推送nightingale
1 parent 40ecc6c commit 070d64f

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enterprise-level websites monitoring system
99
- customize header
1010
- customize post body
1111
- support get post put method
12-
- send to open-falcon、statsd、prometheus
12+
- send to nightingale、open-falcon、statsd、prometheus
1313

1414
## Architecture
1515
![Architecture](img/urlooker_arch.png)

configs/web.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ alarm: #告警判断组件,为true表示使用alarm组件
3333
sleepTime: 30
3434
cluster:
3535
node-1: "127.0.0.1:1986"
36-
falcon: #open-falcon接收数据的地址,为true表示要向falcon推送数据
36+
falcon: #为 true 表示要向 falcon 或者 nightingale 推送数据
3737
enable: false
38-
addr: "http://falcon.transfer.addr/api/push"
38+
addr: "http://transfer.addr/api/push"
3939
interval: 60
4040
statsd:
4141
enable: false

modules/web/utils/falcon.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ func pushData(addr string, data []*MetricValue) error {
6868
return err
6969
}
7070

71-
log.Println("to falcon: ", string(d))
72-
73-
_, err = httplib.Post(addr).Body(d).String()
71+
resp, err := httplib.Post(addr).Header("Content-Type", "application/json").Body(d).String()
72+
log.Printf("send:%s resp:%s\n", string(d), resp)
7473
if err != nil {
7574
return err
7675
}

readme_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- 自定义Header
1010
- GET、POST、PUT访问
1111
- 自定义POST BODY
12-
- 检测结果支持向open-falcon推送
12+
- 检测结果支持推送 nightingale、open-falcon
1313

1414
## Architecture
1515
![Architecture](img/urlooker_arch.png)

0 commit comments

Comments
 (0)