feat(cogs): objectstore.cogs.usage datadog metric#492
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
lcian
reviewed
Jun 8, 2026
lcian
reviewed
Jun 8, 2026
lcian
approved these changes
Jun 8, 2026
lcian
left a comment
Member
There was a problem hiding this comment.
Please address comment about single vs batch and rejected vs accepted requests.
bdefa80 to
dcbd9ed
Compare
dcbd9ed to
de841d6
Compare
dcf127c to
a933c60
Compare
lcian
reviewed
Jun 9, 2026
Comment on lines
+58
to
+70
| /// [`CountingBackend`]'s implementation clashes with how the [`MultipartUploadBackend`] trait is | ||
| /// connected to the [`Backend`] trait. The workaround is to give `CountingBackend` (up to) two | ||
| /// `Arc`s that point to the inner backend: | ||
| /// - `inner: Arc<dyn Backend>` | ||
| /// - `inner_multipart: Option<Arc<dyn MultipartUploadBackend>>` if `inner` supports it | ||
| /// | ||
| /// [`CountingBackend`]'s implementation clashes with how the [`MultipartUploadBackend`] trait is | ||
| /// connected to the [`Backend`] trait: [`CountingBackend::as_multipart_upload_backend`] can't apply | ||
| /// the cast to `self.inner` which remains an `Arc<dyn Backend>`. There are two workarounds: | ||
| /// - (Rejected) Every multipart method must call `self.inner.clone().as_multipart_upload_backend()?` | ||
| /// which clones every time | ||
| /// - (Chosen) `CountingBackend` must call `self.inner.clone().as_multipart_upload_backend().ok()` | ||
| /// and hang onto it |
Member
There was a problem hiding this comment.
This is a different way to work around the problem with a minor disadvantage, but IMO preferable to this approach: #494
a933c60 to
98f3aa7
Compare
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 98f3aa7. Configure here.
Co-authored-by: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
98f3aa7 to
2d61ae5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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