feat(nuxt): Instrument server cache API#17886
Merged
Conversation
Contributor
size-limit report 📦
|
64e5814 to
42ef2c7
Compare
09e73ad to
4f26f70
Compare
s1gr1d
reviewed
Oct 9, 2025
| * Checks if the cache entry is a response cache entry. | ||
| */ | ||
| function isResponseCacheEntry(key: string, _: CacheEntry): _ is CacheEntry<ResponseCacheEntry & { status: number }> { | ||
| return key.startsWith('nitro:handlers:'); |
Member
There was a problem hiding this comment.
Should this be checked with CACHED_FN_HANDLERS_RE here as well?
Member
Author
There was a problem hiding this comment.
Not here no, we want to be able to distinguish between cachedFunction and cachedEventHandler cached entries here, the regex detects if it is either.
The reason for the distinction is we want to apply more checks if it is a cached response entry since Nitro employs more checks in that case that would determine the cache validity.
ab3ecc1 to
d943f7d
Compare
1c23b89 to
f2ad9e7
Compare
759c029 to
65dae94
Compare
d943f7d to
83bb4e8
Compare
65dae94 to
c844c9e
Compare
83bb4e8 to
f5cd0ca
Compare
17482e2 to
65277c7
Compare
83e35f8 to
d621605
Compare
65277c7 to
604de80
Compare
s1gr1d
approved these changes
Oct 16, 2025
s1gr1d
reviewed
Oct 16, 2025
Base automatically changed from
awad/js-1016-nuxtnitro-instrument-kv-storage-instrumenting-unstorage
to
develop
October 16, 2025 21:16
604de80 to
f1dd874
Compare
logaretm
added a commit
that referenced
this pull request
Oct 17, 2025
This pull request introduces automatic instrumentation for database queries in Nuxt applications in server side handlers using Sentry. #### Implementation Details - Instruments database `.sql`, `.prepare` and `.exec` calls. - Adds breadcrumbs and spans following cloudflare's D1 implementation. This relies on the work done in #17858 and #17886
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Nitro/Nuxt Cache API instrumentation by building upon the storage instrumentation in #17858 since both use
unstorageunder the hood.How it works
Nitro injects the cache storage on either
cache:or the root mount depending on user configuration, also in production thecachestorage is placed on the root mount unless the user configures it explicitly to redis or something else. We instrument both mount drivers to cover other cache use cases.I made sure to add e2e tests as well for
cachedEventListnerandcachedFunctioncalls which are the main ways to use the Cache API.This PR depends on the storage PR #17858.