Skip to content

Commit 069acd1

Browse files
pingping 2.0: radical simplification — a pure local oscilloscope
- flat storage only (no tiering); raw JSONL retention extended to 300 days - English-only UI; i18n machinery removed - no login/session system; startup tip suggests --localhost + reverse proxy for auth/TLS - all webhook/notification code removed: probe -> text files -> smoke graph, nothing else - redundant code trimmed (detector reduced to burst marking, single-page UI rebuilt) - alerting, multi-platform push, hot reload and tiered storage live on in sibling project fogping
1 parent a60d492 commit 069acd1

19 files changed

Lines changed: 338 additions & 1793 deletions

DEPLOY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ server {
7474
}
7575
```
7676

77-
此时可不设 `web_password`(反代已挡在前面),或两层都开当双保险
77+
pingping 自身不做认证,反代就是你的门

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ smokeping--- https://github.com/oetiker/SmokePing
110110

111111
- ⭐ Star
112112
- [GitHub Sponsors](https://github.com/sponsors/githubflyideas)
113+
## Design notes
114+
115+
pingping 2.0 is deliberately a **local, read-only oscilloscope**: probes go in, JSONL text files
116+
sit on disk (300-day retention, deleted nightly), smoke graphs come out. No accounts, no push
117+
integrations, no database. Run `./pingping --localhost` and put Caddy/Nginx in front if you need
118+
auth or TLS. If you want alerting, multi-platform notifications, hot reload and tiered storage,
119+
that lives in the sibling project [fogping](https://github.com/githubflyideas/fogping).
120+
113121
## License
114122

115123
MIT

alerts.example.jsonc

Lines changed: 0 additions & 12 deletions
This file was deleted.

config.example.jsonc

Lines changed: 12 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,25 @@
11
{
2-
// pingping 主配置示例 —— 复制为 pingping.jsonc 后修改
3-
// 配置可拆分(可选):webhooks → webhooks.jsonc,告警阈值 → alerts.jsonc(与本文件同目录,
4-
// 存在即优先);探测目标推荐放 targets/ping.list、tcp.list(见 targets/*.example)
5-
// 支持 // 和 /* */ 注释。所有字段都有合理默认值,最小配置只需 targets + webhooks。
2+
// pingping — copy to pingping.jsonc and edit. JSONC: // and /* */ comments allowed.
3+
// Everything has a sane default; the minimal config is just your targets.
64

7-
"listen": "0.0.0.0:8517", // Web 监听地址
8-
"data_dir": "./data", // 数据目录(JSONL 文本文件,可 grep 可 tar)
9-
"web_base_url": "", // 飞书卡片按钮的链接,如 http://10.0.0.5:8517,留空则卡片不带按钮
10-
"instance": "", // 告警来源标识,多实例部署时区分是谁在叫;不填默认取主机名
11-
"web_user": "admin", // Web 登录用户名
12-
"web_password": "", // Web 登录密码(明文);留空 = 不启用登录
13-
"extra": { "环境": "生产" }, // 全局自定义字段,渲染进所有告警/恢复卡片
5+
"listen": "0.0.0.0:8517", // web UI address (use --localhost flag to bind 127.0.0.1 only)
6+
"data_dir": "./data", // JSONL text files — grep-able, tar-able
7+
"targets_dir": "./targets", // ping.list / tcp.list, one target per line:
8+
// echo "1.2.3.4 Guangzhou pace=fast" >> targets/ping.list
9+
// echo "10.0.0.5:443 Gateway" >> targets/tcp.list
10+
// line format: host[:port] [name] [pace=fast|slow] [interval=sec]
1411

15-
// 目标列表目录:推荐用 targets/ping.list 和 targets/tcp.list 管理目标 —— 一行一个,加监控只需
16-
// echo "1.2.3.4 广州电信 pace=fast 负责人=张三" >> targets/ping.list (重启生效)
17-
// echo "10.0.0.5:443 网关" >> targets/tcp.list
18-
// 行格式:host[:port] [名称] [pace=] [sensitivity=] [interval=] [alerts=false] [自定义k=v]
19-
"targets_dir": "./targets",
20-
21-
// 需要完整 JSON 结构的目标也可以直接写在这里,与列表合并加载。type: icmp(默认)| tcp
22-
// 节奏三档 pace: fast(15s/每轮30包) normal(60s) slow(300s);显式 interval_sec 优先级最高
23-
// 敏感度三档 sensitivity: strict(核心链路,早叫) normal relaxed(天生就抖的链路,少叫)
12+
// Inline targets also work (merged with the lists):
2413
"targets": [
25-
{ "name": "跨境专线", "type": "icmp", "host": "59.43.247.1",
26-
"pace": "fast", "sensitivity": "strict",
27-
"extra": { "机房": "GZ1", "负责人": "张三" } },
28-
{ "name": "一般业务", "type": "icmp", "host": "202.96.128.86" },
29-
{ "name": "留档观察", "type": "icmp", "host": "210.22.70.3",
30-
"pace": "slow", "alerts": false },
31-
{ "name": "API 网关", "type": "tcp", "host": "10.0.0.5", "port": 443,
32-
"interval_sec": 30 }
14+
// { "name": "HK-CN2", "type": "icmp", "host": "59.43.247.1", "pace": "fast" }
3315
],
3416

35-
// 全局探测默认值(pace 未命中时生效)
3617
"probe": {
37-
"interval_sec": 60,
18+
"interval_sec": 60, // default cadence; pace=fast → 15s/30pkt, pace=slow → 300s
3819
"packets": 20,
3920
"gap_ms": 50,
4021
"timeout_ms": 1000
4122
},
4223

43-
// 飞书自定义机器人 webhook(群设置 → 群机器人 → 自定义机器人)
44-
// secret: 机器人开启"签名校验"后的密钥,没开留空
45-
// kinds: 这个群只收哪些消息(alert recovery heartbeat daily manual),不填 = 全收
46-
"webhooks": [
47-
{ "name": "运维群", "url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxx",
48-
"secret": "", "kinds": ["alert", "recovery", "heartbeat"] },
49-
{ "name": "领导群", "url": "https://open.feishu.cn/open-apis/bot/v2/hook/yyyyyyyy",
50-
"kinds": ["daily"] },
51-
{ "name": "自研平台", "url": "https://your-platform/hook",
52-
"format": "json" } // 裸 JSON 事件(source/kind/title/body/event),任意系统可接
53-
],
54-
55-
// 告警基准阈值(sensitivity 三档在此基础上缩放,一般不需要动)
56-
"alerts": {
57-
"cooldown_min": 30, // 同一告警重复推送冷却
58-
"recover_min": 15, // 持续正常多久才发恢复
59-
"degrade_ratio": 1.5, // P99 超基线 1.5 倍判劣化
60-
"degrade_min_ms": 10, // 且绝对增量 ≥ 10ms(防低延迟链路误报)
61-
"burst_z": 3.5, // 丢包突发的 robust z-score 阈值
62-
"burst_alert_n": 3 // 30 分钟内突发 3 次升级为告警
63-
},
64-
65-
// 周心跳:证明 pingping 自己活着(dead man's switch)。weekday: 0=周日 1=周一
66-
"heartbeat": { "enabled": true, "weekday": 1, "hour": 10 },
67-
68-
// 日报:默认关。喜欢每天看一眼数字的人再打开
69-
"daily_report": { "enabled": false, "hour": 10 },
70-
71-
"retention_days": 14 // 原始 JSONL 保留天数;日汇总永久保留
24+
"retention_days": 300 // raw sample files older than this are deleted nightly
7225
}

0 commit comments

Comments
 (0)