Skip to content

feat(processor): report duplicate events as dedup/filtered metrics - #7280

Merged
mihir20 merged 3 commits into
masterfrom
pipeline-inspector/01-dedup-metrics
Aug 19, 2026
Merged

mihir20 merged 3 commits into
masterfrom
pipeline-inspector/01-dedup-metrics

Conversation

@mihir20

@mihir20 mihir20 commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

First slice of the Pipeline Inspector work (extending the existing reporting counters so per-stage drops become visible to customers).

Duplicate events dropped by dedup are currently invisible to reporting: the only trace is the processor_write_key_duplicate_events prometheus counter, so events "go missing" between the gateway and downstream stages with no report row explaining why.

This PR gives duplicates a report row:

  • New PU constant DEDUP = "dedup" in utils/types/reporting_types.go.
  • New reloadable flag Reporting.dedupMetrics.enabled (default false), registered once in loadReloadableConfig and read via .Load() at the emission site.
  • Emission: at the existing duplicate-drop point in the preprocess loop, gated by proc.isReportingEnabled() && proc.config.dedupMetricsEnabled.Load(), a filtered/298 row is accumulated into a new dedupStatusDetailsMap (same mutate/reset pattern as the adjacent bot-management and event-blocking blocks).
  • PU shape: built in pretransformStage with CreatePUDetails("", DEDUP, false, false) — a standalone side-PU exactly like BOT_MANAGEMENT/EVENT_BLOCKING: reportedBy=dedup, state=filtered, status_code=298, empty in_reported_by, terminal=false, initial=false. Rows ride the existing storeStage reporting transaction; no reporting-plumbing changes.
  • The map is threaded through srcHydrationMessage → preTransformationMessage with an AssertKeysSubset check, following the existing status-detail-map pattern.

Unchanged: the drop itself, the prometheus counter (increments identically with the flag on or off), and billing — duplicates still never reach the GATEWAY metric, so this is purely additive. With the flag off (default), every report row is identical to today.

The reporting service ingests the new dedup rows with no changes: there is no reportedBy allowlist on the write path, and non-canonical states keep their value in the count column, contributing 0 to existing success/abort/fail sums.

Tests

Unit: new TestDedupReporting in processor/processor_test.go (6 subtests): exactly one dedup filtered/298 row per drop with the correct PU shape, no GATEWAY row for the deduped twin, no row with the flag off or with reporting disabled, identical duplicate-counter behaviour in both flag states, and aggregation of N duplicates into a single row with count N.

Integration: new "Events dropped in dedup stage" subtest in TestReportingDroppedEvents (integration_test/reporting_dropped_events): boots the full server with dedup and the metrics flag on, sends 1 event + 2 duplicates, and asserts the reports table gets a dedup/filtered/298 row with count 2 (empty in_pu, non-terminal, non-initial) while the gateway PU counts only the surviving event. runRudderServer gained a variadic config-overrides parameter; existing subtests are unchanged.

Linear Ticket

pipe-3285

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@mihir20

mihir20 commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Stack (merge bottom-up)

@mihir20
mihir20 marked this pull request as draft August 17, 2026 10:40
@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.64%. Comparing base (e13b731) to head (4de5a3e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7280      +/-   ##
==========================================
- Coverage   79.67%   79.64%   -0.04%     
==========================================
  Files         601      601              
  Lines       67192    67217      +25     
==========================================
- Hits        53535    53534       -1     
- Misses      10490    10522      +32     
+ Partials     3167     3161       -6     

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

@mihir20
mihir20 marked this pull request as ready for review August 17, 2026 11:29
@mihir20
mihir20 requested review from atzoum and itsmihir and removed request for atzoum August 17, 2026 11:29
@ktgowtham
ktgowtham self-requested a review August 18, 2026 11:04
Comment thread processor/processor.go Outdated
proc.config.mirrorFilterCacheTTL = proc.conf.GetDurationVar(3, time.Hour, "Processor.userTransformationMirroring.filterCacheTTL")
proc.config.userTransformationMirroringBlockedIDs = proc.conf.GetReloadableStringSliceVar(nil, "Processor.userTransformationMirroring.blockedTransformationIDs")
proc.config.storeSamplerEnabled = proc.conf.GetReloadableBoolVar(false, "Processor.storeSamplerEnabled")
proc.config.dedupMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.dedupMetrics.enabled")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
proc.config.dedupMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.dedupMetrics.enabled")
proc.config.reportingDedupMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.dedupMetrics.enabled")

Duplicate events dropped by dedup were invisible to reporting: only the
processor_write_key_duplicate_events prometheus counter recorded them.
Emit a filtered/298 report row under a new standalone DEDUP side-PU
(CreatePUDetails("", DEDUP, false, false), like BOT_MANAGEMENT and
EVENT_BLOCKING) at the duplicate-drop point in the preprocess loop,
gated by reporting being enabled plus the new reloadable flag
Reporting.dedupMetrics.enabled (default false).

The drop itself, the prometheus counter, and the GATEWAY billing metric
are unchanged; with the flag off every report row is identical to today.

Co-Authored-By: Claude Fable 5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
Extend TestReportingDroppedEvents with a dedup-stage subtest: with
Dedup.enableDedup and Reporting.dedupMetrics.enabled on, sending one
event plus two duplicates yields a dedup/filtered/298 row with count 2
(empty in_pu, non-terminal, non-initial) in the reports table, while
the gateway PU counts only the surviving event.

runRudderServer gains a variadic config-overrides parameter; existing
subtests are unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 force-pushed the pipeline-inspector/01-dedup-metrics branch from 17bcee0 to 5445674 Compare August 19, 2026 10:57
…icsEnabled

Aligns the field name with its Reporting.dedupMetrics.enabled config key,
as suggested in review.

Co-Authored-By: Claude Fable 5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
@mihir20
mihir20 merged commit f2655fb into master Aug 19, 2026
76 checks passed
@mihir20
mihir20 deleted the pipeline-inspector/01-dedup-metrics branch August 19, 2026 12:14
This was referenced Aug 24, 2026
itsmihir pushed a commit that referenced this pull request Aug 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.84.0-rc.1](v1.83.0...v1.84.0-rc.1)
(2026-08-24)


### Features

* add AGENTS.md for agent management and reference
([#7290](#7290))
([2d28b32](2d28b32))
* **processor:** report duplicate events as dedup/filtered metrics
([#7280](#7280))
([f2655fb](f2655fb))
* **warehouse:** add clickhouse driver interface
([#7296](#7296))
([239d9a4](239d9a4))


### Bug Fixes

* **processor:** proc destination hydration omitted destination's
original id
([#7297](#7297))
([f389df4](f389df4))
* **warehouse:** close load file descriptor in identity uploadFile
([#7186](#7186))
([bfd8bc9](bfd8bc9))


### Miscellaneous

* handle oversized reporting payloads
([#7293](#7293))
([7a83281](7a83281))
* pyt security hardening
([#7272](#7272))
([e13b731](e13b731))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request Aug 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.84.0](v1.83.0...v1.84.0)
(2026-08-24)


### Features

* add AGENTS.md for agent management and reference
([#7290](#7290))
([2d28b32](2d28b32))
* **processor:** report duplicate events as dedup/filtered metrics
([#7280](#7280))
([f2655fb](f2655fb))
* **warehouse:** add clickhouse driver interface
([#7296](#7296))
([239d9a4](239d9a4))


### Bug Fixes

* **processor:** proc destination hydration omitted destination's
original id
([#7297](#7297))
([f389df4](f389df4))
* **warehouse:** close load file descriptor in identity uploadFile
([#7186](#7186))
([bfd8bc9](bfd8bc9))


### Miscellaneous

* handle oversized reporting payloads
([#7293](#7293))
([7a83281](7a83281))
* pyt security hardening
([#7272](#7272))
([e13b731](e13b731))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.

3 participants