Skip to content

ref(eap-outcomes): dedupe by item_type#7896

Merged
MeredithAnya merged 3 commits intomasterfrom
meredith/4-22-26-eap-outcomes
Apr 23, 2026
Merged

ref(eap-outcomes): dedupe by item_type#7896
MeredithAnya merged 3 commits intomasterfrom
meredith/4-22-26-eap-outcomes

Conversation

@MeredithAnya
Copy link
Copy Markdown
Member

@MeredithAnya MeredithAnya commented Apr 22, 2026

Summary

  • Partitions seen_items and duplicate_item_count in AggregatedOutcomesBatch by item_type (HashMap<i32, HashSet<ItemDedupKey>> / HashMap<i32, u64>) so dedup is scoped per item type rather than across all types
  • Extracts dedup logic into an is_duplicate(&TraceItem) method on OutcomesAggregator, backed by a record_if_duplicate method on AggregatedOutcomesBatch that encapsulates both the set insert and the count increment
  • Updates the accepted_outcomes.duplicate_items counter to emit with an item_type tag

Test plan

  • cargo test is_duplicate_per_item_type passes
  • Verify accepted_outcomes.duplicate_items metric now has item_type tag in staging

🤖 Generated with Claude Code

@MeredithAnya MeredithAnya requested a review from a team as a code owner April 22, 2026 22:56
Comment thread rust_snuba/src/strategies/accepted_outcomes/aggregator.rs
Comment thread rust_snuba/src/strategies/accepted_outcomes/aggregator.rs Outdated
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 23, 2026

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 357dbde. Configure here.

Comment thread rust_snuba/src/strategies/accepted_outcomes/aggregator.rs
@MeredithAnya MeredithAnya changed the title ref(eap-outcomes): dedupe by item_type, exclude Log, Metric ref(eap-outcomes): dedupe by item_type Apr 23, 2026
@xurui-c xurui-c self-requested a review April 23, 2026 20:58
Comment thread rust_snuba/src/strategies/accepted_outcomes/aggregator.rs
@MeredithAnya MeredithAnya merged commit aa65033 into master Apr 23, 2026
49 checks passed
@MeredithAnya MeredithAnya deleted the meredith/4-22-26-eap-outcomes branch April 23, 2026 21:45
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.

4 participants