Skip to content

feat(nitro): Nitro SDK#19224

Open
logaretm wants to merge 14 commits intodevelopfrom
awad/create-nitro-sdk-metadata
Open

feat(nitro): Nitro SDK#19224
logaretm wants to merge 14 commits intodevelopfrom
awad/create-nitro-sdk-metadata

Conversation

@logaretm
Copy link
Copy Markdown
Member

@logaretm logaretm commented Feb 6, 2026

This PR just isolates the mundane changes needed for a new SDK to keep the next stacked PRs clean, it adds the Nitro SDK to the monorepo.

This PR is a base of a stack, the stacked PRs will be merged into it. I thought this will be easier to review.


This PR is part of a stack:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 10,850 - 9,029 +20%
GET With Sentry 1,689 16% 1,578 +7%
GET With Sentry (error only) 7,026 65% 5,938 +18%
POST Baseline 1,044 - 1,193 -12%
POST With Sentry 490 47% 566 -13%
POST With Sentry (error only) 915 88% 1,035 -12%
MYSQL Baseline 3,653 - 3,285 +11%
MYSQL With Sentry 360 10% 405 -11%
MYSQL With Sentry (error only) 2,881 79% 2,652 +9%

View base workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.88 kB - -
@sentry/browser - with treeshaking flags 24.35 kB - -
@sentry/browser (incl. Tracing) 43.77 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 45.47 kB - -
@sentry/browser (incl. Tracing, Profiling) 48.7 kB - -
@sentry/browser (incl. Tracing, Replay) 82.89 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.4 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 87.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 99.83 kB - -
@sentry/browser (incl. Feedback) 42.7 kB - -
@sentry/browser (incl. sendFeedback) 30.55 kB - -
@sentry/browser (incl. FeedbackAsync) 35.55 kB - -
@sentry/browser (incl. Metrics) 27.16 kB - -
@sentry/browser (incl. Logs) 27.29 kB - -
@sentry/browser (incl. Metrics & Logs) 27.98 kB - -
@sentry/react 27.62 kB - -
@sentry/react (incl. Tracing) 46.01 kB - -
@sentry/vue 30.7 kB - -
@sentry/vue (incl. Tracing) 45.58 kB - -
@sentry/svelte 25.89 kB - -
CDN Bundle 28.55 kB - -
CDN Bundle (incl. Tracing) 44.82 kB - -
CDN Bundle (incl. Logs, Metrics) 29.93 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 45.91 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.83 kB - -
CDN Bundle (incl. Tracing, Replay) 81.78 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 82.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 87.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 88.36 kB - -
CDN Bundle - uncompressed 83.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 134.03 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.55 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 137.44 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 210.91 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 251.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 254.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 264.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 267.56 kB - -
@sentry/nextjs (client) 48.54 kB - -
@sentry/sveltekit (client) 44.18 kB - -
@sentry/node-core 57.97 kB +0.01% +5 B 🔺
@sentry/node 174.81 kB +0.01% +6 B 🔺
@sentry/node - without tracing 97.93 kB +0.03% +23 B 🔺
@sentry/aws-serverless 115.16 kB +0.01% +8 B 🔺

View base workflow run

@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch 2 times, most recently from 1317257 to 2a86160 Compare February 23, 2026 14:51
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you apply the label PR: no-auto-close I will leave it alone ... forever!

@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 99ea611 to 9ded4c9 Compare April 15, 2026 13:10
@logaretm logaretm changed the title feat(nitro): Nitro SDK entry and metadata feat(nitro): Nitro SDK Apr 15, 2026
Comment thread yarn.lock Outdated
@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 53bf486 to 5f43f63 Compare April 15, 2026 13:15
@logaretm logaretm marked this pull request as ready for review April 15, 2026 17:16
@logaretm logaretm requested review from JPeer264, Copilot and s1gr1d April 15, 2026 17:16
Comment thread packages/nitro/src/sdk.ts Outdated
Comment thread packages/nitro/test/index.test.ts
Comment thread packages/nitro/package.json
},

"//": "This is built separately in tsconfig.setup-types.json",
"exclude": ["src/setup.ts"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy-pasted tsconfig excludes non-existent setup files

Low Severity

The tsconfig.types.json excludes src/setup.ts and references a tsconfig.setup-types.json — neither of which exist in this package. This was copied from the NestJS package (which actually has both files). While functionally harmless, it's misleading scaffolding that suggests missing build infrastructure.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ff579f3. Configure 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

Adds a new @sentry/nitro package skeleton to the monorepo and wires it into the repo’s release/testing/triage infrastructure as the base for a stacked series of Nitro SDK PRs.

Changes:

  • Introduces the new packages/nitro package with initial SDK/config scaffolding, build config, and a placeholder test.
  • Registers the package across monorepo plumbing (workspace list, root README, issue templates/labeling, release config).
  • Updates lockfile for the newly introduced dependency graph.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
yarn.lock Lockfile updates due to dependency graph changes.
packages/nitro/package.json New package manifest, exports, build/test scripts.
packages/nitro/rollup.npm.config.mjs Rollup config for publishing builds (ESM-only).
packages/nitro/tsconfig.json Package TS config (module/moduleResolution overrides).
packages/nitro/tsconfig.types.json Declaration-only build config for emitted types.
packages/nitro/tsconfig.test.json Test TS config for package tests.
packages/nitro/src/index.ts Public entrypoint re-exporting config + @sentry/node + Nitro init.
packages/nitro/src/sdk.ts Nitro SDK initialization wrapper around @sentry/node.
packages/nitro/src/config.ts withSentryConfig / module setup helper for Nitro config.
packages/nitro/src/module.ts Nitro module factory placeholder.
packages/nitro/src/common/debug-build.ts Debug-build flag constant (pattern consistent with other packages).
packages/nitro/src/utils/resolver.ts Path resolver helper utility.
packages/nitro/src/utils/plugin.ts Helper to add Nitro plugins.
packages/nitro/test/index.test.ts Placeholder Vitest test.
packages/nitro/test/tsconfig.json Test tsconfig shim extending package test config.
packages/nitro/README.md Initial package documentation.
packages/nitro/LICENSE Package license file.
packages/nitro/.eslintrc.js Package-local ESLint config extending repo base.
package.json Adds packages/nitro to workspace list.
dev-packages/e2e-tests/verdaccio-config/config.yaml Allows publishing @sentry/nitro in Verdaccio E2E setup.
README.md Adds @sentry/nitro to root package list.
.github/workflows/issue-package-label.yml Adds Nitro to package-to-label mapping.
.github/ISSUE_TEMPLATE/bug.yml Adds @sentry/nitro to bug template SDK dropdown.
.craft.yml Adds Nitro package to Craft release targets/metadata.

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

Comment thread packages/nitro/src/sdk.ts
Comment thread packages/nitro/src/sdk.ts
Comment thread packages/nitro/package.json
Comment thread packages/nitro/README.md
Comment thread packages/nitro/src/config.ts
Comment thread packages/nitro/README.md

## Compatibility

The minimum supported version of Nitro is `3.0.0-alpha.1`.
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The README states the minimum supported Nitro version is 3.0.0-alpha.1, but peerDependencies requires nitro >=3.0.260311-beta. Please align the README with the actual supported range (or adjust the peer dependency) to avoid confusing users.

Suggested change
The minimum supported version of Nitro is `3.0.0-alpha.1`.
The minimum supported version of Nitro is `3.0.260311-beta`.

Copilot uses AI. Check for mistakes.
Comment thread packages/nitro/src/config.ts
Comment thread packages/nitro/tsconfig.types.json
Comment thread packages/nitro/test/index.test.ts
Comment thread packages/nitro/src/sdk.ts Outdated
...options,
};

applySdkMetadata(opts, 'nitro');
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

For wrapper SDKs around @sentry/node, we typically include both the wrapper and node package names in applySdkMetadata so events show the full package chain (e.g. Remix uses ['remix', 'node']). Consider using applySdkMetadata(opts, 'nitro', ['nitro', 'node']) for consistency.

Suggested change
applySdkMetadata(opts, 'nitro');
applySdkMetadata(opts, 'nitro', ['nitro', 'node']);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mmm, we need a better way to do this but that's a fine suggestion for now.

Comment thread packages/nitro/src/config.ts
Comment thread packages/nitro/LICENSE Outdated
Comment thread packages/nitro/package.json Outdated
Comment thread packages/nitro/package.json Outdated
Comment thread packages/nitro/README.md Outdated
Comment thread packages/nitro/README.md Outdated
Comment thread packages/nitro/README.md Outdated
Comment thread .craft.yml Outdated
@logaretm logaretm requested a review from s1gr1d April 16, 2026 13:59
@logaretm
Copy link
Copy Markdown
Member Author

Thank you for all comments @s1gr1d very thorough review! all addressed 🙏

/* eslint-disable import/export */
export * from './config';
export * from '@sentry/node';
export { init } from './sdk';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing getDefaultIntegrations export from package index

Medium Severity

The Nitro-specific getDefaultIntegrations from ./sdk is not re-exported in index.ts. Only init is explicitly exported, so the getDefaultIntegrations that consumers receive via export * from '@sentry/node' is the node version, not the Nitro one. Every other SDK in the monorepo (NestJS, Elysia, Bun, Angular, Browser, AWS Serverless) exports both init and getDefaultIntegrations from their ./sdk module. This inconsistency will silently cause the wrong function to be used when Nitro-specific integrations are added.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5f3baf0. Configure here.

@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 5f3baf0 to 1dad524 Compare April 16, 2026 14:53
@logaretm logaretm changed the base branch from develop to awad/tracing-channel-otel-vendoring April 16, 2026 14:53
@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 1dad524 to 120ecba Compare April 16, 2026 16:19
@logaretm logaretm force-pushed the awad/tracing-channel-otel-vendoring branch from f3b037f to 1b87a8f Compare April 16, 2026 17:05
@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 120ecba to 014114f Compare April 16, 2026 17:07
Comment thread packages/nitro/package.json
logaretm added a commit that referenced this pull request Apr 17, 2026
Implements HTTP server instrumentation for both `h3` and `srvx` by
listening to their tracing channel events.

- `h3` TC PR: h3js/h3#1251
- `srvx` TC PR: h3js/srvx#141

Closes #18123 

---

**This PR is part of a stack:**

- #20358
- #19224
- #19225 👈
- #19304

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
label: 'nestjs-microservices (latest)'
- test-application: 'nitro-3'
build-command: 'test:build-canary'
label: 'nitro-3 (canary)'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing test:build-canary script breaks canary CI

High Severity

The canary workflow references test:build-canary as the build-command for the nitro-3 test application, but the package.json for nitro-3 only defines test:build — there is no test:build-canary script. The workflow step executes yarn ${{ matrix.build-command }}, which will fail. Other test applications like nuxt-3 and nuxt-4 correctly define test:build-canary scripts that install canary/nightly versions of their framework dependencies.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4cd6415. Configure here.

await request.get('/api/non-existent-route');

expect(errorReceived).toBe(false);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Negative test never fails due to race condition

Medium Severity

The "Does not send 404 errors" test voids the waitForError promise and immediately asserts errorReceived is false after the request completes. Since there's no waiting period, even if the SDK incorrectly sent a 404 error, it likely wouldn't arrive at the proxy server before the assertion runs. This test effectively provides no confidence that 404 errors are filtered — it will always pass regardless of SDK behavior.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 4cd6415. Configure here.

Base automatically changed from awad/tracing-channel-otel-vendoring to develop April 17, 2026 15:50
logaretm and others added 13 commits April 17, 2026 11:51
- Update LICENSE copyright year to 2026
- Expand peerDependencies range to cover nitro prereleases
- Bump nitro devDependency to latest beta
- Add beta notice to README
- Improve README wording (section title, Vite capitalization, --import mention)
- Point .craft.yml docs URL to package README until docs page exists
- Include 'node' in applySdkMetadata packages list for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The repo uses Oxlint, not ESLint. Remove the legacy .eslintrc.js file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
logaretm added a commit that referenced this pull request Apr 17, 2026
Implements HTTP server instrumentation for both `h3` and `srvx` by
listening to their tracing channel events.

- `h3` TC PR: h3js/h3#1251
- `srvx` TC PR: h3js/srvx#141

Closes #18123

---

**This PR is part of a stack:**

- #20358
- #19224
- #19225 👈
- #19304

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 4cd6415 to 47d85ab Compare April 17, 2026 15:54
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 6 total unresolved issues (including 4 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 47d85ab. Configure here.

"clean": "npx rimraf node_modules pnpm-lock.yaml .output",
"test": "playwright test",
"test:build": "pnpm install && pnpm build",
"test:assert": "pnpm test"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing test:build-canary script breaks canary CI

Medium Severity

The canary workflow specifies build-command: 'test:build-canary' for nitro-3, but the package.json only defines test:build — there is no test:build-canary script. Every other canary test application (e.g. nuxt-3, nextjs-14) explicitly defines a test:build-canary script that installs canary/nightly versions of its framework. The canary CI job will fail when it runs yarn test:build-canary and the script is not found.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 47d85ab. Configure here.

captureException(data.error, { mechanism: { type: 'auto.http.nitro.onTraceError', handled: false } });
data._sentrySpan?.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
data._sentrySpan?.end();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

onTraceError duplicates error capture without HTTP filtering

Medium Severity

onTraceError calls captureException for all errors without filtering, while captureErrorHook deliberately skips 3xx/4xx HTTPErrors. If both tracing channel error handlers and Nitro's error hook fire for the same error, this results in duplicate error events in Sentry. Additionally, onTraceError may capture HTTP errors that captureErrorHook intentionally suppresses, undermining the filtering logic.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 47d85ab. Configure here.

Implements HTTP server instrumentation for both `h3` and `srvx` by
listening to their tracing channel events.

- `h3` TC PR: h3js/h3#1251
- `srvx` TC PR: h3js/srvx#141

Closes #18123

---

**This PR is part of a stack:**

- #20358
- #19224
- #19225 👈
- #19304

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@logaretm logaretm force-pushed the awad/create-nitro-sdk-metadata branch from 47d85ab to fa580dd Compare April 18, 2026 03:53
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.

3 participants