docs: correct workers tracing sampling description#81
Conversation
Worker spans now respect the global sampler — the previous force-sampling behavior was removed. Update the description to match current behavior.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated worker tracing documentation to clarify that Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Pull request overview
Updates the workers tracing documentation to reflect that worker cycle spans are sampled according to the global OpenTelemetry TracerProvider sampler (rather than being force-sampled), clarifying how root-span sampling can drop worker traces under low sampling ratios.
Changes:
- Corrects the tracing section to state worker spans typically have no parent and therefore follow the global sampler.
- Adds guidance that low
ParentBased(TraceIDRatioBased(...))ratios can probabilistically drop worker spans and suggests usingAlwaysSample()when full coverage is required.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
The workers tracing docs claimed worker spans are "always sampled regardless of the global sampler" — this is no longer accurate. The current
middleware.Tracing()implementation usestracing.NewInternalSpanwhich respects the global sampler.Updated the description to reflect actual behavior: worker spans are typically trace roots, so sampling follows the global
TracerProvider's sampler. If usingParentBased(TraceIDRatioBased(...))with a low ratio, worker spans may be dropped — users should configureAlwaysSample()if needed.Test plan
Summary by CodeRabbit
workerspans are sampled by the globalTracerProviderand provided guidance on configuring sampling strategies for worker cycles to ensure consistent tracing behavior.