Skip to content

feat(cogs): Create inventory-tracker crate for storage oplog - #588

Merged
matt-codecov merged 1 commit into
mainfrom
matth/storage-inventory-tracker
Aug 26, 2026
Merged

feat(cogs): Create inventory-tracker crate for storage oplog#588
matt-codecov merged 1 commit into
mainfrom
matth/storage-inventory-tracker

Conversation

@matt-codecov

@matt-codecov matt-codecov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Ref FS-210
Related to getsentry/sentry-kafka-schemas#497

Creates the inventory-tracker crate in our project that we will use to emit Kafka messages for a change stream that we will turn into a COGS pipeline.

This crate isn't Objectstore-specific at all. If/when another service wants to use it, we can move it to a separate repository and set up a release process for it. I just couldn't be bothered if nobody's asking for it.

@matt-codecov
matt-codecov requested a review from a team as a code owner August 5, 2026 06:09
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

FS-210

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.45614% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.16%. Comparing base (79e7719) to head (c26d574).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
objectstore-inventory-tracker/src/kafka.rs 85.14% 15 Missing ⚠️
objectstore-inventory-tracker/src/producer.rs 83.95% 13 Missing ⚠️
objectstore-inventory-tracker/src/tracker.rs 95.93% 12 Missing ⚠️
objectstore-inventory-tracker/src/test_utils.rs 84.21% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
+ Coverage   88.00%   88.16%   +0.15%     
==========================================
  Files          96      101       +5     
  Lines       15961    16533     +572     
==========================================
+ Hits        14047    14576     +529     
- Misses       1914     1957      +43     
Components Coverage Δ
Rust Backend 92.34% <ø> (ø)
Rust Client 81.97% <ø> (ø)
Python Client 93.38% <50.00%> (-0.13%) ⬇️

☔ 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.

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initial review. Some of the below comments can be left for follow-up to get a first version in, as long as they don't change the overall concept and can be fixed in isolation. Particularly, shutdown is a larger topic.

Comment thread Cargo.toml Outdated
Comment thread Cargo.toml Outdated
Comment thread objectstore-inventory-tracker/src/lib.rs Outdated
Comment thread objectstore-inventory-tracker/src/producer.rs
Comment thread inventory-tracker/src/kafka.rs Outdated

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. See the open comments before merge, please.

Either in this PR or in a follow up, I'd suggest to add metrics, especially for errors.

@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker branch 2 times, most recently from d180831 to 6373531 Compare August 11, 2026 06:15
@jan-auer jan-auer changed the title feat(cogs): create inventory-tracker crate for storage oplog feat(cogs): Create inventory-tracker crate for storage oplog Aug 12, 2026

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Approving for merge, provided the comments below are solved

Comment thread objectstore-inventory-tracker/src/producer.rs
Comment thread objectstore-inventory-tracker/src/kafka.rs Outdated
Comment thread objectstore-inventory-tracker/src/producer.rs Outdated
Comment thread objectstore-inventory-tracker/src/producer.rs Outdated
Comment thread objectstore-inventory-tracker/src/tracker.rs
@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker branch from 6373531 to 1cec3c4 Compare August 15, 2026 03:32
@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker branch from 1cec3c4 to c26d574 Compare August 26, 2026 21:42
@matt-codecov
matt-codecov merged commit ad4c8b0 into main Aug 26, 2026
26 checks passed
@matt-codecov
matt-codecov deleted the matth/storage-inventory-tracker branch August 26, 2026 21:57
matt-codecov added a commit that referenced this pull request Aug 26, 2026
…on (#590)

Ref FS-210
Depends on #588

- `ChangeStream` trait that `Backend` impls will use to record
write/update/delete operations.
- `CostTrackerStream` impl and config to publish change stream events to
Kafka through `inventory-tracker`
- `NoopStream` stub impl is used by default

While `ChangeStream` is abstract and we can implement a `MultiStream`
wrapper that dispatches changes to multiple sinks, currently the
abstraction is only in the code and not in the config.
`CostTrackerStream` is configured through `CostTrackerConfig`
(service-wide, Kafka details, used in later PR) and
`CostTrackerStreamConfig` (on each `Backend` impl, added here). It's
assumed that other `ChangeStream` implementations will similarly be
named directly in config.

Backends are not instrumented yet and `objectstore-server` doesn't
expose configuring Kafka yet.
jan-auer added a commit that referenced this pull request Aug 28, 2026
* main:
  release: 0.2.4
  build(python): Upgrade cryptography to 50.0.0 (#605)
  build(deps): bump setuptools from 80.9.0 to 83.0.0 (#604)
  feat(config): resolve ${file:...} and ${VAR} references in config (#599)
  feat(cogs): publish backend change streams to Kafka (#597)
  feat(cogs): report backend changes to a change stream (#595)
  feat(cogs): ChangeStream trait, preparation for backend instrumentation (#590)
  feat(cogs): Create inventory-tracker crate for storage oplog (#588)
  feat(python-client): Deprecate `propagate_traces` (#603)
  feat(python-client): Send a default User-Agent header (#601)
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.

2 participants