---
title: "Cloudflare Durable Objects"
description: "Learn how to add Sentry instrumentation for Cloudflare Durable Objects."
url: https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/durableobject/
---

# Cloudflare Durable Objects

Available since: `v9.16.0`

The [Sentry Cloudflare Vite plugin](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/vite-plugin.md) instruments your [Cloudflare Durable Objects](https://developers.cloudflare.com/durable-objects/) automatically. It reads the Durable Object classes from your wrangler config and wraps each one at build time with the options from your `instrument.server.*` file. You don't have to change your code.

If you deploy with `wrangler` directly, wrap each class yourself with `instrumentDurableObjectWithSentry`, as shown in the [Wrangler setup](https://docs.sentry.io/platforms/javascript/guides/cloudflare/install/wrangler.md#instrument-durable-objects-workflows-and-agents).

## [Classes That Extend Durable Objects](https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/durableobject.md#classes-that-extend-durable-objects)

The instrumentation works with any class that extends `DurableObject`, not only those that extend it directly. This includes classes built on top of Durable Objects by other libraries.

Classes built on the [Cloudflare Agents SDK](https://developers.cloudflare.com/agents/) (`Agent`, `AIChatAgent`, `McpAgent`) get the dedicated agent instrumentation instead (SDK version 10.69.0 or higher). It applies the same Durable Object instrumentation and adds spans for `@callable()` RPC methods as well as automatic conversation IDs. See [Cloudflare Agents SDK](https://docs.sentry.io/platforms/javascript/guides/cloudflare/agent-tracing/agents-sdk.md).

## [Durable Object Storage Spans](https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/durableobject.md#durable-object-storage-spans)

The SDK automatically instruments Durable Object storage operations (`get`, `put`, `delete`, `list`). Each storage operation creates a span.

The SDK also filters out framework-internal storage operations (version 10.69.0 or higher): keys prefixed with `cf_`, `cf:`, `__ps_`, or `/` (used internally by the Agents SDK and PartyServer) don't create spans, so your traces show only your own storage access.

## [RPC Trace Propagation](https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/durableobject.md#rpc-trace-propagation)

To enable distributed tracing across RPC calls to your Durable Objects, see [Distributed Tracing](https://docs.sentry.io/platforms/javascript/guides/cloudflare/tracing/distributed-tracing.md#rpc-trace-propagation).
