Skip to main content
Cloudflare Workers can export their traces and logs to Squasher over OpenTelemetry. You add two destinations in Cloudflare and turn them on for each Worker.

Prerequisites

Set up the destinations

  1. In the Cloudflare dashboard, open Workers Observability and add a destination.
  2. Set Destination Name to squasher-traces and Destination Type to Traces.
  3. Set OTLP Endpoint to https://ingest.squasher.ai/v1/traces.
  4. In Custom Headers, add x-squasher-key with your ingest key, then save.
  5. Add a second destination named squasher-logs, of type Logs, with the endpoint https://ingest.squasher.ai/v1/logs and the same header.
Then turn on both destinations in the Worker’s Wrangler configuration, and deploy the Worker:
wrangler.jsonc
To let Squasher create the destinations and update the Worker settings for you, use a provider connection from Integrations or through the API. If the Cloudflare card shows Manual setup, one-click setup is unavailable in that deployment because its OAuth client, discovered scope list, scope-validation token, or encrypted credential storage is not configured. Use the steps above instead.

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 with max_upload_bytes:
Squasher stores each record as a log with the fields from the source record as attributes. Logpush records from 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

  1. Throw an error in a Worker request handler, then send one request to it.
  2. In Squasher, select Issues in the sidebar. The error is at the top of the list.
  3. Select Traces in the sidebar to see the request span.

Limits

  • Logpush batches larger than 16 MiB after decompression return 413. Set max_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.