Repository navigation
feat: gateway_ingested counter for all events entering preprocess - #7328
Merged
mihir20 merged 13 commits intoSep 7, 2026
Conversation
This was referenced Sep 1, 2026
Contributor
Author
|
Stack (merge bottom-up)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pipeline-inspector/03-user-suppression-counter #7328 +/- ##
==================================================================================
+ Coverage 80.23% 80.28% +0.05%
==================================================================================
Files 611 611
Lines 68467 68492 +25
==================================================================================
+ Hits 54934 54990 +56
+ Misses 10302 10266 -36
- Partials 3231 3236 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… boundary Add classifyDestinations as the single classification site at fan-out, narrowing the candidate set to the RETL-stamped destination before classification, and emit per-candidate destination_enter succeeded/200 rows (Reporting.destinationEnterMetrics.enabled) plus per-destination filtered_integration/298 and filtered_consent/297 destination_filter rows (Reporting.perDestinationFilterMetrics.enabled), with a filtered_no_destination/298 carve-out for zero-candidate events. Processor.earlyDestinationFilter (default true) gates the reorder: when false the preprocess destination-filter guard is skipped so all events reach source hydration and tracking-plan validation, fan-out becomes the drop point, and the inPU chain labels are rewired to the new stage order (source_hydration=gateway, tracking_plan_validator=srchyd|gateway, user_transformer=destination_filter). The flag is snapshotted once per batch and threaded through the stage messages so one in-flight batch never observes mixed values. All flags are reloadable and default to byte-identical-to-today behavior. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
🔒 Scanned for secrets using gitleaks 8.28.0
🔒 Scanned for secrets using gitleaks 8.28.0
…ctions and update related logic 🔒 Scanned for secrets using gitleaks 8.28.0
🔒 Scanned for secrets using gitleaks 8.28.0
… destination classification 🔒 Scanned for secrets using gitleaks 8.28.0
- procRebuildStage: describe soft-deletion/disabled as the real config-drift case and the missing-destination drop as a defensive fallback (review r3878718615) - classifyDestinations: replace invented 'sibling destinations' term with an explanation in terms of RETL per-connection copies (review r3878840812), and retire the term from test names Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…es 298 Per review (r3829990734): the status string, not the status code, is the discriminator within the filtered_* family — filtered_integration, filtered_no_destination and the filtered rows of dedup already share FilterEventCode = 298, so a dedicated 297 for filtered_consent added no information (and collided with StatusMirrorFiltered = 297 in processor/internal/transformer). Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…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
mihir20
force-pushed
the
pipeline-inspector/03-user-suppression-counter
branch
from
September 1, 2026 10:35
544f5e0 to
262bba3
Compare
mihir20
force-pushed
the
pipeline-inspector/04-gateway-ingested-counter
branch
from
September 1, 2026 10:50
3675568 to
845292e
Compare
mihir20
force-pushed
the
pipeline-inspector/04-gateway-ingested-counter
branch
from
September 1, 2026 10:59
845292e to
a9e1b47
Compare
…process Adds a GATEWAY_INGESTED side PU (inPU empty, initial=false) emitted at the very top of the preprocess per-event loop, before the user-suppression, bot, event-blocking and dedup checks and the GATEWAY billing metric, so every iterated event is counted and the funnel's drop side-PUs subtract from it: gateway_ingested - (user_suppression + event_blocking + dedup + dropped bot_management) = gateway. Gated by the new reloadable flag Reporting.gatewayIngestedMetrics.enabled (default false); with it off, report output is unchanged. The GATEWAY billing rows stay byte-identical. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
mihir20
force-pushed
the
pipeline-inspector/04-gateway-ingested-counter
branch
from
September 1, 2026 11:38
a9e1b47 to
24423e1
Compare
…ession-counter' into pipeline-inspector/04-gateway-ingested-counter # Conflicts: # processor/processor.go # processor/processor_test.go # processor/src_hydration_stage.go 🔒 Scanned for secrets using gitleaks 8.28.0
mihir20
force-pushed
the
pipeline-inspector/03-user-suppression-counter
branch
from
September 2, 2026 07:27
891feb3 to
2ce9f18
Compare
itsmihir
reviewed
Sep 4, 2026
| @@ -2452,6 +2480,14 @@ func (proc *Handle) pretransformStage(partition string, preTrans *preTransformat | |||
| }) | |||
| } | |||
|
|
|||
Contributor
There was a problem hiding this comment.
[nit] Can we move this collection before the BOT_MANAGEMENT stage collection around line 2450? It would improve readability and follow the same semantic order.
atzoum
approved these changes
Sep 4, 2026
| USER_SUPPRESSION = "user_suppression" | ||
| DEDUP = "dedup" | ||
| GATEWAY = "gateway" | ||
| GATEWAY_INGESTED = "gateway_ingested" |
Contributor
There was a problem hiding this comment.
In postgres each character counts
Suggested change
| GATEWAY_INGESTED = "gateway_ingested" | |
| GATEWAY_INGESTED = "gw_ingested" |
| eventBlockingStatusDetailsMap map[string]map[string]*reportingtypes.StatusDetail | ||
| userSuppressionStatusDetailsMap map[string]map[string]*reportingtypes.StatusDetail | ||
| dedupStatusDetailsMap map[string]map[string]*reportingtypes.StatusDetail | ||
| gatewayIngestedStatusDetailsMap map[string]map[string]*reportingtypes.StatusDetail |
Contributor
There was a problem hiding this comment.
yet-another status detail map...
| proc.config.userTransformationMirroringBlockedIDs = proc.conf.GetReloadableStringSliceVar(nil, "Processor.userTransformationMirroring.blockedTransformationIDs") | ||
| proc.config.storeSamplerEnabled = proc.conf.GetReloadableBoolVar(false, "Processor.storeSamplerEnabled") | ||
| proc.config.reportingDedupMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.dedupMetrics.enabled") | ||
| proc.config.reportingGatewayIngestedMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.gatewayIngestedMetrics.enabled") |
Contributor
There was a problem hiding this comment.
Suggested change
| proc.config.reportingGatewayIngestedMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.gatewayIngestedMetrics.enabled") | |
| proc.config.reportingGatewayIngestedMetricsEnabled = proc.conf.GetReloadableBoolVar(false, "Reporting.gatewayIngestedMetricsEnabled") |
itsmihir
approved these changes
Sep 4, 2026
mihir20
merged commit Sep 7, 2026
679ba61
into
pipeline-inspector/03-user-suppression-counter
113 of 116 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
gateway_ingestedreporting 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
GATEWAY_INGESTEDPU (utils/types/reporting_types.go): reported as a standalone side PU (inPU: "", not part of the terminal/initial PU chain), so the existinggatewaybilling row and PU chains are untouched.processor/processor.go): inpreprocessStage, before any drop decision is made, every event is recorded into a newgatewayIngestedStatusDetailsMapas asucceededrow withStatusCode: 200. The shared reporting event's status code is reset to 0 right after, so thegatewaybilling row keeps itsStatusCode: 0as before. The map is threaded throughpreTransformationMessage→srcHydrationMessage→pretransformStage, where rows are flushed intoreportMetricsalongside the other drop-metric maps (with the usualAssertKeysSubsetguard).Reporting.gatewayIngestedMetrics.enabled(default false) and requires reporting to be enabled. With the flag off, report metrics are identical to before.Semantics
gateway_ingestedrow aggregates events with the same source/name/type; rows split by event type.gateway_ingestedandgateway.Tests
processor/processor_test.go— newTestGatewayIngestedReportingcovering flag on/off, reporting disabled, mixed batches with drops, all-dropped batches, aggregation/splitting by event type, billing-rowStatusCodeunaffected, 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_enterrows per candidate destination, per-destinationfiltered_consentrows,filtered_no_destinationfor zero-candidate events), withProcessor.earlyDestinationFilterboth on and off.Remaining
processor.gohunks are formatting-only (argument wrapping frommake fmt).Security