From 070d64f9c19dc464a9c26b828ef3c89aca0aa3de Mon Sep 17 00:00:00 2001 From: 710leo <710leo@gmail.com> Date: Mon, 23 Mar 2020 12:22:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A3=80=E6=B5=8B=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8E=A8=E9=80=81nightingale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- configs/web.yml | 4 ++-- modules/web/utils/falcon.go | 5 ++--- readme_zh.md | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d78e8f7..0fe586b 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/configs/web.yml b/configs/web.yml index f091348..1b7da38 100644 --- a/configs/web.yml +++ b/configs/web.yml @@ -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 diff --git a/modules/web/utils/falcon.go b/modules/web/utils/falcon.go index 0163c0d..5515647 100644 --- a/modules/web/utils/falcon.go +++ b/modules/web/utils/falcon.go @@ -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 } diff --git a/readme_zh.md b/readme_zh.md index 5179aa0..4044806 100644 --- a/readme_zh.md +++ b/readme_zh.md @@ -9,7 +9,7 @@ - 自定义Header - GET、POST、PUT访问 - 自定义POST BODY -- 检测结果支持向open-falcon推送 +- 检测结果支持推送 nightingale、open-falcon ## Architecture ![Architecture](img/urlooker_arch.png)