匿名、可选、默认关闭。位于 internal/telemetry/。
DO_NOT_TRACK=1 → 强制关闭OPENTMD_TELEMETRY=0/false/off/no → 关闭OPENTMD_TELEMETRY=1/true/on/yes → 开启~/.opentmd/telemetry/enabled 标记文件存在 → 开启reason: default off)OPENTMD_TELEMETRY_ENDPOINT 为空时不会上传,事件只留在本机队列。不会向任何默认服务器上报。
Recorder.Record(name, fields) 在序列化前执行 Scrub:
token / secret / password / api_key / authorization / cookie / credential / private_key 的字段prompt / content / message / args / output / diff / command / path当前运行时只记录内容无关的 turn_complete:
{"event":"turn_complete","at":"...","mode":"edits","stop_reason":"complete",
"model":"deepseek-chat","provider":"deepseek"}
~/.opentmd/telemetry/queue/<date>-<pid>.ndjson
每个事件一行,目录 0700、文件 0600。clear 删除队列,dump 打印原始行。
Upload)| 响应 | 行为 |
|---|---|
| 2xx | 删除该批次 |
| 400 / 413 / 422 | 丢弃该批次(永久拒绝) |
| 401 / 403 | 保留,返回 1h 退避 |
| 429 | 保留,使用 Retry-After(缺省 5m) |
| 5xx / 网络错误 | 保留,下次重试 |
opentmd telemetry status # 开关、原因、队列、待发送数、endpoint
opentmd telemetry enable # 写 opt-in 标记
opentmd telemetry disable # 删除标记
opentmd telemetry dump # 打印队列 NDJSON
opentmd telemetry clear # 清空队列
opentmd telemetry upload --endpoint https://example.com/ingest
环境变量见 配置指南 — 环境变量。