---
title: "Cloudflare"
description: "Learn how to set up Cloudflare Workers Observability to forward logs and traces data to Sentry."
url: https://docs.sentry.io/product/drains/cloudflare/
last_updated: 2026-11-25T10:34:54.000Z
---

# Cloudflare Workers Observability | Sentry Docs

Cloudflare Workers supports [exporting OpenTelemetry (OTEL)-compliant data](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) to send logs and traces to Sentry.

* Logs: Application logs including `console.log()` output and system-generated logs
* Traces: Traces showing request flows through your Worker and connected services

## [Prerequisites](https://docs.sentry.io/product/drains/cloudflare.md#prerequisites)

Before you begin, ensure you have:

* A deployed Worker that you want to monitor
* A Sentry project you want to send data to

## [Step 1: Set up destination in the Cloudflare dashboard](https://docs.sentry.io/product/drains/cloudflare.md#step-1-set-up-destination-in-the-cloudflare-dashboard)

To set up a destination in the Cloudflare dashboard, navigate to your Cloudflare account's [Workers Observability](https://dash.cloudflare.com/?to=/:account/workers-and-pages/observability/destinations) section. Then click **Add Destination** and configure either a traces or logs destination.

### [Logs Destination](https://docs.sentry.io/product/drains/cloudflare.md#logs-destination)

To configure your logs destination, click **Add destination** and configure the following:

1. Destination Name: `sentry-logs` (or any descriptive name)
2. Destination Type: Select Logs
3. OTLP Endpoint: Your Sentry OTLP logs endpoint (e.g., `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/logs`)

```bash
https://o<orgId>.ingest.sentry.io/api/<projectId>/integration/otlp/v1/logs
```

4. Custom Headers: Add the Sentry authentication header:

   * Header name: `x-sentry-auth`
   * Header value: `sentry sentry_key={SENTRY_PUBLIC_KEY}` where `{SENTRY_PUBLIC_KEY}` is your Sentry project's public key

```bash
sentry sentry_key=<your-public-key>
```

You can find your Sentry OTLP logs endpoint and authentication header value in your Sentry Project Settings under [**Client Keys (DSN)**](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) > **OpenTelemetry (OTLP)** under the **OTLP Logs Endpoint** section.

### [Traces Destination](https://docs.sentry.io/product/drains/cloudflare.md#traces-destination)

To configure your traces destination, click **Add destination** and configure the following:

1. Destination Name: `sentry-traces` (or any descriptive name)
2. Destination Type: Select Traces
3. OTLP Endpoint: Your Sentry OTLP traces endpoint (e.g., `https://{HOST}/api/{PROJECT_ID}/integration/otlp/v1/traces`)

```bash
https://o<orgId>.ingest.sentry.io/api/<projectId>/integration/otlp/v1/traces
```

4. Custom Headers: Add the Sentry authentication header:

   * Header name: `x-sentry-auth`
   * Header value: `sentry sentry_key={SENTRY_PUBLIC_KEY}` where `{SENTRY_PUBLIC_KEY}` is your Sentry project's public key

```bash
sentry sentry_key=<your-public-key>
```

You can find your Sentry OTLP traces endpoint and authentication header value in your Sentry Project Settings under [**Client Keys (DSN)**](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) > **OpenTelemetry (OTLP)** under the **OTLP Traces Endpoint** section.

## [Step 2: Configure your Worker](https://docs.sentry.io/product/drains/cloudflare.md#step-2-configure-your-worker)

With your destinations created in the Cloudflare dashboard, update your Worker's configuration to enable telemetry export.

```toml
[observability.traces]
enabled = true
# Must match the destination name in the dashboard
destinations = [ "sentry-traces" ]

[observability.logs]
enabled = true
# Must match the destination name in the dashboard
destinations = [ "sentry-logs" ]
```

*Other available variations of the above snippet: jsonc*

After updating your configuration, deploy your Worker for the changes to take effect.

## [Connect Errors From the Sentry SDK](https://docs.sentry.io/product/drains/cloudflare.md#connect-errors-from-the-sentry-sdk)

If your Worker uses the Sentry Cloudflare SDK for error monitoring only, without Sentry tracing, its errors and logs get the trace ID of these Workers traces. They then show up in the same trace in Sentry. See [Cloudflare Workers Observability](https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/workers-observability.md).

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
