Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(nuxt): Instrument storage API #17858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
logaretm wants to merge 12 commits into develop
base: develop
Choose a base branch
Loading
from awad/js-1016-nuxtnitro-instrument-kv-storage-instrumenting-unstorage

Conversation

Copy link
Collaborator

@logaretm logaretm commented Oct 3, 2025

What

This PR adds automatic instrumentation for Nuxt's storage layer (powered by unstorage), enabling performance monitoring for cache and key-value storage operations in Nuxt/Nitro applications.

Storage operations will now automatically create performance spans with detailed attributes for observability in Sentry.

What's New

  • Automatic Storage Instrumentation: Instruments all storage drivers configured in nuxt.config.ts via nitro.storage
  • Comprehensive Coverage: Tracks all storage operations including:
    • getItem, setItem, hasItem, removeItem
    • Raw variants: getItemRaw, setItemRaw
    • Batch operations: getItems, setItems
    • Utility methods: getKeys, clear
    • Aliases: get, set, has, del, remove

Implementation Details

Span Attributes:

  • sentry.op: cache.{operation} (e.g., cache.get_item, cache.set_item)
  • sentry.origin: auto.cache.nuxt
  • cache.key: Full key including mount prefix
  • cache.hit: true for successful get/has operations
  • nuxt.storage.op: Original method name
  • nuxt.storage.mount: Storage mount point
  • nuxt.storage.driver: Driver name (e.g., memory, fs, redis)

Files Changed:

  • packages/nuxt/src/runtime/plugins/storage.server.ts - Runtime instrumentation plugin
  • packages/nuxt/src/vite/storageConfig.ts - Build-time configuration
  • packages/nuxt/src/module.ts - Module integration
  • E2E tests for Nuxt 3 & 4

Copy link

linear bot commented Oct 3, 2025

@logaretm logaretm force-pushed the awad/js-1016-nuxtnitro-instrument-kv-storage-instrumenting-unstorage branch from 07cb542 to 24a5470 Compare October 3, 2025 15:40
@logaretm logaretm self-assigned this Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Nuxt/Nitro] Instrument KV Storage (instrumenting unstorage)
1 participant

AltStyle によって変換されたページ (->オリジナル) /