1
0

wrangler.jsonc 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // codegraph telemetry ingest — see README.md and docs/design/telemetry.md.
  2. // Secrets are NOT configured here: POSTHOG_KEY is set via `wrangler secret put POSTHOG_KEY`.
  3. {
  4. "$schema": "node_modules/wrangler/config-schema.json",
  5. "name": "codegraph-telemetry",
  6. "main": "src/index.ts",
  7. "compatibility_date": "2026-06-12",
  8. "compatibility_flags": ["nodejs_compat"],
  9. // First-party endpoint. The custom domain auto-provisions DNS + cert when the
  10. // getcodegraph.com zone is on the deploying account. workers.dev stays off so
  11. // the only public surface is the documented one.
  12. "routes": [{ "pattern": "telemetry.getcodegraph.com", "custom_domain": true }],
  13. "workers_dev": false,
  14. "observability": { "enabled": true, "head_sampling_rate": 1 },
  15. // Non-secret config. Swap host here if the backend ever moves (EU, self-hosted…).
  16. "vars": { "POSTHOG_HOST": "https://us.i.posthog.com" },
  17. // Per-machine_id rate limit. Legit clients flush a handful of times per day;
  18. // 6/min absorbs install+index bursts while capping abuse.
  19. "ratelimits": [
  20. {
  21. "name": "MACHINE_RATE_LIMITER",
  22. "namespace_id": "1001",
  23. "simple": { "limit": 6, "period": 60 }
  24. }
  25. ]
  26. }