pi-cloudflare 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -177
- package/package.json +7 -42
- package/plugin.json +3 -3
- package/skills/agents-sdk/SKILL.md +17 -36
- package/skills/agents-sdk/references/client-sdk.md +7 -106
- package/skills/agents-sdk/references/human-in-the-loop.md +6 -63
- package/skills/agents-sdk/references/mcp.md +9 -184
- package/skills/agents-sdk/references/queue-retries.md +12 -73
- package/skills/agents-sdk/references/server-driven-messages.md +4 -60
- package/skills/agents-sdk/references/state-scheduling.md +10 -166
- package/skills/agents-sdk/references/streaming-chat.md +11 -193
- package/skills/agents-sdk/references/webhooks-push.md +2 -2
- package/skills/agents-sdk/references/workflows.md +14 -125
- package/skills/cloudflare/SKILL.md +135 -248
- package/skills/cloudflare/references/ai-gateway/README.md +17 -165
- package/skills/cloudflare/references/ai-gateway/configuration.md +14 -107
- package/skills/cloudflare/references/ai-gateway/dynamic-routing.md +12 -79
- package/skills/cloudflare/references/ai-gateway/features.md +22 -96
- package/skills/cloudflare/references/ai-gateway/sdk-integration.md +17 -112
- package/skills/cloudflare/references/ai-gateway/troubleshooting.md +14 -86
- package/skills/cloudflare/references/ai-search/README.md +17 -130
- package/skills/cloudflare/references/ai-search/api.md +10 -84
- package/skills/cloudflare/references/ai-search/configuration.md +16 -88
- package/skills/cloudflare/references/ai-search/gotchas.md +13 -81
- package/skills/cloudflare/references/ai-search/patterns.md +12 -82
- package/skills/cloudflare/references/analytics-engine/api.md +1 -1
- package/skills/cloudflare/references/api/README.md +2 -2
- package/skills/cloudflare/references/api/configuration.md +1 -1
- package/skills/cloudflare/references/bindings/README.md +11 -117
- package/skills/cloudflare/references/bindings/api.md +17 -201
- package/skills/cloudflare/references/bindings/configuration.md +20 -188
- package/skills/cloudflare/references/bindings/gotchas.md +16 -206
- package/skills/cloudflare/references/bindings/patterns.md +15 -195
- package/skills/cloudflare/references/bot-management/README.md +1 -1
- package/skills/cloudflare/references/browser-rendering/README.md +13 -73
- package/skills/cloudflare/references/browser-rendering/api.md +9 -105
- package/skills/cloudflare/references/browser-rendering/configuration.md +9 -75
- package/skills/cloudflare/references/browser-rendering/gotchas.md +12 -85
- package/skills/cloudflare/references/browser-rendering/patterns.md +9 -88
- package/skills/cloudflare/references/c3/README.md +6 -5
- package/skills/cloudflare/references/c3/api.md +3 -4
- package/skills/cloudflare/references/c3/patterns.md +4 -6
- package/skills/cloudflare/references/cache-reserve/README.md +1 -1
- package/skills/cloudflare/references/containers/README.md +15 -77
- package/skills/cloudflare/references/containers/api.md +13 -187
- package/skills/cloudflare/references/containers/configuration.md +15 -188
- package/skills/cloudflare/references/containers/gotchas.md +16 -178
- package/skills/cloudflare/references/containers/patterns.md +14 -198
- package/skills/cloudflare/references/cron-triggers/README.md +13 -92
- package/skills/cloudflare/references/cron-triggers/api.md +11 -191
- package/skills/cloudflare/references/cron-triggers/configuration.md +11 -175
- package/skills/cloudflare/references/cron-triggers/gotchas.md +13 -195
- package/skills/cloudflare/references/cron-triggers/patterns.md +12 -184
- package/skills/cloudflare/references/d1/README.md +9 -127
- package/skills/cloudflare/references/d1/api.md +16 -194
- package/skills/cloudflare/references/d1/configuration.md +16 -189
- package/skills/cloudflare/references/d1/gotchas.md +16 -96
- package/skills/cloudflare/references/d1/patterns.md +14 -183
- package/skills/cloudflare/references/do-storage/README.md +11 -70
- package/skills/cloudflare/references/do-storage/api.md +11 -99
- package/skills/cloudflare/references/do-storage/configuration.md +11 -107
- package/skills/cloudflare/references/do-storage/gotchas.md +12 -147
- package/skills/cloudflare/references/do-storage/patterns.md +11 -190
- package/skills/cloudflare/references/do-storage/testing.md +8 -178
- package/skills/cloudflare/references/email-routing/README.md +14 -84
- package/skills/cloudflare/references/email-routing/api.md +10 -192
- package/skills/cloudflare/references/email-routing/configuration.md +13 -186
- package/skills/cloudflare/references/email-routing/gotchas.md +12 -193
- package/skills/cloudflare/references/email-routing/patterns.md +10 -226
- package/skills/cloudflare/references/email-workers/README.md +13 -146
- package/skills/cloudflare/references/email-workers/api.md +12 -234
- package/skills/cloudflare/references/email-workers/configuration.md +14 -110
- package/skills/cloudflare/references/email-workers/gotchas.md +15 -125
- package/skills/cloudflare/references/email-workers/patterns.md +14 -100
- package/skills/cloudflare/references/flagship/README.md +2 -2
- package/skills/cloudflare/references/hyperdrive/README.md +17 -72
- package/skills/cloudflare/references/hyperdrive/api.md +19 -136
- package/skills/cloudflare/references/hyperdrive/configuration.md +27 -159
- package/skills/cloudflare/references/hyperdrive/gotchas.md +15 -72
- package/skills/cloudflare/references/hyperdrive/patterns.md +12 -187
- package/skills/cloudflare/references/images/README.md +9 -58
- package/skills/cloudflare/references/images/api.md +13 -96
- package/skills/cloudflare/references/images/configuration.md +17 -211
- package/skills/cloudflare/references/images/gotchas.md +16 -99
- package/skills/cloudflare/references/images/patterns.md +16 -115
- package/skills/cloudflare/references/kv/README.md +9 -83
- package/skills/cloudflare/references/kv/api.md +12 -154
- package/skills/cloudflare/references/kv/configuration.md +11 -139
- package/skills/cloudflare/references/kv/gotchas.md +15 -129
- package/skills/cloudflare/references/kv/patterns.md +15 -190
- package/skills/cloudflare/references/miniflare/README.md +15 -98
- package/skills/cloudflare/references/miniflare/api.md +16 -187
- package/skills/cloudflare/references/miniflare/configuration.md +12 -169
- package/skills/cloudflare/references/miniflare/gotchas.md +15 -160
- package/skills/cloudflare/references/miniflare/patterns.md +15 -177
- package/skills/cloudflare/references/network-interconnect/README.md +1 -1
- package/skills/cloudflare/references/network-interconnect/gotchas.md +1 -1
- package/skills/cloudflare/references/network-interconnect/patterns.md +1 -1
- package/skills/cloudflare/references/observability/README.md +20 -81
- package/skills/cloudflare/references/observability/api.md +20 -164
- package/skills/cloudflare/references/observability/configuration.md +18 -164
- package/skills/cloudflare/references/observability/gotchas.md +19 -109
- package/skills/cloudflare/references/observability/patterns.md +12 -103
- package/skills/cloudflare/references/pages/README.md +13 -81
- package/skills/cloudflare/references/pages/api.md +10 -201
- package/skills/cloudflare/references/pages/configuration.md +16 -201
- package/skills/cloudflare/references/pages/gotchas.md +13 -197
- package/skills/cloudflare/references/pages/patterns.md +11 -200
- package/skills/cloudflare/references/pages-functions/README.md +13 -91
- package/skills/cloudflare/references/pages-functions/api.md +10 -140
- package/skills/cloudflare/references/pages-functions/configuration.md +11 -119
- package/skills/cloudflare/references/pages-functions/gotchas.md +17 -94
- package/skills/cloudflare/references/pages-functions/patterns.md +12 -133
- package/skills/cloudflare/references/pipelines/README.md +1 -1
- package/skills/cloudflare/references/pulumi/README.md +2 -2
- package/skills/cloudflare/references/queues/README.md +15 -87
- package/skills/cloudflare/references/queues/api.md +10 -200
- package/skills/cloudflare/references/queues/configuration.md +18 -142
- package/skills/cloudflare/references/queues/gotchas.md +16 -204
- package/skills/cloudflare/references/queues/patterns.md +19 -218
- package/skills/cloudflare/references/r2/README.md +17 -86
- package/skills/cloudflare/references/r2/api.md +14 -198
- package/skills/cloudflare/references/r2/configuration.md +17 -163
- package/skills/cloudflare/references/r2/gotchas.md +15 -188
- package/skills/cloudflare/references/r2/patterns.md +16 -191
- package/skills/cloudflare/references/r2-data-catalog/README.md +11 -70
- package/skills/cloudflare/references/r2-data-catalog/api.md +14 -89
- package/skills/cloudflare/references/r2-data-catalog/configuration.md +15 -96
- package/skills/cloudflare/references/r2-data-catalog/gotchas.md +14 -51
- package/skills/cloudflare/references/r2-data-catalog/patterns.md +11 -116
- package/skills/cloudflare/references/realtime-sfu/README.md +1 -1
- package/skills/cloudflare/references/realtimekit/README.md +1 -1
- package/skills/cloudflare/references/secrets-store/README.md +14 -66
- package/skills/cloudflare/references/secrets-store/api.md +14 -193
- package/skills/cloudflare/references/secrets-store/configuration.md +16 -176
- package/skills/cloudflare/references/secrets-store/gotchas.md +14 -92
- package/skills/cloudflare/references/secrets-store/patterns.md +14 -194
- package/skills/cloudflare/references/smart-placement/README.md +2 -2
- package/skills/cloudflare/references/static-assets/README.md +15 -59
- package/skills/cloudflare/references/static-assets/api.md +12 -195
- package/skills/cloudflare/references/static-assets/configuration.md +16 -186
- package/skills/cloudflare/references/static-assets/gotchas.md +18 -162
- package/skills/cloudflare/references/static-assets/patterns.md +13 -185
- package/skills/cloudflare/references/stream/README.md +15 -107
- package/skills/cloudflare/references/stream/api-live.md +16 -193
- package/skills/cloudflare/references/stream/api.md +19 -197
- package/skills/cloudflare/references/stream/configuration.md +16 -139
- package/skills/cloudflare/references/stream/gotchas.md +16 -128
- package/skills/cloudflare/references/stream/patterns.md +20 -182
- package/skills/cloudflare/references/tail-workers/README.md +14 -82
- package/skills/cloudflare/references/tail-workers/api.md +10 -197
- package/skills/cloudflare/references/tail-workers/configuration.md +13 -174
- package/skills/cloudflare/references/tail-workers/gotchas.md +12 -188
- package/skills/cloudflare/references/tail-workers/patterns.md +11 -176
- package/skills/cloudflare/references/terraform/README.md +2 -2
- package/skills/cloudflare/references/tunnel/README.md +13 -122
- package/skills/cloudflare/references/tunnel/api.md +11 -190
- package/skills/cloudflare/references/tunnel/configuration.md +12 -155
- package/skills/cloudflare/references/tunnel/gotchas.md +12 -144
- package/skills/cloudflare/references/tunnel/networking.md +12 -166
- package/skills/cloudflare/references/tunnel/patterns.md +12 -189
- package/skills/cloudflare/references/vectorize/README.md +15 -126
- package/skills/cloudflare/references/vectorize/api.md +14 -84
- package/skills/cloudflare/references/vectorize/configuration.md +14 -83
- package/skills/cloudflare/references/vectorize/gotchas.md +12 -73
- package/skills/cloudflare/references/vectorize/patterns.md +17 -83
- package/skills/cloudflare/references/waf/README.md +15 -107
- package/skills/cloudflare/references/waf/api.md +17 -202
- package/skills/cloudflare/references/waf/configuration.md +14 -199
- package/skills/cloudflare/references/waf/gotchas.md +15 -200
- package/skills/cloudflare/references/waf/patterns.md +13 -193
- package/skills/cloudflare/references/workerd/README.md +2 -2
- package/skills/cloudflare/references/workers-ai/README.md +14 -187
- package/skills/cloudflare/references/workers-ai/api.md +10 -109
- package/skills/cloudflare/references/workers-ai/configuration.md +11 -92
- package/skills/cloudflare/references/workers-ai/gotchas.md +12 -111
- package/skills/cloudflare/references/workers-ai/patterns.md +9 -115
- package/skills/cloudflare/references/workers-for-platforms/README.md +3 -3
- package/skills/cloudflare/references/workers-vpc/README.md +1 -1
- package/skills/cloudflare/references/workflows/README.md +15 -69
- package/skills/cloudflare/references/workflows/api.md +12 -213
- package/skills/cloudflare/references/workflows/configuration.md +16 -150
- package/skills/cloudflare/references/workflows/gotchas.md +17 -88
- package/skills/cloudflare/references/workflows/patterns.md +19 -164
- package/skills/cloudflare-api-token/SKILL.md +1 -1
- package/skills/cloudflare-cf-cli/SKILL.md +44 -13
- package/skills/cloudflare-email-service/SKILL.md +6 -36
- package/skills/cloudflare-email-service/references/rest-api.md +12 -179
- package/skills/cloudflare-email-service/references/sending.md +17 -250
- package/skills/cloudflare-one/SKILL.md +4 -2
- package/skills/cloudflare-one-migrations/SKILL.md +1 -1
- package/skills/cloudflare-token-roll/SKILL.md +2 -5
- package/skills/durable-objects/SKILL.md +10 -16
- package/skills/durable-objects/references/rules.md +17 -293
- package/skills/durable-objects/references/testing.md +16 -257
- package/skills/nextjs-on-cloudflare/SKILL.md +33 -0
- package/skills/sandbox-migrate-to-next/SKILL.md +2 -2
- package/skills/sandbox-next/SKILL.md +3 -2
- package/skills/sandbox-next/references/api-quick-ref.md +15 -90
- package/skills/sandbox-stable/SKILL.md +1 -1
- package/skills/turnstile-spin/SKILL.md +14 -8
- package/skills/workers-best-practices/SKILL.md +36 -103
- package/skills/workers-best-practices/references/configuration.md +139 -0
- package/skills/workers-best-practices/references/platform-apis.md +51 -0
- package/skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +9 -134
- package/skills/wrangler/SKILL.md +48 -901
- package/bin/setup.mjs +0 -119
- package/dist/api-token.d.ts +0 -12
- package/dist/api-token.d.ts.map +0 -1
- package/dist/api-token.js +0 -23
- package/dist/api-token.js.map +0 -1
- package/dist/auth-flow.d.ts +0 -15
- package/dist/auth-flow.d.ts.map +0 -1
- package/dist/auth-flow.js +0 -90
- package/dist/auth-flow.js.map +0 -1
- package/dist/client.d.ts +0 -18
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -47
- package/dist/client.js.map +0 -1
- package/dist/config.d.ts +0 -20
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -10
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts +0 -22
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -65
- package/dist/index.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -2
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -106
- package/dist/mcp-server.js.map +0 -1
- package/dist/oauth.d.ts +0 -44
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -135
- package/dist/oauth.js.map +0 -1
- package/dist/proxy.d.ts +0 -30
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -41
- package/dist/proxy.js.map +0 -1
- package/dist/result-caps.d.ts +0 -23
- package/dist/result-caps.d.ts.map +0 -1
- package/dist/result-caps.js +0 -75
- package/dist/result-caps.js.map +0 -1
- package/dist/runtime.d.ts +0 -72
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -249
- package/dist/runtime.js.map +0 -1
- package/dist/servers.d.ts +0 -19
- package/dist/servers.d.ts.map +0 -1
- package/dist/servers.js +0 -40
- package/dist/servers.js.map +0 -1
- package/dist/token-store.d.ts +0 -32
- package/dist/token-store.d.ts.map +0 -1
- package/dist/token-store.js +0 -61
- package/dist/token-store.js.map +0 -1
- package/dist/tool-cache.d.ts +0 -25
- package/dist/tool-cache.d.ts.map +0 -1
- package/dist/tool-cache.js +0 -43
- package/dist/tool-cache.js.map +0 -1
- package/mcp.json +0 -15
- package/skills/cloudflare/references/agents-sdk/README.md +0 -89
- package/skills/cloudflare/references/agents-sdk/api.md +0 -190
- package/skills/cloudflare/references/agents-sdk/configuration.md +0 -182
- package/skills/cloudflare/references/agents-sdk/gotchas.md +0 -158
- package/skills/cloudflare/references/agents-sdk/patterns.md +0 -192
- package/skills/cloudflare/references/durable-objects/README.md +0 -185
- package/skills/cloudflare/references/durable-objects/api.md +0 -187
- package/skills/cloudflare/references/durable-objects/configuration.md +0 -160
- package/skills/cloudflare/references/durable-objects/gotchas.md +0 -197
- package/skills/cloudflare/references/durable-objects/patterns.md +0 -201
- package/skills/cloudflare/references/sandbox/README.md +0 -96
- package/skills/cloudflare/references/sandbox/api.md +0 -198
- package/skills/cloudflare/references/sandbox/configuration.md +0 -143
- package/skills/cloudflare/references/sandbox/gotchas.md +0 -194
- package/skills/cloudflare/references/sandbox/patterns.md +0 -201
- package/skills/cloudflare/references/turnstile/README.md +0 -99
- package/skills/cloudflare/references/turnstile/api.md +0 -240
- package/skills/cloudflare/references/turnstile/configuration.md +0 -222
- package/skills/cloudflare/references/turnstile/gotchas.md +0 -218
- package/skills/cloudflare/references/turnstile/patterns.md +0 -193
- package/skills/cloudflare/references/workers/README.md +0 -108
- package/skills/cloudflare/references/workers/api.md +0 -195
- package/skills/cloudflare/references/workers/configuration.md +0 -185
- package/skills/cloudflare/references/workers/frameworks.md +0 -197
- package/skills/cloudflare/references/workers/gotchas.md +0 -137
- package/skills/cloudflare/references/workers/patterns.md +0 -198
- package/skills/cloudflare/references/wrangler/README.md +0 -135
- package/skills/cloudflare/references/wrangler/api.md +0 -188
- package/skills/cloudflare/references/wrangler/configuration.md +0 -197
- package/skills/cloudflare/references/wrangler/gotchas.md +0 -197
- package/skills/cloudflare/references/wrangler/patterns.md +0 -209
- package/skills/cloudflare-auth-setup/SKILL.md +0 -59
- package/skills/workers-best-practices/references/review.md +0 -174
|
@@ -1,88 +1,27 @@
|
|
|
1
|
-
# Cloudflare Observability
|
|
1
|
+
# Cloudflare Observability
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this reference to choose a telemetry signal and find the maintained implementation guide. Fetch the linked documentation before writing configuration, queries, or export code; it is the source of truth for APIs, availability, retention, limits, and pricing.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Choose a signal
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| Need | Start here |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Store, search, and investigate historical Worker logs | [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
|
|
10
|
+
| Watch a deployment or reproduce an issue live | [Real-time logs and Wrangler tail](https://developers.cloudflare.com/workers/observability/logs/real-time-logs/) |
|
|
11
|
+
| Understand request flows and dependency latency | [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) |
|
|
12
|
+
| Monitor built-in request, error, and CPU metrics | [Metrics and analytics](https://developers.cloudflare.com/workers/observability/metrics-and-analytics/) |
|
|
13
|
+
| Record custom events and tenant-level usage for SQL analysis | [Analytics Engine](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
|
|
14
|
+
| Export logs and traces to an observability provider | [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
|
|
15
|
+
| Apply custom filtering, transformation, or delivery logic | [Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) |
|
|
16
|
+
| Deliver Workers Trace Events to a supported log storage destination | [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/) |
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
Workers Logs supports retained historical data; live tailing is a separate debugging workflow. Choose persistence, sampling, and export destinations deliberately rather than assuming that every signal is stored or included without usage charges.
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
## Load only what the task needs
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
│ ├─ Usage tracking/billing → patterns.md
|
|
18
|
-
│ ├─ Error tracking → patterns.md
|
|
19
|
-
│ ├─ Performance monitoring → patterns.md
|
|
20
|
-
│ ├─ Multi-tenant tracking → patterns.md
|
|
21
|
-
│ ├─ Tail Worker filtering → patterns.md
|
|
22
|
-
│ └─ OpenTelemetry export → patterns.md
|
|
23
|
-
└─ "Why isn't X working?" / "Limits?" → gotchas.md
|
|
24
|
-
```
|
|
22
|
+
- [configuration.md](configuration.md): enable collection, bindings, environments, and exports.
|
|
23
|
+
- [api.md](api.md): logging, telemetry types, SQL, GraphQL, and Logpush APIs.
|
|
24
|
+
- [patterns.md](patterns.md): billing, performance, errors, tenant tracking, and export decisions.
|
|
25
|
+
- [gotchas.md](gotchas.md): missing data, sampling, timing, privacy, and cost checks.
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Load files in this order based on task:
|
|
29
|
-
|
|
30
|
-
| Task Type | Load Order | Reason |
|
|
31
|
-
|-----------|------------|--------|
|
|
32
|
-
| **Initial setup** | configuration.md → gotchas.md | Setup first, avoid pitfalls |
|
|
33
|
-
| **Implement feature** | patterns.md → api.md → gotchas.md | Pattern → API details → edge cases |
|
|
34
|
-
| **Debug issue** | gotchas.md → configuration.md | Common issues first |
|
|
35
|
-
| **Query data** | api.md → patterns.md | API syntax → query examples |
|
|
36
|
-
|
|
37
|
-
## Product Overview
|
|
38
|
-
|
|
39
|
-
### Workers Logs
|
|
40
|
-
- **What:** Console output from Workers (console.log/warn/error)
|
|
41
|
-
- **Access:** Dashboard (Real-time Logs), Logpush, Tail Workers
|
|
42
|
-
- **Cost:** Free (included with all Workers)
|
|
43
|
-
- **Retention:** Real-time only (no historical storage in dashboard)
|
|
44
|
-
|
|
45
|
-
### Workers Traces
|
|
46
|
-
- **What:** Execution traces with timing, CPU usage, outcome
|
|
47
|
-
- **Access:** Dashboard (Workers Analytics → Traces), Logpush
|
|
48
|
-
- **Cost:** $0.10/1M spans (GA pricing starts March 1, 2026), 10M free/month
|
|
49
|
-
- **Retention:** 14 days included
|
|
50
|
-
|
|
51
|
-
### Analytics Engine
|
|
52
|
-
- **What:** High-cardinality event storage and SQL queries
|
|
53
|
-
- **Access:** SQL API, Dashboard (Analytics → Analytics Engine)
|
|
54
|
-
- **Cost:** $0.25/1M writes beyond 10M free/month
|
|
55
|
-
- **Retention:** 90 days (configurable up to 1 year)
|
|
56
|
-
|
|
57
|
-
### Tail Workers
|
|
58
|
-
- **What:** Workers that receive logs/traces from other Workers
|
|
59
|
-
- **Use Cases:** Log filtering, transformation, external export
|
|
60
|
-
- **Cost:** Standard Workers pricing
|
|
61
|
-
|
|
62
|
-
### Logpush
|
|
63
|
-
- **What:** Stream logs to external storage (S3, R2, Datadog, etc.)
|
|
64
|
-
- **Access:** Dashboard, API
|
|
65
|
-
- **Cost:** Requires Business/Enterprise plan
|
|
66
|
-
|
|
67
|
-
## Pricing Summary (2026)
|
|
68
|
-
|
|
69
|
-
| Feature | Free Tier | Cost Beyond Free Tier | Plan Requirement |
|
|
70
|
-
|---------|-----------|----------------------|------------------|
|
|
71
|
-
| Workers Logs | Unlimited | Free | Any |
|
|
72
|
-
| Workers Traces | 10M spans/month | $0.10/1M spans | Paid Workers (GA: March 1, 2026) |
|
|
73
|
-
| Analytics Engine | 10M writes/month | $0.25/1M writes | Paid Workers |
|
|
74
|
-
| Logpush | N/A | Included in plan | Business/Enterprise |
|
|
75
|
-
|
|
76
|
-
## In This Reference
|
|
77
|
-
|
|
78
|
-
- **[configuration.md](configuration.md)** - Setup, deployment, configuration (Logs, Traces, Analytics Engine, Tail Workers, Logpush)
|
|
79
|
-
- **[api.md](api.md)** - API endpoints, methods, interfaces (GraphQL, SQL, bindings, types)
|
|
80
|
-
- **[patterns.md](patterns.md)** - Common patterns, use cases, examples (billing, monitoring, error tracking, exports)
|
|
81
|
-
- **[gotchas.md](gotchas.md)** - Troubleshooting, best practices, limitations (common errors, performance gotchas, pricing)
|
|
82
|
-
|
|
83
|
-
## See Also
|
|
84
|
-
|
|
85
|
-
- [Cloudflare Workers Docs](https://developers.cloudflare.com/workers/)
|
|
86
|
-
- [Analytics Engine Docs](https://developers.cloudflare.com/analytics/analytics-engine/)
|
|
87
|
-
- [Workers Traces Docs](https://developers.cloudflare.com/workers/observability/traces/)
|
|
88
|
-
- [GraphQL Analytics API Reference](../graphql-api/) - Query Workers metrics, HTTP analytics, and 70+ other datasets via GraphQL
|
|
27
|
+
For broader product tasks, see [Analytics Engine](../analytics-engine/README.md), [GraphQL API](../graphql-api/README.md), and [Tail Workers](../tail-workers/README.md).
|
|
@@ -1,164 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
requests
|
|
22
|
-
errors
|
|
23
|
-
subrequests
|
|
24
|
-
}
|
|
25
|
-
quantiles {
|
|
26
|
-
cpuTimeP50
|
|
27
|
-
cpuTimeP99
|
|
28
|
-
wallTimeP50
|
|
29
|
-
wallTimeP99
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Analytics Engine SQL API
|
|
38
|
-
|
|
39
|
-
**Endpoint**: `https://api.cloudflare.com/client/v4/accounts/{account_id}/analytics_engine/sql`
|
|
40
|
-
|
|
41
|
-
**Authentication**: `Authorization: Bearer <API_TOKEN>` (Account Analytics Read permission)
|
|
42
|
-
|
|
43
|
-
**Common Queries**:
|
|
44
|
-
|
|
45
|
-
```sql
|
|
46
|
-
-- List all datasets
|
|
47
|
-
SHOW TABLES;
|
|
48
|
-
|
|
49
|
-
-- Time-series aggregation (5-minute buckets)
|
|
50
|
-
SELECT
|
|
51
|
-
intDiv(toUInt32(timestamp), 300) * 300 AS time_bucket,
|
|
52
|
-
blob1 AS endpoint,
|
|
53
|
-
SUM(_sample_interval) AS total_requests,
|
|
54
|
-
AVG(double1) AS avg_response_time_ms
|
|
55
|
-
FROM api_metrics
|
|
56
|
-
WHERE timestamp >= NOW() - INTERVAL '24' HOUR
|
|
57
|
-
GROUP BY time_bucket, endpoint
|
|
58
|
-
ORDER BY time_bucket DESC;
|
|
59
|
-
|
|
60
|
-
-- Top customers by usage
|
|
61
|
-
SELECT
|
|
62
|
-
index1 AS customer_id,
|
|
63
|
-
SUM(_sample_interval * double1) AS total_api_calls,
|
|
64
|
-
AVG(double2) AS avg_response_time_ms
|
|
65
|
-
FROM api_usage
|
|
66
|
-
WHERE timestamp >= NOW() - INTERVAL '7' DAY
|
|
67
|
-
GROUP BY customer_id
|
|
68
|
-
ORDER BY total_api_calls DESC
|
|
69
|
-
LIMIT 100;
|
|
70
|
-
|
|
71
|
-
-- Error rate analysis
|
|
72
|
-
SELECT
|
|
73
|
-
blob1 AS error_type,
|
|
74
|
-
COUNT(*) AS occurrences,
|
|
75
|
-
MAX(timestamp) AS last_seen
|
|
76
|
-
FROM error_tracking
|
|
77
|
-
WHERE timestamp >= NOW() - INTERVAL '1' HOUR
|
|
78
|
-
GROUP BY error_type
|
|
79
|
-
ORDER BY occurrences DESC;
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Console Logging API
|
|
83
|
-
|
|
84
|
-
**Methods**:
|
|
85
|
-
```typescript
|
|
86
|
-
// Standard methods (all appear in Workers Logs)
|
|
87
|
-
console.log('info message');
|
|
88
|
-
console.info('info message');
|
|
89
|
-
console.warn('warning message');
|
|
90
|
-
console.error('error message');
|
|
91
|
-
console.debug('debug message');
|
|
92
|
-
|
|
93
|
-
// Structured logging (recommended)
|
|
94
|
-
console.log({
|
|
95
|
-
level: 'info',
|
|
96
|
-
user_id: '123',
|
|
97
|
-
action: 'checkout',
|
|
98
|
-
amount: 99.99,
|
|
99
|
-
currency: 'USD'
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Log Levels**: All console methods produce logs; use structured fields for filtering:
|
|
104
|
-
```typescript
|
|
105
|
-
console.log({
|
|
106
|
-
level: 'error',
|
|
107
|
-
message: 'Payment failed',
|
|
108
|
-
error_code: 'CARD_DECLINED'
|
|
109
|
-
});
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Analytics Engine Binding Types
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
interface AnalyticsEngineDataset {
|
|
116
|
-
writeDataPoint(event: AnalyticsEngineDataPoint): void;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
interface AnalyticsEngineDataPoint {
|
|
120
|
-
// Indexed strings (use for filtering/grouping)
|
|
121
|
-
indexes?: string[];
|
|
122
|
-
|
|
123
|
-
// Non-indexed strings (metadata, IDs, URLs)
|
|
124
|
-
blobs?: string[];
|
|
125
|
-
|
|
126
|
-
// Numeric values (counts, durations, amounts)
|
|
127
|
-
doubles?: number[];
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Field Limits**:
|
|
132
|
-
- Max 20 indexes
|
|
133
|
-
- Max 20 blobs
|
|
134
|
-
- Max 20 doubles
|
|
135
|
-
- Max 25 `writeDataPoint` calls per request
|
|
136
|
-
|
|
137
|
-
### Tail Consumer Event Type
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
interface TraceItem {
|
|
141
|
-
event: TraceEvent;
|
|
142
|
-
logs: TraceLog[];
|
|
143
|
-
exceptions: TraceException[];
|
|
144
|
-
scriptName?: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
interface TraceEvent {
|
|
148
|
-
outcome: 'ok' | 'exception' | 'exceededCpu' | 'exceededMemory' | 'unknown';
|
|
149
|
-
cpuTime: number; // microseconds
|
|
150
|
-
wallTime: number; // microseconds
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
interface TraceLog {
|
|
154
|
-
timestamp: number;
|
|
155
|
-
level: 'log' | 'info' | 'debug' | 'warn' | 'error';
|
|
156
|
-
message: any; // string or structured object
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
interface TraceException {
|
|
160
|
-
name: string;
|
|
161
|
-
message: string;
|
|
162
|
-
timestamp: number;
|
|
163
|
-
}
|
|
164
|
-
```
|
|
1
|
+
# Observability APIs
|
|
2
|
+
|
|
3
|
+
Fetch the applicable reference for current signatures, field locations, units, authentication, and query syntax. Do not infer the Tail event schema from an OpenTelemetry span or a Logpush record.
|
|
4
|
+
|
|
5
|
+
| Task | Maintained documentation |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Emit console messages and check supported methods | [Console API](https://developers.cloudflare.com/workers/runtime-apis/console/) |
|
|
8
|
+
| Filter, group, and aggregate stored Workers Logs | [Query Builder](https://developers.cloudflare.com/workers/observability/query-builder/) |
|
|
9
|
+
| Query built-in Workers metrics with GraphQL | [Querying Workers metrics](https://developers.cloudflare.com/analytics/graphql-api/tutorials/querying-workers-metrics/) |
|
|
10
|
+
| Define Analytics Engine fields and call `writeDataPoint()` | [Write data points](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
|
|
11
|
+
| Authenticate and query Analytics Engine datasets | [SQL API](https://developers.cloudflare.com/analytics/analytics-engine/sql-api/) |
|
|
12
|
+
| Calculate counts, sums, and averages on sampled events | [Analytics Engine sampling](https://developers.cloudflare.com/analytics/analytics-engine/sampling/) |
|
|
13
|
+
| Implement a Tail consumer and inspect event properties | [Tail handler API](https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/) |
|
|
14
|
+
| Create and manage Logpush jobs | [Logpush API configuration](https://developers.cloudflare.com/logs/logpush/logpush-job/api-configuration/) |
|
|
15
|
+
| Select exported Workers event fields | [Workers Trace Events dataset](https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/account/workers_trace_events/) |
|
|
16
|
+
| Export OTLP logs and traces | [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
|
|
17
|
+
|
|
18
|
+
Keep dataset field meanings and units consistent between writers and queries. Follow the SQL reference linked from the SQL API for supported date bucketing and aggregate functions; do not assume another SQL dialect's syntax works here. Account for sampling in averages as well as counts and sums.
|
|
19
|
+
|
|
20
|
+
See [configuration.md](configuration.md) for setup and [patterns.md](patterns.md) for application-level decisions.
|
|
@@ -1,169 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# Observability Configuration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fetch the relevant guide before configuring the selected Worker and deployment environment.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
| Task | Maintained documentation |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Enable persisted logs, structured JSON logging, and sampling | [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
|
|
8
|
+
| Enable traces and set their sampling independently of logs | [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) |
|
|
9
|
+
| Configure a named deployment environment | [Wrangler environments](https://developers.cloudflare.com/workers/wrangler/environments/) and the environment example in [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
|
|
10
|
+
| Bind an Analytics Engine dataset and write its first data point | [Analytics Engine get started](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
|
|
11
|
+
| Connect a producer to a Tail Worker | [Configure Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) |
|
|
12
|
+
| Create a Logpush job, configure access, and enable Worker log delivery | [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/) |
|
|
13
|
+
| Configure OTLP destinations, authentication, and local persistence | [Exporting OpenTelemetry data](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## Setup decisions
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
status: "success",
|
|
22
|
-
duration_ms: 45
|
|
23
|
-
});
|
|
17
|
+
- Confirm which account, Worker, and environment will emit telemetry, then deploy that configuration and generate representative traffic.
|
|
18
|
+
- Decide log and trace sampling separately. Increasing sampling during an investigation changes volume and cost; restore the intended operational settings afterwards.
|
|
19
|
+
- For Tail Workers, configure the consumer relationship on the producer Worker; use the guide for deployment order and the handler contract.
|
|
20
|
+
- Choose whether to persist data in Cloudflare as well as exporting it. Verify destination names, supported signal types, and credentials using the export guide.
|
|
21
|
+
- Use stable structured fields and redact secrets and unnecessary personal data before emission. Configure development and production collection intentionally.
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
console.log("user_id: 123 logged in successfully in 45ms");
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Enable Workers Traces
|
|
30
|
-
|
|
31
|
-
```jsonc
|
|
32
|
-
{
|
|
33
|
-
"observability": {
|
|
34
|
-
"traces": {
|
|
35
|
-
"enabled": true,
|
|
36
|
-
"head_sampling_rate": 0.05 // 5% sampling
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Note**: Default sampling is 100%. For high-traffic Workers, use lower sampling (0.01-0.1).
|
|
43
|
-
|
|
44
|
-
### Configure Analytics Engine
|
|
45
|
-
|
|
46
|
-
**Bind to Worker**:
|
|
47
|
-
```toml
|
|
48
|
-
# wrangler.toml
|
|
49
|
-
analytics_engine_datasets = [
|
|
50
|
-
{ binding = "ANALYTICS", dataset = "api_metrics" }
|
|
51
|
-
]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Write Data Points**:
|
|
55
|
-
```typescript
|
|
56
|
-
export interface Env {
|
|
57
|
-
ANALYTICS: AnalyticsEngineDataset;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default {
|
|
61
|
-
async fetch(request: Request, env: Env): Promise<Response> {
|
|
62
|
-
// Track metrics
|
|
63
|
-
env.ANALYTICS.writeDataPoint({
|
|
64
|
-
blobs: ['customer_123', 'POST', '/api/v1/users'],
|
|
65
|
-
doubles: [1, 245.5], // request_count, response_time_ms
|
|
66
|
-
indexes: ['customer_123'] // for efficient filtering
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
return new Response('OK');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Configure Tail Workers
|
|
75
|
-
|
|
76
|
-
Tail Workers receive logs/traces from other Workers for filtering, transformation, or export.
|
|
77
|
-
|
|
78
|
-
**Setup**:
|
|
79
|
-
```toml
|
|
80
|
-
# wrangler.toml
|
|
81
|
-
name = "log-processor"
|
|
82
|
-
main = "src/tail.ts"
|
|
83
|
-
|
|
84
|
-
[[tail_consumers]]
|
|
85
|
-
service = "my-worker" # Worker to tail
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Tail Worker Example**:
|
|
89
|
-
```typescript
|
|
90
|
-
export default {
|
|
91
|
-
async tail(events: TraceItem[], env: Env, ctx: ExecutionContext) {
|
|
92
|
-
// Filter errors only
|
|
93
|
-
const errors = events.filter(event =>
|
|
94
|
-
event.outcome === 'exception' || event.outcome === 'exceededCpu'
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
if (errors.length > 0) {
|
|
98
|
-
// Send to external monitoring
|
|
99
|
-
ctx.waitUntil(
|
|
100
|
-
fetch('https://monitoring.example.com/errors', {
|
|
101
|
-
method: 'POST',
|
|
102
|
-
body: JSON.stringify(errors)
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Configure Logpush
|
|
111
|
-
|
|
112
|
-
Send logs to external storage (S3, R2, GCS, Azure, Datadog, etc.). Requires Business/Enterprise plan.
|
|
113
|
-
|
|
114
|
-
**Via Dashboard**:
|
|
115
|
-
1. Navigate to Analytics → Logs → Logpush
|
|
116
|
-
2. Select destination type
|
|
117
|
-
3. Provide credentials and bucket/endpoint
|
|
118
|
-
4. Choose dataset (e.g., Workers Trace Events)
|
|
119
|
-
5. Configure filters and fields
|
|
120
|
-
|
|
121
|
-
**Via API**:
|
|
122
|
-
```bash
|
|
123
|
-
curl -X POST "https://api.cloudflare.com/client/v4/accounts/{account_id}/logpush/jobs" \
|
|
124
|
-
-H "Authorization: Bearer <API_TOKEN>" \
|
|
125
|
-
-H "Content-Type: application/json" \
|
|
126
|
-
-d '{
|
|
127
|
-
"name": "workers-logs-to-s3",
|
|
128
|
-
"destination_conf": "s3://my-bucket/logs?region=us-east-1",
|
|
129
|
-
"dataset": "workers_trace_events",
|
|
130
|
-
"enabled": true,
|
|
131
|
-
"frequency": "high",
|
|
132
|
-
"filter": "{\"where\":{\"and\":[{\"key\":\"ScriptName\",\"operator\":\"eq\",\"value\":\"my-worker\"}]}}"
|
|
133
|
-
}'
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Environment-Specific Configuration
|
|
137
|
-
|
|
138
|
-
**Development** (verbose logs, full sampling):
|
|
139
|
-
```jsonc
|
|
140
|
-
// wrangler.dev.jsonc
|
|
141
|
-
{
|
|
142
|
-
"observability": {
|
|
143
|
-
"enabled": true,
|
|
144
|
-
"head_sampling_rate": 1.0,
|
|
145
|
-
"traces": {
|
|
146
|
-
"enabled": true
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Production** (reduced sampling, structured logs):
|
|
153
|
-
```jsonc
|
|
154
|
-
// wrangler.prod.jsonc
|
|
155
|
-
{
|
|
156
|
-
"observability": {
|
|
157
|
-
"enabled": true,
|
|
158
|
-
"head_sampling_rate": 0.1, // 10% sampling
|
|
159
|
-
"traces": {
|
|
160
|
-
"enabled": true
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Deploy with env-specific config:
|
|
167
|
-
```bash
|
|
168
|
-
wrangler deploy --config wrangler.prod.jsonc --env production
|
|
169
|
-
```
|
|
23
|
+
See [gotchas.md](gotchas.md) when configured telemetry is missing.
|
|
@@ -1,115 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
# Observability Troubleshooting and Constraints
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Missing or incomplete data
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
| Symptom | Check and authoritative guide |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Logs missing from the dashboard | Confirm the deployed Worker/environment, collection and persistence settings, recent traffic, query time range, and sampling. Follow [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) and [Query Builder](https://developers.cloudflare.com/workers/observability/query-builder/). |
|
|
8
|
+
| Live logs differ from stored logs | Confirm which workflow is being inspected; live streams can sample under load. See [real-time logs](https://developers.cloudflare.com/workers/observability/logs/real-time-logs/). |
|
|
9
|
+
| Traces missing or incomplete | Check trace enablement and sampling separately from logs, then consult [tracing setup](https://developers.cloudflare.com/workers/observability/traces/) and [known limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/). |
|
|
10
|
+
| Export destination has no data | Check signal type, destination name, credentials, endpoint compatibility, and provider status using [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/). For a Logpush job, use [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/). |
|
|
11
|
+
| Tail consumer receives no events | Check the producer's consumer configuration and deployment using [Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/). |
|
|
12
|
+
| Analytics Engine totals or averages look wrong | Account for sample weights and consistent field meanings using [sampling guidance](https://developers.cloudflare.com/analytics/analytics-engine/sampling/). Check [limits](https://developers.cloudflare.com/analytics/analytics-engine/limits/) for missing writes or expired data. |
|
|
13
|
+
| Very short operations appear to take no time | Read [performance and timers](https://developers.cloudflare.com/workers/runtime-apis/performance/) and [trace limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/). Tracing does not eliminate the runtime's timing restrictions. |
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
wrangler deployments list <WORKER_NAME>
|
|
15
|
+
## Limits, retention, and cost
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
curl https://your-worker.workers.dev
|
|
16
|
-
```
|
|
17
|
-
Ensure `observability.enabled = true`, redeploy Worker, check `head_sampling_rate`, verify traffic
|
|
17
|
+
Fetch these pages when estimating cost or diagnosing truncation and missing data:
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
- [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/): log size, retention, sampling, and pricing.
|
|
20
|
+
- [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) and [known limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/): availability, propagation, and instrumentation constraints.
|
|
21
|
+
- [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/): current observability and Tail Worker billing terms.
|
|
22
|
+
- [Analytics Engine limits](https://developers.cloudflare.com/analytics/analytics-engine/limits/) and [pricing](https://developers.cloudflare.com/analytics/analytics-engine/pricing/): field/write limits, retention, query costs, and billing availability.
|
|
23
|
+
- [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/): Workers-specific eligibility, permissions, and pricing.
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
**Solution:**
|
|
23
|
-
```jsonc
|
|
24
|
-
// Temporarily set to 100% sampling for debugging
|
|
25
|
-
{
|
|
26
|
-
"observability": {
|
|
27
|
-
"enabled": true,
|
|
28
|
-
"head_sampling_rate": 1.0,
|
|
29
|
-
"traces": {
|
|
30
|
-
"enabled": true
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
Ensure `observability.traces.enabled = true`, set `head_sampling_rate` to 1.0 for testing, redeploy, check destination status
|
|
36
|
-
|
|
37
|
-
## Limits
|
|
38
|
-
|
|
39
|
-
| Resource/Limit | Value | Notes |
|
|
40
|
-
|----------------|-------|-------|
|
|
41
|
-
| Max log size | 256 KB | Logs exceeding this are truncated |
|
|
42
|
-
| Default sampling rate | 1.0 (100%) | Reduce for high-traffic Workers |
|
|
43
|
-
| Max destinations | Varies by plan | Check dashboard |
|
|
44
|
-
| Trace context propagation | 100 spans max | Deep call chains may lose spans |
|
|
45
|
-
| Analytics Engine write rate | 25 writes/request | Excess writes dropped silently |
|
|
46
|
-
|
|
47
|
-
## Performance Gotchas
|
|
48
|
-
|
|
49
|
-
### Spectre Mitigation Timing
|
|
50
|
-
|
|
51
|
-
**Problem:** `Date.now()` and `performance.now()` have reduced precision (coarsened to 100μs)
|
|
52
|
-
**Cause:** Spectre vulnerability mitigation in V8
|
|
53
|
-
**Solution:** Accept reduced precision or use Workers Traces for accurate timing
|
|
54
|
-
```typescript
|
|
55
|
-
// Date.now() is coarsened - trace spans are accurate
|
|
56
|
-
export default {
|
|
57
|
-
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
|
|
58
|
-
// For user-facing timing, Date.now() is fine
|
|
59
|
-
const start = Date.now();
|
|
60
|
-
const response = await processRequest(request);
|
|
61
|
-
const duration = Date.now() - start;
|
|
62
|
-
|
|
63
|
-
// For detailed performance analysis, use Workers Traces instead
|
|
64
|
-
return response;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Analytics Engine _sample_interval Aggregation
|
|
70
|
-
|
|
71
|
-
**Problem:** Queries return incorrect totals when not multiplying by `_sample_interval`
|
|
72
|
-
**Cause:** Analytics Engine stores sampled data points, each representing multiple events
|
|
73
|
-
**Solution:** Always multiply counts/sums by `_sample_interval` in aggregations
|
|
74
|
-
```sql
|
|
75
|
-
-- WRONG: Undercounts actual events
|
|
76
|
-
SELECT blob1 AS customer_id, COUNT(*) AS total_calls
|
|
77
|
-
FROM api_usage GROUP BY customer_id;
|
|
78
|
-
|
|
79
|
-
-- CORRECT: Accounts for sampling
|
|
80
|
-
SELECT blob1 AS customer_id, SUM(_sample_interval) AS total_calls
|
|
81
|
-
FROM api_usage GROUP BY customer_id;
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Trace Context Propagation Limits
|
|
85
|
-
|
|
86
|
-
**Problem:** Deep call chains lose trace context after 100 spans
|
|
87
|
-
**Cause:** Cloudflare limits trace depth to prevent performance impact
|
|
88
|
-
**Solution:** Design for flatter architectures or use custom correlation IDs for deep chains
|
|
89
|
-
```typescript
|
|
90
|
-
// For deep call chains, add custom correlation ID
|
|
91
|
-
const correlationId = crypto.randomUUID();
|
|
92
|
-
console.log({ correlationId, event: 'request_start' });
|
|
93
|
-
|
|
94
|
-
// Pass correlationId through headers to downstream services
|
|
95
|
-
await fetch('https://api.example.com', {
|
|
96
|
-
headers: { 'X-Correlation-ID': correlationId }
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Pricing (2026)
|
|
101
|
-
|
|
102
|
-
### Workers Traces
|
|
103
|
-
- **GA Pricing (starts March 1, 2026):**
|
|
104
|
-
- $0.10 per 1M trace spans captured
|
|
105
|
-
- Retention: 14 days included
|
|
106
|
-
- **Free tier:** 10M trace spans/month
|
|
107
|
-
- **Note:** Beta usage (before March 1, 2026) is free
|
|
108
|
-
|
|
109
|
-
### Workers Logs
|
|
110
|
-
- **Included:** Free for all Workers
|
|
111
|
-
- **Logpush:** Requires Business/Enterprise plan
|
|
112
|
-
|
|
113
|
-
### Analytics Engine
|
|
114
|
-
- **Included:** 10M writes/month on Paid Workers plan
|
|
115
|
-
- **Additional:** $0.25 per 1M writes beyond included quota
|
|
25
|
+
Sampling reduces coverage as well as volume. Do not interpret the absence of a sampled event as proof that an error did not happen. Keep required diagnostic context while avoiding credentials, full sensitive URLs, and unnecessary personal data in logs, custom dimensions, and exported records.
|