Skip to content

chore: explicitly skip the Vercel OTEL when running open-next#8833

Merged
ovflowd merged 1 commit intonodejs:mainfrom
dario-piotrowicz:dario/DEVX-1786/vercel-otel
Apr 22, 2026
Merged

chore: explicitly skip the Vercel OTEL when running open-next#8833
ovflowd merged 1 commit intonodejs:mainfrom
dario-piotrowicz:dario/DEVX-1786/vercel-otel

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Description

The Vercel OTEL implementation doesn't work on the open-next build (I haven't investigated why), but it doesn't seem to cause issues either. However it produces some error in the terminal on previews.

In any case for the open-next build Vercel OTEL couldn't be used anyways (since the app wouldn't be hosted on Vercel).

In order to remove the terminal error and also to make the code more clear/explicit this PR is making the Vercel OTEL setup conditional based on whether the application is being run by Cloudflare or not.

Validation

I've validated that the open-next preview now does not present the telemetry error anymore.

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings April 22, 2026 14:19
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner April 22, 2026 14:19
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Apr 22, 2026 2:21pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 22, 2026

PR Summary

Low Risk
Small conditional/async initialization change limited to telemetry setup; low blast radius, but could affect instrumentation if environment detection is wrong.

Overview
Avoids initializing Vercel OpenTelemetry when the app runs on Cloudflare by making register() async, checking for globalThis.Cloudflare, and dynamically importing @vercel/otel only in non-Cloudflare environments. This removes Cloudflare/open-next preview errors and prevents bundling/executing Vercel OTEL in unsupported runtimes.

Reviewed by Cursor Bugbot for commit a284b70. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.85%. Comparing base (333d70f) to head (a284b70).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8833      +/-   ##
==========================================
- Coverage   73.88%   73.85%   -0.04%     
==========================================
  Files         105      105              
  Lines        8889     8889              
  Branches      326      327       +1     
==========================================
- Hits         6568     6565       -3     
- Misses       2320     2323       +3     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes Vercel OpenTelemetry initialization conditional so it’s skipped when running under the Cloudflare open-next runtime, eliminating preview-time terminal telemetry errors and making the deployment intent explicit.

Changes:

  • Switch instrumentation.ts to lazily import @vercel/otel only when not running on Cloudflare.
  • Add a Cloudflare runtime check to bypass Vercel-specific OTEL setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/site/instrumentation.ts
Copy link
Copy Markdown
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM! Fast-tracking as a hot-fix for OpenNext.

@ovflowd ovflowd added the fast-track Fast Tracking PRs label Apr 22, 2026
@ovflowd ovflowd added this pull request to the merge queue Apr 22, 2026
Merged via the queue into nodejs:main with commit 6fc0154 Apr 22, 2026
22 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/DEVX-1786/vercel-otel branch April 22, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track Fast Tracking PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants