Repository navigation
feat: user_suppression counter via suppressed dummy jobs - #7325
Conversation
|
Stack
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7325 +/- ##
==========================================
- Coverage 80.26% 80.22% -0.04%
==========================================
Files 612 612
Lines 68676 68749 +73
==========================================
+ Hits 55121 55157 +36
- Misses 10306 10349 +43
+ Partials 3249 3243 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5746f3f to
544f5e0
Compare
544f5e0 to
262bba3
Compare
…y jobs Suppressed events currently vanish at the gateway with only a prometheus stat. Behind the new reloadable flag Gateway.storeUserSuppressedEvents (default false), the gateway now stores a dummy job instead — payload stripped to messageId/type/event/receivedAt so no user data survives suppression — marked is_user_suppressed in the job parameters and excluded from live-event recording, on both the public and internal batch paths (a fully-suppressed public request stores N dummy jobs and returns 200 instead of short-circuiting via errRequestSuppressed). The processor recognises the parameter at the top of the preprocess loop — before bot management, event blocking, dedup and the GATEWAY billing metric — emits one filtered/298 row under the new standalone USER_SUPPRESSION PU (reportedBy is the discriminator, like dedup), and unconditionally drops the event, following the bot-blocking pattern. Billing, dedup keys, event schemas and archival are untouched. The processor side is complete with the gateway flag off, so the flag may only be enabled once all processor pods run this version. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
The public path (getJobDataFromRequest) always drops suppressed events again, regardless of Gateway.storeUserSuppressedEvents — reverting its dummy-job block and the per-job parameters override, so a fully-suppressed public request short-circuits via errRequestSuppressed exactly as before this branch. The flag now only controls the internal batch path, where suppressed events become stripped dummy jobs reported and dropped at the processor. Public-path Ginkgo specs replaced with a guard that the flag never leaks back into that path; the integration subtest now drives /internal/v1/batch for the flag-on flow and pins that /v1/batch stores nothing even with the flag on. 🔒 Scanned for secrets using gitleaks 8.28.0
|
|
||
| isUserSuppressedEvent := false | ||
| if isUserSuppressed(msg.Properties.WorkspaceID, msg.Properties.UserID, msg.Properties.SourceID) { | ||
| gw.logger.Infon("suppressed event", |
There was a problem hiding this comment.
do we really need to log an info message every time we find a suppressed event?
There was a problem hiding this comment.
not sure, may be for audit purpose
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.destFilterStatusDetailMap) | ||
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.botManagementStatusDetailsMap) | ||
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.eventBlockingStatusDetailsMap) | ||
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.userSuppressionStatusDetailsMap) | ||
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.dedupStatusDetailsMap) | ||
| reportingtypes.AssertKeysSubset(preTrans.connectionDetailsMap, preTrans.enricherStatusDetailsMap) |
There was a problem hiding this comment.
Please remind me why we need to wait to reach at the pretransform stage in order to fill reportMetrics for all these stages (dest filter, bot management, even blocking, dedup, user suppression, etc.)
There was a problem hiding this comment.
Actually, I don't think we need to wait to reach the pre-transform stage to fill reportMetrics. I can pick up the refactoring of this in a separate PR.
There was a problem hiding this comment.
yes, it is weird having to carry over all these maps in the stage messages
🔒 Scanned for secrets using gitleaks 8.28.0
…03-user-suppression-counter 🔒 Scanned for secrets using gitleaks 8.28.0
891feb3 to
2ce9f18
Compare
🔒 Scanned for secrets using gitleaks 8.28.0
) # Description Adds a new `gateway_ingested` reporting PU that counts **every** event entering the processor's preprocess stage — including events that are subsequently dropped (bot, blocked, suppressed, dedup, filtered). This gives the pipeline inspector a stable "everything that came in" baseline to reconcile all downstream drop/filter rows against: `gateway_ingested = delivered + all drop rows + multiplexed`. ## What changed - **New `GATEWAY_INGESTED` PU** (`utils/types/reporting_types.go`): reported as a standalone side PU (`inPU: ""`, not part of the terminal/initial PU chain), so the existing `gateway` billing row and PU chains are untouched. - **Counter emission in preprocess** (`processor/processor.go`): in `preprocessStage`, before any drop decision is made, every event is recorded into a new `gatewayIngestedStatusDetailsMap` as a `succeeded` row with `StatusCode: 200`. The shared reporting event's status code is reset to 0 right after, so the `gateway` billing row keeps its `StatusCode: 0` as before. The map is threaded through `preTransformationMessage` → `srcHydrationMessage` → `pretransformStage`, where rows are flushed into `reportMetrics` alongside the other drop-metric maps (with the usual `AssertKeysSubset` guard). - **Feature flag**: emission is gated behind reloadable `Reporting.gatewayIngestedMetrics.enabled` (default **false**) and requires reporting to be enabled. With the flag off, report metrics are identical to before. ## Semantics - One `gateway_ingested` row aggregates events with the same source/name/type; rows split by event type. - Dropped events are still counted — that's the point of the baseline. - A bot event that is flagged but not dropped counts exactly once in both `gateway_ingested` and `gateway`. ## Tests - `processor/processor_test.go` — new `TestGatewayIngestedReporting` covering flag on/off, reporting disabled, mixed batches with drops, all-dropped batches, aggregation/splitting by event type, billing-row `StatusCode` unaffected, and bot-flagged-but-not-dropped events. - `integration_test/reporting_dropped_events` — consent-filter scenario verifying per-destination visibility at the destination-filter boundary (`destination_enter` rows per candidate destination, per-destination `filtered_consent` rows, `filtered_no_destination` for zero-candidate events), with `Processor.earlyDestinationFilter` both on and off. Remaining `processor.go` hunks are formatting-only (argument wrapping from `make fmt`). ## 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.
🔒 Scanned for secrets using gitleaks 8.28.0
🔒 Scanned for secrets using gitleaks 8.28.0
…ession-counter' into pipeline-inspector/03-user-suppression-counter 🔒 Scanned for secrets using gitleaks 8.28.0
🤖 I have created a release *beep* *boop* --- ## [1.86.0-rc.1](v1.85.0...v1.86.0-rc.1) (2026-09-07) ### Features * backend config v2-to-v1 mapper ([#7315](#7315)) ([887f6d2](887f6d2)) * **core:** capture the final recorded error for failed rETL records ([#7295](#7295)) ([f4dc4d9](f4dc4d9)) * per-destination visibility at the destination-filter boundary ([#7283](#7283)) ([3d83f02](3d83f02)) * user_suppression counter via suppressed dummy jobs ([#7325](#7325)) ([77d3d37](77d3d37)) * **warehouse:** support jsonPaths for gcs datalake ([#7333](#7333)) ([e714140](e714140)) ### Bug Fixes * rsources failed-records pagination drops records across failed-key boundaries ([#7329](#7329)) ([0a50439](0a50439)) * **warehouse:** stop logging full schemas on table-level schema mismatch ([#7339](#7339)) ([f244c14](f244c14)) * **warehouse:** upgrade clickhouse v2 driver ([#7332](#7332)) ([e2c5cb9](e2c5cb9)) ### Miscellaneous * **ci:** remove unused Snyk policy file (SEC-409) ([#7317](#7317)) ([d60b3c6](d60b3c6)) * make reporting 413 handling unconditional ([#7313](#7313)) ([d2474e9](d2474e9)) * moving pyt contract tests ([#7327](#7327)) ([8316af2](8316af2)) * **processor:** pipeline attribution in processor stats ([#7326](#7326)) ([3e97f7c](3e97f7c)) * skip consent and connection-mode filtering for replays of non-existent connections ([#7323](#7323)) ([d2474e9](d2474e9)) --- 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>
🤖 I have created a release *beep* *boop* --- ## [1.86.0](v1.85.0...v1.86.0) (2026-09-07) ### Features * backend config v2-to-v1 mapper ([#7315](#7315)) ([887f6d2](887f6d2)) * **core:** capture the final recorded error for failed rETL records ([#7295](#7295)) ([f4dc4d9](f4dc4d9)) * per-destination visibility at the destination-filter boundary ([#7283](#7283)) ([3d83f02](3d83f02)) * user_suppression counter via suppressed dummy jobs ([#7325](#7325)) ([77d3d37](77d3d37)) * **warehouse:** support jsonPaths for gcs datalake ([#7333](#7333)) ([e714140](e714140)) ### Bug Fixes * rsources failed-records pagination drops records across failed-key boundaries ([#7329](#7329)) ([0a50439](0a50439)) * **warehouse:** stop logging full schemas on table-level schema mismatch ([#7339](#7339)) ([f244c14](f244c14)) * **warehouse:** upgrade clickhouse v2 driver ([#7332](#7332)) ([e2c5cb9](e2c5cb9)) ### Miscellaneous * **ci:** remove unused Snyk policy file (SEC-409) ([#7317](#7317)) ([d60b3c6](d60b3c6)) * make reporting 413 handling unconditional ([#7313](#7313)) ([d2474e9](d2474e9)) * moving pyt contract tests ([#7327](#7327)) ([8316af2](8316af2)) * **processor:** pipeline attribution in processor stats ([#7326](#7326)) ([3e97f7c](3e97f7c)) * skip consent and connection-mode filtering for replays of non-existent connections ([#7323](#7323)) ([d2474e9](d2474e9)) --- 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>
…cess stage (#7346) ## What Pure refactor, zero behavior change. Converts the eight side-PU status-details maps accumulated in the processor's preprocess loop (`statusDetailsMap`, `enricherStatusDetailsMap`, `botManagementStatusDetailsMap`, `eventBlockingStatusDetailsMap`, `userSuppressionStatusDetailsMap`, `dedupStatusDetailsMap`, `gatewayIngestedStatusDetailsMap`, `destFilterStatusDetailMap`) into `PUReportedMetric` rows at the end of `preprocessStage`, via a new `assembleSideStatusDetailMetrics` helper — instead of threading nine map fields (the eight maps + `connectionDetailsMap`) through `srcHydrationMessage` and `preTransformationMessage` and assembling them only at `pretransformStage`. - The assembly loop body, the `AssertKeysSubset` guards, and the per-key row-emission order are relocated verbatim. - The map fields are removed from `srcHydrationMessage` and `preTransformationMessage`; assembled rows ride the pre-existing `reportMetrics` field and the same `storeStage` transaction, behind the same `isReportingEnabled()` gate. - Row content (ConnectionDetails, PUDetails, StatusDetail, counts) is unchanged. The only observable difference is slice ordering within `reportMetrics` (side-PU rows now precede source-hydration failure rows); `Report` inserts rows independently and no production code is position-sensitive. The one consumer of insertion order was the `srchydration` integration test, which sorted by `MIN(id)` — updated to sort by the report key instead (insertion order across PUs was never part of the contract; same-stage rows already depended on Go map iteration order). ## Why Addresses the review discussion on #7325 ("why do we need to wait to reach the pretransform stage to fill reportMetrics for all these stages" / "it is weird having to carry over all these maps in the stage messages"). The maps are complete as soon as the preprocess loop finishes, so assembly can happen right there and the stage messages get 9 fields lighter. ## Tests - New `TestAssembleSideStatusDetailMetrics`: table-driven map→PU pairing check (guards against silently swapping the same-typed positional map args), plus an all-eight-maps case asserting exactly one row per PU and per-row `ConnectionDetails` copies. - New `TestSrcHydrationStage` subtest: hydration-failure rows are appended to a `reportMetrics` slice that now arrives non-empty (no clobbering/truncation), asserted as a multiset. - Full `go test ./processor/...` and the `srchydration` integration test pass; the `reporting_dropped_events` integration test (which asserts real `reports`-table rows for `gateway`, `gw_ingested`, `dedup`, `destination_filter`) passes unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01TrZn7jT7WtkTrujuMiU6d9
Description
Suppressed events currently vanish at the gateway with only a prometheus stat — no report row, so they are invisible in the funnel and every "missing events" question about a suppressed user is a support ticket. This PR makes suppressed internal-batch events countable as
user_suppression/filtered/298 rows, using the exact bot-blocking pattern: the gateway stores a dummy job that rides the normal gateway → jobsdb → processor path, and the processor reports and drops it in preprocess.Scope decisions:
getJobDataFromRequest) always drops suppressed events regardless of the flag, exactly as today — a fully-suppressed public request still short-circuits viaerrRequestSuppressed. OnlyextractJobsFromInternalBatchPayloadstores dummy jobs.Reportin the gateway — this works unchanged in GATEWAY-mode pods (the PROCESSOR pods own reporting), and no ingestion/succeeded counter is added (the existing GATEWAY PU stays the billing count).What changed
Gateway — new reloadable flag
Gateway.storeUserSuppressedEvents(defaultfalse), internal batch path only.messageId,type,event(name) andreceivedAt— no properties, traits, context, or identifiers beyond the jobsdb routing key. Suppressed users are typically GDPR-suppressed, so no user data may survive suppression (even a payload-marshal failure drops the event rather than keeping the original payload). The job carriesis_user_suppressed: truein its parameters and is excluded from live-event recording (skipLiveEventRecording, same as drop-mode bot events).is_user_suppressedandis_event_blockedare mutually exclusive — a suppressed event skips the event-blocking check.gateway.write_key_suppressed_events/write_key_suppressed_requestsstats keep incrementing everywhere.Processor — flag-independent (must be complete before the gateway flag is ever enabled).
At the very top of the preprocess loop — strictly before bot management, event blocking, dedup, and the GATEWAY billing metric — an event whose parameters carry
is_user_suppressed: trueemits exactly one report row and is unconditionally dropped (reporting on or off):reported_by(PU)user_suppression— standalone side PU,CreatePUDetails("", USER_SUPPRESSION, false, false)statefiltered(standard filter status, like dedup —reported_byis the discriminator)status_codeFilterEventCode)in_pu/terminal/initial""/false/falseThe drop point guarantees suppressed dummy events never enter dedup keys, event schemas, archival, live events, or the GATEWAY billing metric. The new
userSuppressionStatusDetailsMapis threaded through the stage messages exactly like the sibling bot/blocking/dedup maps, and the rows ride the existing storeStage reporting transaction.Linear Ticket
pipe-3287
Security