Skip to content

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

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

pi0 merged 1 commit into
nitrojs:mainfrom
gxres042:fix/v3/types-cf-wrangler-observability-traces

Conversation

@gxres042

@gxres042 gxres042 commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

🔗 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

vercel Bot commented Apr 21, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor
📝 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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

@pkg-pr-new

pkg-pr-new Bot commented Apr 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 71e4bb6

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

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
9 checks passed
@gxres042
gxres042 deleted the fix/v3/types-cf-wrangler-observability-traces branch April 22, 2026 12:22
RihanArfan pushed a commit that referenced this pull request Apr 27, 2026
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