分佈式c/s ping & http 探測

## 我寫的分佈式c/s ping & http 探測代碼,感興趣的+qq 907974064或者github issue留言
## 地址 [https://github.com/ning1875/xprober](https://github.com/ning1875/xprober

## xprober特點

- 基於公有混合雲ec2的ping監控,可以得到不同region之間的網絡延遲

- 可以從不同region對http接口發起探測,可以trace 一個http請求的各個stage的耗時

- icmp target可由 存活agent上報 / 可以在配置文件中指定

- http target 在配置文件中指定

## 預覽圖

### http 探測結果

### 互ping 結果

 

# 項目說明

xprober 是分佈式c / s架構接口檢測框架:

  • Ping監控:基於不同區域之間的公共雲混合雲ec2檢測
  • Ping監視:根據代理啓動來建立目標池,可以獲取兩個區域的Ping結果作爲彼此的源和目標
  • 目標源:同時,它還支持服務器端配置文件以指定目標
  • Http監視:它可以獲取從不同區域到目標接口在不同http階段花費的時間

服務器端邏輯

  • RPC接收代理IP報告
  • 股票代碼將目標刷新到本地地圖
  • RPC爲代理商提供目標
  • rpc接收數據
  • 更新到本地緩存
  • 股票行情數據處理
  • 公開prome http指標

建造

$ git clone https://github.com/ning1875/xprober.git
# build agent
$ cd  xprober/pkg/cmd/agent && go build -o xprober-agent main.go 
# build server
$ cd ../server/ && go build -o xprober-server main.go 

啓動服務

# for server 
xprober-server --config.file=xprober.yml
# for agent 
xprober-agent --grpc.server-address=$server_rpc_ip:6001

與promtheus集成

將以下文本添加到promtheus.yaml的scrape_configs部分

# 
scrape_configs:

  - job_name: net_monitor
    honor_labels: true
    honor_timestamps: true
    scrape_interval: 10s
    scrape_timeout: 5s
    metrics_path: /metrics
    scheme: http
    static_configs:
    - targets:
      - $server_rpc_ip:6002

與grafana集成

在common / metrics.go中查看指標名稱並將其添加到grafana儀表板

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章