feat(cogs): objectstore.cogs.usage datadog metric#492
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #492 +/- ##
==========================================
+ Coverage 87.17% 87.25% +0.07%
==========================================
Files 83 84 +1
Lines 13138 13234 +96
==========================================
+ Hits 11453 11547 +94
- Misses 1685 1687 +2
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bdefa80. Configure here.
| cogs::count(&usecase); | ||
| Ok(()) | ||
| } | ||
| }); |
There was a problem hiding this comment.
Batch COGS skips pre-auth ops
Medium Severity
Per-operation objectstore.cogs.usage is incremented only after rate limiting, authorization, and use-case policy checks, while non-batch routes increment once in middleware before those checks. Batch operations that fail earlier in the pipeline emit no COGS, and batch HTTP requests rejected before the handler also emit none, unlike equivalent single-object requests.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bdefa80. Configure here.


imitating how relay does compute COGS, except we are using request counts rather than request timings because we're network-bound and CPU-light
every request incrs the counter by 1, except batch requests incr it for each operation in the batch
need to update usage-accountant config to consume the counter but then compute COGS is finished
Ref FS-195