Skip to content

chore: emit filtered metrics from all non-ut stages and clean up diff metrics - #6485

Merged
itsmihir merged 5 commits into
masterfrom
chore.filtered-metrics-from-all-non-ut-stages
Nov 11, 2025
Merged

itsmihir merged 5 commits into
masterfrom
chore.filtered-metrics-from-all-non-ut-stages

Conversation

@itsmihir

@itsmihir itsmihir commented Nov 5, 2025 •

Copy link
Copy Markdown
Contributor

Description

Summary

This PR standardizes metric collection across non-UT (User Transformation) stages by consistently capturing succeeded, aborted, and filtered metrics, while removing redundant diff metrics.

Current State

DESTINATION_FILTER stage:

  • Currently captures diff metrics (calculated as succeeded + aborted + filtered - input) to track dropped events

EVENT_FILTER and DEST_TRANSFORMER stages:

  • Capture filtered metrics to track dropped events
  • Also capture diff metrics (redundant, since we explicitly track succeeded, aborted, and filtered states)

Changes

This PR makes metric collection consistent across all non-UT stages:

  1. DESTINATION_FILTER:

    • ❌ Stop capturing diff metrics
    • ✅ Start capturing filtered metrics
  2. EVENT_FILTER and DEST_TRANSFORMER:

    • ❌ Stop capturing diff metrics
    • ✅ Continue capturing filtered metrics (no change)

Result

All non-UT stages now consistently capture three explicit metric types:

  • succeeded
  • aborted
  • filtered

The diff metrics have been completely removed as they are redundant when we explicitly track all three states.

Linear Ticket

Fixes PIPE-2507

Security

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

Comment thread processor/processor.go
if proc.isReportingEnabled() {
diffMetrics := getDiffMetrics(
reportingtypes.DESTINATION_FILTER,
inPU,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

inPU could be tracking_plan or destination_filter

@itsmihir
itsmihir requested a review from ktgowtham November 5, 2025 13:49
@itsmihir itsmihir assigned atzoum and unassigned atzoum Nov 5, 2025
@itsmihir
itsmihir requested a review from atzoum November 5, 2025 13:49
@codecov

codecov Bot commented Nov 5, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.26%. Comparing base (45e5dba) to head (c01f11f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6485      +/-   ##
==========================================
- Coverage   79.28%   79.26%   -0.02%     
==========================================
  Files         530      530              
  Lines       59391    59355      -36     
==========================================
- Hits        47086    47049      -37     
- Misses       9490     9491       +1     
  Partials     2815     2815              

☔ View full report in Codecov by Sentry.
📢 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.

@ktgowtham
ktgowtham requested a review from cisse21 November 7, 2025 06:01
Comment thread processor/processor.go Resolved

@cisse21 cisse21 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.

LGTM

@itsmihir
itsmihir requested a review from ktgowtham November 10, 2025 06:13
…into chore.filtered-metrics-from-all-non-ut-stages

🔒 Scanned for secrets using gitleaks 8.28.0
@itsmihir
itsmihir enabled auto-merge (squash) November 10, 2025 06:21
@itsmihir
itsmihir merged commit 399c4c6 into master Nov 11, 2025
@itsmihir
itsmihir deleted the chore.filtered-metrics-from-all-non-ut-stages branch November 11, 2025 03:47
This was referenced Nov 11, 2025
itsmihir pushed a commit that referenced this pull request Nov 11, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.63.0-rc.1](v1.62.0...v1.63.0-rc.1)
(2025-11-11)


### Features

* **router:** dynamic sizing of worker job buffers
([#6463](#6463))
([5b2e519](5b2e519))


### Bug Fixes

* max procs defaults
([#6473](#6473))
([48f9cfd](48f9cfd))
* max procs defaults
([#6473](#6473))
([3d2026c](3d2026c))
* pending batch router jobs for disabled destinations are not being
aborted
([#6477](#6477))
([8effa78](8effa78))
* remove source labels in repo query stats
([#6483](#6483))
([48f9cfd](48f9cfd))
* use type field from payload to check if event is blocked
([#6487](#6487))
([5ba053f](5ba053f))


### Miscellaneous

* apply security best practices from step security
([#6462](#6462))
([a860128](a860128))
* emit filtered metrics from all non-ut stages and clean up diff metrics
([#6485](#6485))
([399c4c6](399c4c6))
* refactor processor to move archival in a preprocess stage
([#6470](#6470))
([8634c3f](8634c3f))
* remove oauth status toggling
([#6492](#6492))
([45e5dba](45e5dba))
* sync release v1.62.0 to main branch
([#6472](#6472))
([65db4ee](65db4ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
itsmihir pushed a commit that referenced this pull request Nov 12, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.63.0](v1.62.0...v1.63.0)
(2025-11-11)


### Features

* **router:** dynamic sizing of worker job buffers
([#6463](#6463))
([5b2e519](5b2e519))


### Bug Fixes

* max procs defaults
([#6473](#6473))
([48f9cfd](48f9cfd))
* max procs defaults
([#6473](#6473))
([3d2026c](3d2026c))
* pending batch router jobs for disabled destinations are not being
aborted
([#6477](#6477))
([8effa78](8effa78))
* remove source labels in repo query stats
([#6483](#6483))
([48f9cfd](48f9cfd))
* use type field from payload to check if event is blocked
([#6487](#6487))
([5ba053f](5ba053f))


### Miscellaneous

* apply security best practices from step security
([#6462](#6462))
([a860128](a860128))
* emit filtered metrics from all non-ut stages and clean up diff metrics
([#6485](#6485))
([399c4c6](399c4c6))
* refactor processor to move archival in a preprocess stage
([#6470](#6470))
([8634c3f](8634c3f))
* remove oauth status toggling
([#6492](#6492))
([45e5dba](45e5dba))
* sync release v1.62.0 to main branch
([#6472](#6472))
([65db4ee](65db4ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
mihir20 added a commit that referenced this pull request Oct 8, 2026
…estination transformations (#7446)

# Description

Destination transformation can multiplex, returning more or fewer events
than it was given, so `succeeded + filtered + aborted` for the
`dest_transformer` stage does not equal its input. #6485 removed the
stage's `diff` rows on DB-load grounds, reasoning that the explicit rows
make them redundant; that does not hold under multiplexing. This brings
them back behind `Reporting.destTransformerDiffMetrics.enabled` (default
false), computed with the existing `getDiffMetrics` helper from the
event-filter output counts.

The diff rows carry `in_pu=''` while the sibling `dest_transformer` rows
carry `in_pu='event_filter'`; a reconciliation that filters the stage by
`in_pu` will not see them. The succeeded rows are unchanged: the count
maps they now populate feed only the diff.

## Linear Ticket

[PIPE-3454](https://linear.app/rudderstack/issue/PIPE-3454)

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
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