fix(otel): cents-scale bucket boundaries for session.cost.total histogram#59
Conversation
…istogram The session.cost.total histogram was using OTel SDK default bucket boundaries [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000, +Inf] which are USD-scale. Since typical opencode session costs are sub-dollar, 100% of samples land in the le=5 bucket and P50/P95 panels in SigNoz return empty. Add advice.explicitBucketBoundaries with cents-scale boundaries: [0.01, 0.05, 0.10, 0.25, 0.50, 1.00, 2.50, 5.00, 10.00, 25.00] These cover the realistic distribution of per-session costs and produce meaningful percentile values in downstream observability tooling.
|
Warning Review limit reached
More reviews will be available in 34 minutes and 1 second. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. 📝 WalkthroughWalkthroughThe PR updates the observability telemetry configuration by adding explicit bucket boundaries to the ChangesSession cost histogram configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 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 |
Problem
opencode.session.cost.totalis a Histogram registered without explicit bucket boundaries, so the OTel JS SDK applies defaults[0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000](USD-scale).Real-world session costs are typically under $1, so every observation lands in the
le=5bucket. P50/P95 panels return 0 because the histogram can't resolve sub-$5 percentiles.Fix
Add
advice.explicitBucketBoundarieswith cents-scale boundaries:[0.01, 0.05, 0.10, 0.25, 0.50, 1.00, 2.50, 5.00, 10.00, 25.00].Evidence
ClickHouse bucket distribution against a live SigNoz (all 267 samples in
le=5):Bucket change affects new data only; existing histograms keep their old boundaries.
Companion PR: #58
Summary by CodeRabbit