Prerequisites
- A Cloudflare Worker that you deploy with Wrangler.
- An ingest key. See Create an ingest key.
Set up the destinations
- In the Cloudflare dashboard, open Workers Observability and add a destination.
- Set Destination Name to
squasher-tracesand Destination Type to Traces. - Set OTLP Endpoint to
https://ingest.squasher.ai/v1/traces. - In Custom Headers, add
x-squasher-keywith your ingest key, then save. - Add a second destination named
squasher-logs, of type Logs, with the endpointhttps://ingest.squasher.ai/v1/logsand the same header.
wrangler.jsonc
What Squasher keeps
Cloudflare does not export Worker metrics. To get Worker and zone metrics, turn on the
Cloudflare analytics pull.
Send Logpush jobs
Cloudflare Logpush can send a zone or account dataset to the Squasher drain endpoint. Logpush sends gzip-compressed NDJSON, and Squasher decompresses it. Keep each batch at or below 16 MiB after decompression withmax_upload_bytes:
http_requests, firewall_events, and workers_trace_events get a readable message
and the correct event time. HTTP responses with status 500 or higher are errors; 4xx responses are
warnings. Worker invocations with the exception outcome or an uncaught exception are errors;
canceled and unknown outcomes are warnings. Error records create issues.
Send AI Gateway spans
For model calls through Cloudflare AI Gateway, add an AI Gateway OpenTelemetry exporter with the traces endpoint and header above. Squasher reads these attributes into AI observability:
Prompt and completion attributes contain your users’ content. Turn on this exporter only when you
want Squasher to store that content.
Verify
- Throw an error in a Worker request handler, then send one request to it.
- In Squasher, select Issues in the sidebar. The error is at the top of the list.
- Select Traces in the sidebar to see the request span.
Limits
- Logpush batches larger than 16 MiB after decompression return
413. Setmax_upload_bytes. - Squasher does not map Cloudflare Agents SDK events to AI observations. Custom attributes that you add stay on the span.
- To capture errors with stack traces from Worker code, use the Edge SDK.
Next steps
Edge SDK
Capture errors from Workers and other edge runtimes.
OpenTelemetry
See how Squasher reads traces and logs.