fix(otel): cents-scale bucket boundaries for session.cost.total histogram#59
fix(otel): cents-scale bucket boundaries for session.cost.total histogram#59TestardR wants to merge 1 commit into
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 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