---
title: "Cloudflare D1 Instrumentation"
description: "Learn how to add span instrumentation for Cloudflare D1."
url: https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/d1/
---

# Cloudflare D1 Instrumentation | Sentry for Cloudflare

You can use the `instrumentD1WithSentry` method to instrument [Cloudflare D1](https://developers.cloudflare.com/d1/), Cloudflare's serverless SQL database with Sentry.

```javascript
import * as Sentry from "@sentry/cloudflare";

// env.DB is the D1 DB binding configured in your `wrangler.jsonc`/`wrangler.toml` config
const db = Sentry.instrumentD1WithSentry(env.DB);
// Now you can use the database as usual
await db.prepare("SELECT * FROM table WHERE id = ?").bind(1).run();
```
