Skip to main content
The Sentry Deno SDK is in Beta. Please help us improve the SDK by reporting issues or giving feedback.
The Sentry Deno SDK provides error monitoring and performance tracking for applications running on the Deno runtime.

Installation

Import the SDK from npm using Deno’s npm specifier:
Or add to your import map:

Basic Setup

Initialize Sentry at the top of your main module:

Deno.serve Integration

Monitor your Deno HTTP server:

Error Tracking

Automatic Error Capture

Manual Error Capture

Performance Monitoring

Custom Spans

Nested Spans

Context & User Information

Set User Context

Add Custom Context

Deno KV Integration

Track Deno KV operations:

HTTP Client Tracking

File System Operations

WebSocket Support

Cron Monitoring

Permissions

The Sentry SDK requires certain Deno permissions:
Recommended permissions:

Configuration

Deno Deploy

Deploy to Deno Deploy with Sentry:
Set environment variable in Deno Deploy:

Best Practices

Initialize Early

Call Sentry.init() at the top of your main module.

Use Spans

Wrap important operations with spans to track performance.

Set Permissions

Grant only the necessary permissions to Sentry.

Environment Config

Use environment variables for configuration.

Common Patterns

Next Steps

Deno Documentation

Official Deno documentation

Deno Deploy

Deploy to Deno Deploy

Performance

Performance monitoring guide

Source Maps

Source maps configuration