| 28 | const LABEL_RE = /^[A-Za-z0-9_.:+/ @()-]+$/; |
| 29 | |
| 30 | const infoText = (keepDays: number): string => `codegraph anonymous-telemetry ingest. |
| 31 | |
| 32 | What gets collected (and what never does) is documented field-by-field: |
| 33 | https://github.com/colbymchenry/codegraph/blob/main/docs/design/telemetry.md |
| 34 | This endpoint's full source: |
| 35 | https://github.com/colbymchenry/codegraph/tree/main/telemetry-worker |
| 36 | |
| 37 | Guarantees: no code, file paths, repo/file/symbol names, or query strings are ever |
| 38 | sent; the client IP is never read or stored; the machine ID is a random UUID the |
| 39 | client mints locally and can delete at any time. Accepted events are stored in our |
| 40 | own database on Cloudflare (D1) and are never forwarded to any third-party analytics |
| 41 | vendor. The stored schema is the complete list of what is kept: |
| 42 | https://github.com/colbymchenry/codegraph/blob/main/telemetry-worker/migrations/0001_init.sql |
| 43 | |
| 44 | Individual events are deleted after ${keepDays} days. What outlives them: anonymous |
| 45 | daily totals (counts per day of things like operating system, version and language), |
| 46 | and which days each machine ID was active, so returning-user numbers survive. No event |
| 47 | details, and still nothing that identifies a person or a codebase. |
| 48 | |
| 49 | Disable any time: codegraph telemetry off | CODEGRAPH_TELEMETRY=0 | DO_NOT_TRACK=1 |
| 50 | `; |
| 51 | |
| 52 | type JsonObject = Record<string, unknown>; |
| 53 | |