presets(cloudflare): bridge tracing channel events to observability custom spans#4413
presets(cloudflare): bridge tracing channel events to observability custom spans#4413RihanArfan wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
📝 WalkthroughWalkthroughThis PR adds an experimental Cloudflare telemetry bridge connecting Nitro tracing-channel events to Cloudflare Workers custom spans. It updates shared subscription handling and existing consumers, wires the bridge into Cloudflare presets, adds tests, and documents the required configuration. ChangesTracing channel telemetry integration
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/presets/cloudflare/runtime/telemetry/plugin.ts`:
- Around line 31-35: In the attribute loop within the telemetry plugin, handle
`attributeValue(value)` results before calling `entry.span.setAttribute`: skip
entries whose converted value is `undefined`, while preserving valid primitive
or array values.
🪄 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: a6b844e5-5673-4a74-a6b0-9ceb174e1d33
📒 Files selected for processing (6)
src/presets/cloudflare/runtime/telemetry/plugin.tssrc/presets/vercel/runtime/telemetry/plugin.tssrc/runtime/internal/telemetry/logger-plugin.tssrc/runtime/internal/telemetry/subscribe.tstest/unit/cloudflare-telemetry.test.tstest/unit/telemetry-subscribe.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/unit/cloudflare-telemetry.test.ts
| export default definePlugin(() => { | ||
| subscribeTracedChannels((info, startTimeUnixNano, error) => { | ||
| // Describer failed on the completed payload — nothing to report. | ||
| if (!info) return; |
There was a problem hiding this comment.
Looks like a bug. Why are we even calling callback in this case?
🔗 Linked issue
#4355
❓ Type of change
📚 Description
Porting #4355 to Cloudflare to support Nitro tracing on more platforms.
Bridge tracing channel messages to Cloudflare Workers Observability as custom spans.
📝 Checklist