Repository navigation
fix(observability): report failure rate as a percentage - #6019
Conversation
|
@iamhaseebn is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe tracing analytics helper now returns ChangesFailure rate correction
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This change makes the Requests card display failure rates as percentages, such as 16.67% instead of 0.17%. The calculation is localized and covered by regression tests, with no actionable merge-blocking risk remaining after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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.
🧹 Nitpick comments (1)
web/oss/src/services/tracing/lib/helpers.test.ts (1)
8-26: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd boundary-case assertions for the percentage contract.
The test covers one error out of six traces. Add cases for an all-failure input returning
100and an empty input returning0. These cases protect the remainingfailure_ratebranches and the all-failure behavior described in the PR objective.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 8c539c0f-d9cc-4b7d-b59e-037310088234
📒 Files selected for processing (2)
web/oss/src/services/tracing/lib/helpers.test.tsweb/oss/src/services/tracing/lib/helpers.ts
mmabrouk
left a comment
There was a problem hiding this comment.
Thanks @iamhaseebn for your contribution!
|
@all-contributors please add @iamhaseebn for code |
|
I've put up a pull request to add @iamhaseebn! 🎉 |
Summary
Closes #5967.
The usage card treated the failure rate as a ratio even though the UI appends
%, so 1 failed request out of 6 displayed as0.17%. The analytics transform now returns a percentage, so the card displays16.67%.Testing
Verified locally
pnpm --filter @agenta/oss exec vitest run src/services/tracing/lib/helpers.test.tsAdded or updated tests
Added a regression test for 1 failure in 6 requests, expecting
16.67.QA follow-up
Confirm the Requests card shows
16.67%for 1 failed request out of 6.Demo
Checklist
Contributor Resources