Skip to Content

Cloudflare Workers

Send traces and logs from Cloudflare Workers to Everr with Cloudflare's built-in OpenTelemetry export. No SDK, no code changes.

Sendstraceslogs

This guide shows you how to send traces and logs from your Cloudflare Workers to Everr. Cloudflare traces your Workers for you and exports the data over OpenTelemetry (OTLP), so there is no SDK to install: you add Everr as a destination in Cloudflare, then turn on the export in your Wrangler config.

Once it's set up, you get:

  • A span for every invocation of your fetch, scheduled, and queue handlers
  • A span for every outgoing fetch and every binding call, such as KV, R2, D1, Queues, and Durable Objects
  • Your console.log() output and other Workers logs, tagged with the trace ID of the request that wrote them
  • Any custom spans you create with Cloudflare's tracing API

Prerequisites

  • A Worker you deploy with Wrangler
  • Access to the Cloudflare dashboard for the account that owns the Worker
  • An Everr API key with the Send telemetry capability (see Mint an API key)

Step 1. Add Everr as a destination

Each Cloudflare destination carries one signal, so you create two: one for traces and one for logs.

In the Cloudflare dashboard, go to Observability > Destinations and select Add destination. Create the traces destination, with the header under Custom Headers:

FieldValue
Destination TypeTraces
OTLP Traces Endpointhttps://ingest.everr.dev/v1/traces
Destination Nameeverr-traces
Header nameAuthorization
Header valueBearer <your-api-key>

Select Save. Cloudflare sends a test export with your headers before it saves the destination, so a wrong endpoint or key shows up right away.

Then create the logs destination the same way:

FieldValue
Destination TypeLogs
OTLP Logs Endpointhttps://ingest.everr.dev/v1/logs
Destination Nameeverr-logs
Header nameAuthorization
Header valueBearer <your-api-key>

Destinations belong to your Cloudflare account, so every Worker in the account can use them.

Step 2. Turn on the export

In your Worker's Wrangler config, enable traces and logs and point each one at its destination by name:

wrangler.jsonc
{
  "observability": {
    "traces": {
      "enabled": true,
      "destinations": ["everr-traces"],
      "head_sampling_rate": 1,
    },
    "logs": {
      "enabled": true,
      "destinations": ["everr-logs"],
      "head_sampling_rate": 1,
    },
  },
}

If your project uses wrangler.toml:

wrangler.toml
[observability.traces]
enabled = true
destinations = ["everr-traces"]
head_sampling_rate = 1

[observability.logs]
enabled = true
destinations = ["everr-logs"]
head_sampling_rate = 1

The names in destinations must match the destination names in the dashboard exactly.

Step 3. Deploy

The new config takes effect on the next deploy:

npx wrangler deploy

Validate

Send a few requests to your Worker, then wait: Cloudflare can take several minutes to deliver exported data.

  1. In the Cloudflare dashboard, open Observability > Destinations. Both destinations should show Last: n minutes ago. Never run means nothing was exported yet: check the Worker got traffic since the deploy and that the destination names in Wrangler match. Error means delivery failed, usually because the API key was revoked.
  2. In Everr, open Traces and filter by the service. Cloudflare sets service.name to the name of your Worker, and cloud.provider to cloudflare.
  3. Open Logs and check that your console.log() output is there. To see the logs of one request, filter Logs by the trace ID of its trace.

Add custom spans

Cloudflare traces handlers, fetch, and bindings for you. To time your own code, such as a slow computation or a call that goes through a library, wrap it in a span with the tracing API from cloudflare:workers:

import { tracing } from "cloudflare:workers";

const result = await tracing.enterSpan("operation name", async (span) => {
  span.setAttribute("app.attribute", "value");
  return yourCode();
});

enterSpan ends the span when the callback returns. Spans you create this way are exported to Everr with the rest of the trace. See Cloudflare's custom spans guide for the full API.

Control volume and cost

  • Sampling. head_sampling_rate is the share of invocations Cloudflare records, from 0 to 1. Lower it on busy Workers to send fewer traces and logs. Traces and logs have separate rates.
  • Storage in Cloudflare. By default Cloudflare also keeps a copy of exported data in its own dashboard, which counts toward your Cloudflare Observability usage. Set "persist": false in the traces and logs blocks to send data only to Everr.

Limitations

These come from Cloudflare's export, which Cloudflare describes as a beta:

  • No metrics. Cloudflare exports traces and logs only. Workers metrics, such as request counts and CPU time, can't be exported over OpenTelemetry. Every root span carries cloudflare.cpu_time_ms and cloudflare.wall_time_ms, so you can chart them from traces instead.
  • Traces stop at Cloudflare. Cloudflare doesn't propagate trace context to services outside Cloudflare yet, so a request from your Worker to your own backend starts a separate trace.
  • Short spans can show 0 ms. The Workers runtime only advances its clock on I/O, so code that does no I/O can report a duration of zero.
  • Names can change. Cloudflare hasn't finalized its span and attribute names. Dashboards and alerts built on cloudflare.* attributes may need updating as Cloudflare changes them.