Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Nitro Server Features
description: "Learn which Nitro server features are automatically instrumented by the Sentry Nuxt SDK."
---

The Sentry Nuxt SDK automatically instruments various Nitro server APIs to provide performance monitoring and error tracking for your server-side code.

## Server Middleware

<Alert>Available from version `@sentry/nuxt` 10.17.0 and up.</Alert>

The Sentry Nuxt SDK automatically instruments [server middleware handlers](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-middleware) in addition to server event handlers. This includes the handler functions and their `onBeforeResponse` and `onRequest` callbacks.

## Cache

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>

The Sentry Nuxt SDK automatically instruments [cache APIs](https://nitro.build/guide/cache) for the following Nitro functions:

- `defineCachedEventHandler`
- `cachedEventHandler`
- `cachedFunction`

This provides spans in your transactions that represent cache operations and their durations, including cache hits.

## Storage

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>

The Sentry Nuxt SDK automatically instruments [storage APIs](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-storage) (also known as KV storage) and common operations.

Keep in mind that only the storage mounts configured under `nitro.storage` in your `nuxt.config.ts` will be instrumented. Storage spans will show up in a similar way to [cache](#cache) spans since they both utilize the same underlying Nitro storage API.

## Database

<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>

The Sentry Nuxt SDK automatically instruments Nitro's [database API](https://nitro.build/guide/database). This provides spans in your transactions that represent database query operations and their durations, enabling you to identify slow queries, track query frequency, and optimize your database interactions.

Database instrumentation only applies to database mounts configured under `nitro.database` in your `nuxt.config.ts` and only when `nitro.experimental.database` is set to `true`.
Loading