| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // codegraph telemetry ingest — see README.md and docs/design/telemetry.md.
- // Secrets are NOT configured here: POSTHOG_KEY is set via `wrangler secret put POSTHOG_KEY`.
- {
- "$schema": "node_modules/wrangler/config-schema.json",
- "name": "codegraph-telemetry",
- "main": "src/index.ts",
- "compatibility_date": "2026-06-12",
- "compatibility_flags": ["nodejs_compat"],
- // First-party endpoint. The custom domain auto-provisions DNS + cert when the
- // getcodegraph.com zone is on the deploying account. workers.dev stays off so
- // the only public surface is the documented one.
- "routes": [{ "pattern": "telemetry.getcodegraph.com", "custom_domain": true }],
- "workers_dev": false,
- "observability": { "enabled": true, "head_sampling_rate": 1 },
- // Non-secret config. Swap host here if the backend ever moves (EU, self-hosted…).
- "vars": { "POSTHOG_HOST": "https://us.i.posthog.com" },
- // Telemetry storage. Schema + the chart each table serves: migrations/0001_init.sql.
- // Apply with `npm run db:migrate:local` (local state) / `npm run db:migrate` (remote).
- // The admin dashboard worker binds this same database read-mostly, also as `DB`.
- "d1_databases": [
- {
- "binding": "DB",
- "database_name": "codegraph-telemetry",
- "database_id": "5ed36dfb-d2d7-4e35-9e63-a1b99d0b1ed3",
- "migrations_dir": "migrations"
- }
- ],
- // Per-machine_id rate limit. Legit clients flush a handful of times per day;
- // 6/min absorbs install+index bursts while capping abuse.
- "ratelimits": [
- {
- "name": "MACHINE_RATE_LIMITER",
- "namespace_id": "1001",
- "simple": { "limit": 6, "period": 60 }
- }
- ]
- }
|