Skip to content

fix(instrumentation): report ISR revalidation errors to onRequestError#91449

Open
swarnava wants to merge 1 commit intovercel:canaryfrom
swarnava:fix/isr-revalidation-error-reporting
Open

fix(instrumentation): report ISR revalidation errors to onRequestError#91449
swarnava wants to merge 1 commit intovercel:canaryfrom
swarnava:fix/isr-revalidation-error-reporting

Conversation

@swarnava
Copy link
Member

Previously, ISR revalidation errors for routes with PPR/cacheComponents enabled were not reported to the onRequestError instrumentation hook or OpenTelemetry error spans. This was because the error reporting condition in prerenderToStream() incorrectly checked isRoutePPREnabled instead of isBuildTimePrerendering.

The fix changes the condition to check isBuildTimePrerendering, which correctly distinguishes between:

  • Build-time prerendering: errors are suppressed (existing behavior)
  • ISR revalidation at runtime: errors are now reported

This enables observability tools like Datadog APM to capture revalidation failures, allowing teams to set up alerts for upstream data-fetching issues.

Adds test for ISR error reporting with cacheComponents/PPR enabled.

Previously, ISR revalidation errors for routes with PPR/cacheComponents
enabled were not reported to the onRequestError instrumentation hook or
OpenTelemetry error spans. This was because the error reporting condition
in prerenderToStream() incorrectly checked `isRoutePPREnabled` instead of
`isBuildTimePrerendering`.

The fix changes the condition to check `isBuildTimePrerendering`, which
correctly distinguishes between:
- Build-time prerendering: errors are suppressed (existing behavior)
- ISR revalidation at runtime: errors are now reported

This enables observability tools like Datadog APM to capture revalidation
failures, allowing teams to set up alerts for upstream data-fetching issues.

Adds test for ISR error reporting with cacheComponents/PPR enabled.
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Mar 16, 2026

Tests Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants