Skip to content

presets(cloudflare): add missing types for cloudflare.wrangler.observability.traces#4220

Merged
pi0 merged 1 commit intonitrojs:mainfrom
gxres042:fix/v3/types-cf-wrangler-observability-traces
Apr 22, 2026
Merged

presets(cloudflare): add missing types for cloudflare.wrangler.observability.traces#4220
pi0 merged 1 commit intonitrojs:mainfrom
gxres042:fix/v3/types-cf-wrangler-observability-traces

Conversation

@gxres042
Copy link
Copy Markdown
Member

@gxres042 gxres042 commented Apr 21, 2026

🔗 Linked issue

#4215

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #4215

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@gxres042 gxres042 requested a review from pi0 as a code owner April 21, 2026 03:48
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

@gxres042 is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

Extended the Observability interface in Cloudflare Wrangler environment configuration by adding an optional traces property with enabled and head_sampling_rate configuration options. No existing functionality was modified or removed.

Changes

Cohort / File(s) Summary
Cloudflare Traces Typing
src/presets/cloudflare/wrangler/environment.ts
Added optional traces configuration object to Observability interface with support for enabled and head_sampling_rate properties.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The pull request title does not strictly follow conventional commits format. The scope is 'presets(cloudflare)' but should use 'fix' type instead of implicit 'presets' to align with the bug fix nature and conventional commits standard. Update the title to follow conventional commits format: 'fix(cloudflare): add missing types for cloudflare.wrangler.observability.traces' or 'fix(presets/cloudflare): add missing types for cloudflare.wrangler.observability.traces'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is related to the changeset, linking issue #4215 and indicating this is a bug fix for adding missing TypeScript types.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #4215 by adding the traces optional property with enabled and head_sampling_rate fields to the Observability interface.
Out of Scope Changes check ✅ Passed All changes are strictly scoped to adding the missing traces configuration type to the Observability interface, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/presets/cloudflare/wrangler/environment.ts`:
- Around line 1138-1142: The traces config type in environment.ts (the traces?:
{ ... } declaration) is missing two documented fields; update that type by
adding destinations?: string[] to accept an array of OpenTelemetry export
destination names and persist?: boolean (optional, default true per Cloudflare
docs) so TypeScript accepts valid wrangler configs; keep both fields optional
and include brief jsdoc comments if present elsewhere for consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31e05756-c1ac-4a70-9b57-502979f54e6b

📥 Commits

Reviewing files that changed from the base of the PR and between e3e654c and 71e4bb6.

📒 Files selected for processing (1)
  • src/presets/cloudflare/wrangler/environment.ts

Comment thread src/presets/cloudflare/wrangler/environment.ts
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4220

commit: 71e4bb6

Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

thanks ❤️

@pi0 pi0 changed the title fix(types): add missing types of `cloudflare.wrangler.observability.t… fix(types): add missing types of cloudflare.wrangler.observability.traces Apr 22, 2026
@pi0 pi0 changed the title fix(types): add missing types of cloudflare.wrangler.observability.traces presets(cloudflare): add missing types for cloudflare.wrangler.observability.traces Apr 22, 2026
@pi0 pi0 merged commit 2f02e40 into nitrojs:main Apr 22, 2026
10 of 11 checks passed
@gxres042 gxres042 deleted the fix/v3/types-cf-wrangler-observability-traces branch April 22, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add typing for cloudflare traces

2 participants