Cloudflare Bindings

Learn which Cloudflare bindings Sentry instruments automatically and what each binding captures.

The Sentry Cloudflare SDK instruments the bindings on your env object automatically. You don't have to wrap a binding or call a function. When your code reads a binding from env, the SDK detects its type and returns an instrumented version.

BindingWhat Sentry captures
D1Database queries
R2Bucket operations, such as reads and uploads
QueuesMessages that you send to a queue
Workers AIModel calls, see Workers AI
Durable ObjectsTraces that continue in the Durable Object, see Cloudflare Durable Objects
Service bindingsTraces that continue in the other Worker, if it also uses Sentry

For RPC calls to Durable Objects and service bindings, add the binding to rpcTracePropagationBindings. The Vite plugin adds the bindings to classes in the same Worker for you.

The SDK instruments the env object that Cloudflare gives to the handlers and classes that Sentry wraps, such as your Worker, Durable Objects, and Workflows. The Vite plugin wraps these for you at build time.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").