Skip to content

feat(cogs): objectstore.cogs.usage datadog metric#492

Open
matt-codecov wants to merge 1 commit into
mainfrom
matt/objectstore-cogs-metric
Open

feat(cogs): objectstore.cogs.usage datadog metric#492
matt-codecov wants to merge 1 commit into
mainfrom
matt/objectstore-cogs-metric

Conversation

@matt-codecov
Copy link
Copy Markdown
Contributor

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

@matt-codecov matt-codecov requested a review from a team as a code owner June 5, 2026 23:59
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

FS-195

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 97.93814% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.25%. Comparing base (3de99d5) to head (bdefa80).

Files with missing lines Patch % Lines
objectstore-server/src/web/middleware.rs 97.18% 2 Missing ⚠️
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     
Components Coverage Δ
Rust Backend 92.38% <97.93%> (+0.05%) ⬆️
Rust Client 79.70% <ø> (ø)
Python Client 88.51% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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(())
}
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bdefa80. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant