Skip to content

Commit

Workers Logs keep every log only where every failure matters, a tenth on the busy request paths

Every Worker kept 100% of its invocation logs. Billing, identity, runner, actions, deployments, status and sudo keep all of them: money, sign-in, runs someone will ask about, or too few requests to matter. Web, api, pages, repos, og, models, search, context, events, work, webhooks, integrations, packages, projects, security and docs keep a tenth. Head sampling drops an unsampled request's errors with the rest of its logs; the dashboard's error counts are not sampled. docs/RATE-LIMITS.md has the table and when to raise a Worker's rate to chase a rare error.

syntaqxcommitted Parentde553b2Browse files
23 files+47−230/23 viewed
+2−1
4848 { "name": "API_ANONYMOUS_LIMIT", "namespace_id": "4401", "simple": { "limit": 60, "period": 60 } },
4949 { "name": "API_TOKEN_LIMIT", "namespace_id": "4402", "simple": { "limit": 1000, "period": 60 } }
5050 ],
51− "observability": { "enabled": true }
51+ // Logs of a tenth of requests: agents call it constantly.
52+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
5253 }
+3−1
88 "directory": "./dist",
99 "not_found_handling": "404-page"
1010 },
11− "routes": [{ "pattern": "docs.g1t.sh", "custom_domain": true }]
11+ "routes": [{ "pattern": "docs.g1t.sh", "custom_domain": true }],
12+ // Logs of a tenth of requests: files only, nothing to debug in each.
13+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
1214 }
+2−1
7676 { "name": "STATUS_SUBSCRIBE_LIMIT", "namespace_id": "4601", "simple": { "limit": 3, "period": 60 } },
7777 { "name": "STATUS_EMAIL_LIMIT", "namespace_id": "4602", "simple": { "limit": 2, "period": 60 } }
7878 ],
79− "observability": { "enabled": true }
79+ // Every log kept: few requests, and the checks' failures are what it is for.
80+ "observability": { "enabled": true, "head_sampling_rate": 1 }
8081 }
+2−1
4242 // The Access application needs a Service Auth policy including it.
4343 "STAFF_SERVICE_TOKENS": "434297ede60761875e84742d0486cf27.access=claude"
4444 },
45− "observability": { "enabled": true },
45+ // Every log kept: staff only, few requests.
46+ "observability": { "enabled": true, "head_sampling_rate": 1 },
4647 "upload_source_maps": true
4748 }
+2−1
5454 { "name": "GIT_ANONYMOUS_LIMIT", "namespace_id": "4205", "simple": { "limit": 120, "period": 60 } },
5555 { "name": "GIT_SIGNED_LIMIT", "namespace_id": "4206", "simple": { "limit": 1200, "period": 60 } }
5656 ],
57− "observability": { "enabled": true },
57+ // Logs of a tenth of requests: every page view is one, too many to keep all.
58+ "observability": { "enabled": true, "head_sampling_rate": 0.1 },
5859 "upload_source_maps": true
5960 }
+2−1
4141 },
4242 // Schedules, jobs waiting for room, and jobs whose runner went quiet.
4343 "triggers": { "crons": ["* * * * *"] },
44− "observability": { "enabled": true }
44+ // Every log kept: few requests, and a failed job must be traceable.
45+ "observability": { "enabled": true, "head_sampling_rate": 1 }
4546 }
+2−1
145145 // STRIPE_WEBHOOK_SECRET: the signing secret (whsec_…) of the destination
146146 // made in Stripe's dashboard for https://api.g1t.sh/stripe/webhook.
147147 // Without it every event is refused (the replay still reads them).
148− "observability": { "enabled": true }
148+ // Every log kept: money moves here, and every failure matters.
149+ "observability": { "enabled": true, "head_sampling_rate": 1 }
149150 }
+2−1
4141 { "queue": "g1t-context-jobs", "max_batch_size": 1, "max_batch_timeout": 1, "max_retries": 2 }
4242 ]
4343 },
44− "observability": { "enabled": true }
44+ // Logs of a tenth of requests: agents search it constantly.
45+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
4546 }
+2−1
5555 // Secret: CLOUDFLARE_API_TOKEN, scoped to Workers Scripts (edit) and
5656 // Account Analytics (read), and, for custom domains, SSL and
5757 // Certificates (edit) on the g1t.page zone. Without it nothing deploys.
58− "observability": { "enabled": true }
58+ // Every log kept: few requests, and a failed deploy must be traceable.
59+ "observability": { "enabled": true, "head_sampling_rate": 1 }
5960 }
+2−1
5656 // older than AUDIT_MIN_DAYS, the shortest any plan keeps, are asked about.
5757 "triggers": { "crons": ["41 3 * * *"] },
5858 "vars": { "AUDIT_MAX_DAYS": "400", "AUDIT_MIN_DAYS": "7" },
59− "observability": { "enabled": true }
59+ // Logs of a tenth of requests: every change in g1t is an event.
60+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
6061 }
+2−1
7070 "INVITE_STAFF_WORKSPACES": "flagon-io",
7171 "WAITLIST_NOTIFY_EMAIL": "hey@flagon.io"
7272 },
73− "observability": { "enabled": true }
73+ // Every log kept: sign-ins and tokens, where every failure matters.
74+ "observability": { "enabled": true, "head_sampling_rate": 1 }
7475 }
+2−1
4343 },
4444 // Secret: INTEGRATIONS_KEY, 64 hex characters. Connections' secrets are
4545 // sealed with it; without it nothing can be connected.
46− "observability": { "enabled": true }
46+ // Logs of a tenth of requests: every page and event asks it.
47+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
4748 }
+2−1
3030 // not hold g1t's key; WORKERS_AI_TOKEN, a Cloudflare API token with
3131 // Workers AI Read on this account, for the AI Gateway's open models
3232 // (without it AI_GATEWAY_TOKEN is tried, and needs that permission too).
33− "observability": { "enabled": true }
33+ // Logs of a tenth of requests: every model call is one.
34+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
3435 }
+2−1
3636 // Cards drawn for a cache miss, per address (src/index.ts). Past it,
3737 // the brand card. Id and limit: RATE_LIMITS in packages/contracts.
3838 "ratelimits": [{ "name": "OG_RENDER_LIMIT", "namespace_id": "4501", "simple": { "limit": 60, "period": 60 } }],
39− "observability": { "enabled": true }
39+ // Logs of a tenth of requests: every link shared is one.
40+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
4041 }
+2−1
7272 "queues": {
7373 "consumers": [{ "queue": "g1t-events-packages", "max_batch_size": 20, "max_batch_timeout": 1 }]
7474 },
75− "observability": { "enabled": true }
75+ // Logs of a tenth of requests: every registry pull is one.
76+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
7677 }
+2−1
2424 "dispatch_namespaces": [{ "binding": "APPS", "namespace": "g1t-deployments" }],
2525 // Custom domains: hostname to app, written by the deployments service.
2626 "kv_namespaces": [{ "binding": "DOMAINS", "id": "14bc5c233d4c46a5bbf23b5367cce5fd" }],
27− "observability": { "enabled": true }
27+ // Logs of a tenth of requests: every visit to a deployed site is one.
28+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
2829 }
+2−1
2828 "queues": {
2929 "consumers": [{ "queue": "g1t-events-projects", "max_batch_size": 20, "max_batch_timeout": 1 }]
3030 },
31− "observability": { "enabled": true }
31+ // Logs of a tenth of requests: every repository page asks it.
32+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
3233 }
+2−1
132132 { "name": "PACK_FILL_LIMIT", "namespace_id": "4301", "simple": { "limit": 30, "period": 60 } },
133133 { "name": "ANONYMOUS_FETCH_LIMIT", "namespace_id": "4302", "simple": { "limit": 120, "period": 60 } }
134134 ],
135− "observability": { "enabled": true }
135+ // Logs of a tenth of requests: every git request and page is one.
136+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
136137 }
+2−1
119119 "BACKUPS_PER_SWEEP": "4",
120120 "BACKUPS_RUNNING": "6"
121121 },
122− "observability": { "enabled": true }
122+ // Every log kept: few requests, and a failed run must be traceable.
123+ "observability": { "enabled": true, "head_sampling_rate": 1 }
123124 }
+2−1
3434 { "queue": "g1t-search-jobs", "max_batch_size": 1, "max_batch_timeout": 1, "max_retries": 3 }
3535 ]
3636 },
37− "observability": { "enabled": true }
37+ // Logs of a tenth of requests: every search is one.
38+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
3839 }
+2−1
4545 "vars": {
4646 "SITE_URL": "https://g1t.sh"
4747 },
48− "observability": { "enabled": true }
48+ // Logs of a tenth of requests: every push and page asks it.
49+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
4950 }
+2−1
2929 "triggers": { "crons": ["* * * * *"] },
3030 // Secret: WEBHOOKS_KEY, 64 hex characters. Webhooks' signing secrets are
3131 // sealed with it; without it none can be made.
32− "observability": { "enabled": true }
32+ // Logs of a tenth of requests: every event is a delivery to look up.
33+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
3334 }
+2−1
2626 "queues": {
2727 "consumers": [{ "queue": "g1t-events-work", "max_batch_size": 100, "max_batch_timeout": 1 }]
2828 },
29− "observability": { "enabled": true }
29+ // Logs of a tenth of requests: every issue and pull request page asks it.
30+ "observability": { "enabled": true, "head_sampling_rate": 0.1 }
3031 }