返回 CodeWhale
wrangler.jsonc
根目录 / telemetry-ingest / wrangler.jsonc
1 {
2 "$schema": "node_modules/wrangler/config-schema.json",
3 "name": "codewhale-telemetry-ingest",
4 "main": "src/index.ts",
5 "compatibility_date": "2025-04-01",
6
7 // Write-only ingest. One POST route, no assets, no KV, no D1, no queues, no
8 // cron. Nothing here reads back what was written; querying is the SQL API,
9 // authenticated with the owner's token, out of band. See README.md.
10
11 // Workers Analytics Engine is the only storage. The dataset is created
12 // implicitly on the first successful `writeDataPoint`, so there is no
13 // resource to provision ahead of the deploy.
14 "analytics_engine_datasets": [
15 {
16 "binding": "TELEMETRY",
17 "dataset": "codewhale_telemetry"
18 }
19 ],
20
21 // Rate limiting without network addresses: `INGEST_RATE_LIMITER` enforces a
22 // server-keyed per-location ceiling before parsing/delivery so rotating
23 // `install_id` cannot bypass the Worker quota; `RATE_LIMITER` caps any
24 // single `install_id` at 20 POSTs per 60s.
25 "ratelimits": [
26 {
27 "name": "RATE_LIMITER",
28 "namespace_id": "1001",
29 "simple": {
30 "limit": 20,
31 "period": 60
32 }
33 },
34 {
35 "name": "INGEST_RATE_LIMITER",
36 "namespace_id": "1002",
37 "simple": {
38 "limit": 600,
39 "period": 60
40 }
41 }
42 ],
43
44 // Invocation logs are OFF deliberately. Cloudflare describes them as
45 // "enriched with information available to Cloudflare in the context of the
46 // invocation", which is exactly the class of automatic per-request record
47 // this service promises not to keep. Nothing in `src/` logs anything either.
48 // `enabled` stays true so the owner can turn a specific, payload-free metric
49 // on later without a config archaeology dig.
50 "observability": {
51 "enabled": true,
52 "logs": {
53 "invocation_logs": false
54 }
55 }
56
57 ,
58 // ROUTE. A self-describing hostname on purpose: someone inspecting their own
59 // network traffic should be able to tell what this is from the name alone.
60 // An opaque `t.` would have been shorter and would have looked evasive.
61 "routes": [
62 { "pattern": "telemetry.codewhale.net", "custom_domain": true }
63 ]
64 //
65 // `https://telemetry.codewhale.net/v1/telemetry` is the shipped default for
66 // `telemetry_endpoint` (`DEFAULT_TELEMETRY_ENDPOINT` in
67 // `crates/config/src/lib.rs`), so real batches arrive here. Only from
68 // sessions that have not opted out. v0.9.6 discloses anonymous usage
69 // counting on first interactive launch and enables it by default. See
70 // README.md.
71 }
72
72 lines Plain Text