{"id":22049260,"url":"https://github.com/ning1875/xprober","last_synced_at":"2025-05-08T23:07:13.776Z","repository":{"id":119338220,"uuid":"267022421","full_name":"ning1875/xprober","owner":"ning1875","description":"xprober 是一个分布式探测框架、可用来做ping/http探测 ","archived":false,"fork":false,"pushed_at":"2023-03-31T01:33:15.000Z","size":724,"stargazers_count":37,"open_issues_count":1,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T23:07:12.344Z","etag":null,"topics":["golang","http","ping","prober","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ning1875.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-26T11:17:00.000Z","updated_at":"2025-05-08T02:54:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecd59d7a-5226-46bb-80db-acdc0a103e73","html_url":"https://github.com/ning1875/xprober","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ning1875%2Fxprober","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ning1875%2Fxprober/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ning1875%2Fxprober/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ning1875%2Fxprober/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ning1875","download_url":"https://codeload.github.com/ning1875/xprober/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160777,"owners_count":21863629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http","ping","prober","prometheus"],"created_at":"2024-11-30T14:14:46.242Z","updated_at":"2025-05-08T23:07:13.768Z","avatar_url":"https://github.com/ning1875.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 架构图\n\n![image](./images/xprober架构图.jpg)\n# Xprober预览图\n\n### 互ping 结果\n\n![image](./images/ping.jpg)\n### http 探测结果\n![image](./images/http.jpg)\n\n### 专线延迟报警\n![image](./images/zhuanxian_mon.jpg)\n\n\n# 需求分析\n## 网络监控工具调研\n- 多region为一般公司内网架构\n- 这个工具能提供网络性能数据监控\n- 同时也参考调研了tor维度的[pingmesh方案](https://zdyxry.github.io/2020/03/26/%E8%AE%BA%E6%96%87%E9%98%85%E8%AF%BB-%E3%80%8APingmesh-A-Large-Scale-System-for-Data-Center-Network-Latency-Measurement-and-Analysis%E3%80%8B/)\n![image](./images/ping_mesh.jpg)\n\n## 总结\n**key1** 其实最主要能看到公有混合云内网所有region两两之间的延迟和丢包率\n\n- 维度落在region而不是tor，即不关心同region内的延迟\n- 如果采用单个agent集中向外探测的问题: 效率问题、探测节点网络质量问题导致结果出错\n- 不关心单个ip或vip的结果，而是需要用多个ip结果汇总代表这个region的网络质量\n- c/s架构: client负责探测，server生成/配置探测target池，server通过rpc下发个体client target ，agent通过rpc上报探测结果给server端处理\n\n- 被探测target列表支持配置同时能更\"智能点\",所以设置成agent启动后能自动生成target池:\n```\neg: 4个region{a-d}中各2个vm{1-8}，结果就是不同reigon间的vm需要互相探测，vm1的target就是vm{3-8} ，vm3的target就是vm{1，2,4-8} \n```\n- agent为公有云的vm，获取region并上报reigon和ip\n```\n公有云上的vm 利用接口http://169.254.169.254/latest/meta-data/placement/availability-zone 可以获取vm的region\n```\n**key2** 能够对关键http接口发起探测\n- 要能覆盖整个http各个stage\n- 能够反映内网各个region到此接口的延迟情况\n\n**key3** 数据接入prometheus，由grafana展示\n# xprober\n地址 [https://github.com/ning1875/xprober](https://github.com/ning1875/xprober) \n## 项目说明\n\n`xprober` 是分布式c/s架构ping\u0026http探测框架：\n\n* Ping监控：基于不同区域之间的公共云混合云ec2检测\n* Ping监控：根据代理启动来建立目标池，可以获取两个区域的Ping结果作为彼此的源和目标\n* 目标源：同时，它还支持服务器端配置文件以指定目标\n* Http监控：它可以获取从不同区域到目标接口在不同http阶段花费的时间\n\n\n# 如何使用\n- 在公有云各个region中各开至少2个小规格的vm: 1c2g即可\n- 编译并部署server服务\n- 编译并部署agent服务\n- 准备prometheus和grafana\n## 编译\n\n```\n$ git clone https://github.com/ning1875/xprober.git\n# build agent\n$ cd  xprober/pkg/cmd/agent \u0026\u0026 go build -o xprober-agent main.go \n# build server\n$ cd ../server/ \u0026\u0026 go build -o xprober-server main.go` \n```\n## 启动服务\n\n```\n# for server \nxprober-server --config.file=xprober.yml\n# for agent \nxprober-agent --grpc.server-address=$server_rpc_ip:6001\n```\n## 与promtheus集成\n\n\n将以下文本添加到promtheus.yaml的scrape_configs部分,server_rpc_ip为server的ip\n\n``` \nscrape_configs:\n\n  - job_name: net_monitor\n    honor_labels: true\n    honor_timestamps: true\n    scrape_interval: 10s\n    scrape_timeout: 5s\n    metrics_path: /metrics\n    scheme: http\n    static_configs:\n    - targets:\n      - $server_rpc_ip:6002\n```\n## 与grafana集成\n在common/metrics.go中查看指标名称并将其添加到grafana仪表板\n```\n// ping 指标\nping_latency_millonseconds\nping_packageDrop_rate\nping_target_success\n\n// http 指标\nhttp_resolveDuration_millonseconds\nhttp_tlsDuration_millonseconds\nhttp_connectDuration_millonseconds\nhttp_processingDuration_millonseconds\nhttp_transferDuration_millonseconds\nhttp_interface_success\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fning1875%2Fxprober","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fning1875%2Fxprober","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fning1875%2Fxprober/lists"}