Skip to content

Export to Sentry

Last updated View as MarkdownAgent setup

Sentry provides distributed tracing, logs, and application monitoring. Export Cloudflare telemetry to query data and create alerts or dashboards.

Sentry trace view with timing information displayed on a timeline

This guide configures Sentry to receive Cloudflare traces and logs.

Prerequisites

Before you begin, you need an active Sentry account ↗︎. You also need Cloudflare logs or traces to export.

1. Create a Sentry project

Skip this step if you already have a project.

  1. Log in to your Sentry account ↗︎.
  2. Go to Insights > Projects.
  3. Select New Project ↗︎.
  4. Complete the project form, then select Create Project.

2. Get your Sentry OTLP endpoints

Sentry provides separate OpenTelemetry Protocol (OTLP) endpoints for traces and logs:

  • Traces: https://<HOST>/api/<PROJECT_ID>/integration/otlp/v1/traces
  • Logs: https://<HOST>/api/<PROJECT_ID>/integration/otlp/v1/logs
  1. In Sentry, go to Settings > Projects ↗︎.
  2. Select your project.
  3. Under SDK Setup, select Client Keys (DSN).
  4. Copy the OTLP endpoints and authentication header.

For endpoint details, refer to Sentry OTLP documentation ↗︎.

3. Configure Cloudflare Observability destinations

In the Cloudflare dashboard, go to Observability > Destinations.

Go to OpenTelemetry ↗

Configure a traces destination

  1. Select Add destination.
  2. Configure the destination:
    • Destination name: sentry-traces
    • Destination type: Traces
    • OTLP endpoint: Your Sentry OTLP traces endpoint
    • Custom header name: x-sentry-auth
    • Custom header value: sentry sentry_key=<SENTRY_PUBLIC_KEY>
  3. Select Save.

Configure a logs destination

  1. Select Add destination.
  2. Configure the destination:
    • Destination name: sentry-logs
    • Destination type: Logs
    • OTLP endpoint: Your Sentry OTLP logs endpoint
    • Custom header name: x-sentry-auth
    • Custom header value: sentry sentry_key=<SENTRY_PUBLIC_KEY>
  3. Select Save.

4. Enable export

Creating a destination does not start exporting telemetry. To export Workers Logs or Workers Traces, configure OpenTelemetry export for your Worker. To export Cloudflare Traces, configure export for your domain.

Data may take several minutes to appear in Sentry.

Was this helpful?