Repository navigation
Conversation
|
👋 I'm rudder-devbox. I opened this PR from a Linear ticket. Mention |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7293 +/- ##
==========================================
- Coverage 79.71% 79.68% -0.04%
==========================================
Files 601 601
Lines 67219 67308 +89
==========================================
+ Hits 53586 53636 +50
- Misses 10472 10515 +43
+ Partials 3161 3157 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…elpers - splitOnTooLarge -> failFastOnTooLarge: the client only stops retrying on 413, it does not split anything itself - SendWithoutPayloadTooLargeSplit -> SendWithRetryOnTooLarge - Reporting.splitOnPayloadTooLarge.enabled -> Reporting.payloadTooLargeHandling.enabled - move split helpers from payload_too_large.go into reporting.go / error_reporting.go / utils.go and split the tests to match - flusher/payload_too_large_test.go -> flusher/flusher_test.go Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
|
Fixed the CI failure and pushed the commit. Root cause from the failed I applied that formatter-required import grouping in Commit: 24b9daf |
|
Knowledge distillation completed |
…rden split tests - when a 413'd metric/batch has a single item, go straight to the stripped fallback (metrics) or SendWithRetryOnTooLarge (flusher) instead of resending the identical payload first - extract sendStrippedStatusDetail / sendStrippedErrorDetail helpers; drop the unreachable nil-statusDetail branch from metricWithSingleStatusDetail - replace sampleEventNotAvailableForPayloadTooLarge() with a package var - tests: partial-failure, non-mutation, single-item short-circuit and ED non-413 cases; add sampling-disabled size-guard tests (currently failing: guard sits below the sampling-disabled early return in getSampleWithEventSamplingCore) Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…pling The maxSampleEventSizeBytes check sat below the event-sampling early return, so with sampling disabled (the default) oversized sample events were never dropped. Hoist it to the top of getSampleWithEventSamplingCore so oversized samples are dropped before the sampler is consulted. Tests: cover both disjuncts of the sampling-disabled early return, assert sampleResponse is cleared, pin that oversized samples never hit the sampler, and add an at-limit boundary case. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
|
I could not make a code fix for this CI failure because the logs show an infrastructure/rate-limit failure outside this PR's reporting changes. Root cause from the failed I left the repository unchanged; there is no source-level failure here to patch from the workspace. |
- reporting_payload_too_large_split / error_detail_reporting_payload_too_large_split / reporting_flusher_payload_too_large_split: batch rejected with 413 and split - reporting_sample_event_replaced_too_large / error_detail_reporting_sample_event_replaced_too_large: sample event replaced by placeholder in the stripped fallback - reporting_sample_event_dropped_oversized / error_detail_reporting_sample_event_dropped_oversized: sample event dropped by maxSampleEventSizeBytes before reaching the sampler - reporting_client_http_request_payload_bytes: histogram of uncompressed payload size per send, with byte buckets registered in runner/buckets.go Split helpers become reporter methods so they can reach the client and stats; tests assert the new counters via memstats. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…lit tests The payload-size histogram called getTags() before the reporting URL was validated; getTags dereferenced the result of url.Parse without checking the error, so a malformed REPORTING_URL panicked instead of returning an error. Check the parse error and record the histogram after URL validation. Tests: cover the rejected-item strip (not item 0), non-413 batch errors returned without splitting, flusher in-loop 413 fallback and per-item abort, client fail-fast scoped to 413 only, and the malformed-URL path. Test reporters now set log/stats fields so future method changes don't nil-deref; test tags use a fresh map per call. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
Flusher batch items are opaque and cannot be shrunk, so a fail-fast Send followed by SendWithRetryOnTooLarge on the same bytes was one wasted request per item. Send each item with SendWithRetryOnTooLarge directly; this also makes the single-item short-circuit redundant. Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
|
Fixed the lint failure on the PR branch. Root cause from the failed The branch now removes that always-constant parameter by replacing the helper with Commit: 6e06136 |
…yload Unify naming around "large payload" / "large sample event" instead of "payload too large" across reporters, flusher, client and tests. - sendMetricWithPayloadTooLargeSplit -> sendMetricWithLargePayloadHandler (and ED/flusher equivalents) - SendWithRetryOnTooLarge -> SendWithoutFailFast - Stat consts gain Counter suffix: *LargePayloadSplitCounter, *LargeSampleEventReplacedCounter, *OversizedSampleEventDroppedCounter - Metric names: *_payload_too_large_split -> *_large_payload_split, *_sample_event_replaced_too_large -> *_large_sample_event_replaced, *_sample_event_dropped_oversized -> *_oversized_sample_event_dropped - Config key: Reporting.payloadTooLargeHandling.enabled -> Reporting.largePayloadHandling.enabled - Test helpers: *PayloadTooLarge* -> *LargePayload* Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…EventDroppedCounter Co-Authored-By: Claude Fable 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
…mple-event metric - sendMetricWithLargePayloadHandler/sendEDMetricWithLargePayloadHandler/ sendBatchWithLargePayloadHandler -> sendMetric/sendEDMetric/sendBatch - Merge the write-time-guard and 413-placeholder-replace counters into one metric per reporter (reporting_oversized_sample_event_skipped / error_detail_reporting_oversized_sample_event_skipped), distinguished by a "stage" tag (sampler | client) plus sourceId/destinationId - Drop the generic reporter-level tags (workspaceId, instanceId, clientName) that were leaking into the client-stage stat via a tag-merge helper; that helper (withStage) is removed now that it has no callers - Remove the now-unused tags parameter threaded through sendMetric/sendStrippedStatusDetail and sendEDMetric/sendStrippedErrorDetail Co-Authored-By: Claude Sonnet 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
|
Fixed the CI failures and pushed the commit. Root cause from the logs:
I applied the formatter-required signatures and removed the redundant test conversions. Validation passed for:
Commit: 8454e74 |
|
Knowledge distillation completed |
send() called NewTaggedStat on every request for the five stats whose tags never change per client (module/instanceId/endpoint/path). Create them once in New() and reuse the Measurement instead. StatHttpRequest keeps its per-request NewTaggedStat since it also carries a response-status tag. Co-Authored-By: Claude Sonnet 5 <[email protected]> 🔒 Scanned for secrets using gitleaks 8.28.0
🤖 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>
🤖 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>
Description
The reporting service rejects oversized payloads with HTTP 413. Previously the client retried a 413 like any other non-2xx until the backoff budget was exhausted, the reporting window was not deleted, and the same payload was replayed on the next loop — so one oversized payload wedged the reporter.
This PR makes 413 recoverable, behind a per-reporter feature flag, and adds a write-time size guard for sample events.
Behaviour
client.Sendnow unconditionally fails fast on a 413: it returns the sentinelclient.ErrPayloadTooLargeimmediately instead of retrying via backoff.client.SendWithoutFailFastkeeps the old behaviour — a 413 is retried like any other non-2xx response.Each of the three callers gates its own split-and-retry behaviour behind its own reloadable flag (
requestEntityTooLargeHandling, config keys below). When the flag is off, the caller callsSendWithoutFailFastdirectly and the send path is byte-identical to master. When on:DefaultReporter.sendMetric(enterprise/reporting/reporting.go): callsSend; onErrPayloadTooLarge, splits the metric into one request perStatusDetail.ErrorDetailReporter.sendEDMetric(enterprise/reporting/error_reporting.go): same split, one request perEDErrorDetails.Flusher.sendBatch(enterprise/reporting/flusher/flusher.go, tracked users / activation records): one request per batch item. Flusher items are opaque JSON and cannot be shrunk, so each split item is sent withSendWithoutFailFastdirectly — there is no strip fallback for this path.sendStrippedStatusDetail/sendStrippedErrorDetail): an individual item that still 413s is resent withSampleEventreplaced by{"sample_event_not_available":"entity too large"}viaSendWithoutFailFast.SampleResponseis kept. A single-item payload goes straight to this fallback since there is nothing to split.Write-time size guard (not flag-gated)
A per-reporter
maxSampleEventSizeBytes(reloadable): ingetSampleWithEventSamplingCore, a sample event larger than this is dropped (isOversized=true, sample event/response cleared) before the event sampler is consulted and before the row is written, regardless of whether event sampling is enabled or the flag above is set.Config
Reporting.requestEntityTooLargeHandlingfalseReporting.errorReporting.requestEntityTooLargeHandling(falls back to the key above)falseReporting.flusher.requestEntityTooLargeHandling(falls back to the key above)falseReporting.maxSampleEventSizeBytes83886080(80 MB)Reporting.errorReporting.maxSampleEventSizeBytes(falls back to the key above)52428800(50 MB)Reporting.httpClient.backoff.maxRetries(pre-existing, now load-bearing)Note: the error-detail reporter's write-time guard defaults to 50 MB, lower than the metrics reporter's 80 MB — intentional, not a leftover.
Metrics
One merged counter per reporter tracks every place a sample event is skipped, distinguished by a
stagetag:reporting_oversized_sample_event_skippedstage(sampler|client),sourceId,destinationIdDefaultReporter:sampler= dropped by the write-time guard;client= replaced by the placeholder in the strip fallback after a 413error_detail_reporting_oversized_sample_event_skippedErrorDetailReporterequivalentreporting_client_http_request_payload_bytesrunner/buckets.goworkspaceIdis deliberately excluded from the skipped-counter tags to keep cardinality bounded tosourceId/destinationId. There is no separate "split" counter — a 413-triggered split is visible via the genericreporting_client_http_request{status="413",...}stat already emitted by the client.Performance
client.Clientnow pre-creates its five fixed-tag stats (StatRequestPayloadBytes,StatRequestLatency,StatRequestTotalBytes,StatRequestCompressedBytes,StatTotalDurationsSeconds) once inNew()instead of callingNewTaggedStaton everysend()call — their tags (module/instanceId/endpoint/path) never change for a given client instance.StatHttpRequeststill creates its stat per-request since it carries a response-status tag that does vary.Known limitations / follow-ups
SampleResponseis not stripped in the fallback. A payload whose bulk is inSampleResponsewill still 413 after stripping and will be retried with the normal backoff budget; the window is not deleted and is replayed next loop (same as master today for any persistent 413)."partial failure returns error after delivering earlier metrics"in the tests, as a known, accepted trade-off against the old wedge-forever behaviour). For/metricsthe service already receives multiple documents with identicalReportMetadatatoday (groups larger thanmaxReportsCountInARequest), so merge semantics are established; for/recordErrorsthis PR is the first to send N documents sharing a group key — please confirm the service mergeserrors[]rather than upserting.EDMetric.Errorsis not capped bymaxReportsCountInARequest, so the error-detail split can fan out to many sequential requests inside one goroutine.ErrPayloadTooLarge, so the server's stated limit is not logged on the handled path.Linear Ticket
https://linear.app/rudderstack/issue/PIPE-3305
Security