Skip to content

fix: avoid redundant transformer statTags unmarshalling - #7182

Merged
achettyiitr merged 5 commits into
masterfrom
harness/PIPE-3182-fix-avoid-redundant-transformer-03591361
Jul 17, 2026
Merged

achettyiitr merged 5 commits into
masterfrom
harness/PIPE-3182-fix-avoid-redundant-transformer-03591361

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Eliminate redundant JSON unmarshalling for integration.failure_detailed metrics on transformer hot paths.

Summary

  • Add a parsed-tag helper for integration.failure_detailed metric emission.
  • Emit transformer failure detail metrics from already unmarshalled processor/router response structs.
  • Remove the raw array statTags helper and keep the proxy-only single-object raw helper with documentation.
  • Add tests for helper emission and router batch/routerTransform statTags handling.

Validation

  • go test /workspace/rudder-server/processor/integrations /workspace/rudder-server/processor/internal/transformer/destination_transformer /workspace/rudder-server/processor/internal/transformer/user_transformer /workspace/rudder-server/processor/internal/transformer/trackingplan_validation /workspace/rudder-server/router/transformer
  • go test -count=1 /workspace/rudder-server/processor/integrations /workspace/rudder-server/router/transformer
  • rg "CollectIntgTransformErrorStats|CollectDestErrorStats|CollectIntegrationFailureDetailedStats|integration.failure_detailed" processor router confirmed CollectIntgTransformErrorStats has no remaining usages and CollectDestErrorStats is only used by the documented proxy path.

Linear Ticket

PIPE-3182

Security

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

@rudder-devbox

rudder-devbox Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from a Linear ticket.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@codecov

codecov Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.07%. Comparing base (3f9aa32) to head (1482543).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7182      +/-   ##
==========================================
+ Coverage   79.63%   80.07%   +0.44%     
==========================================
  Files         595      595              
  Lines       66155    66151       -4     
==========================================
+ Hits        52683    52971     +288     
+ Misses      10356    10041     -315     
- Partials     3116     3139      +23     

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

🔒 Scanned for secrets using gitleaks 8.29.1
@rudder-devbox

rudder-devbox Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

I checked the downloaded failed-job logs and did not find a source failure in this PR to patch.

The package-unit failure is from external CI conditions:

  • warehouse/integrations/tunnelling TestConnect failed at connect_test.go:41 with toomanyrequests: retry-after: 586.45µs, allowed: 44000/minute, then panicked during Docker resource cleanup. That is a rate-limit/infrastructure failure, not a transformer/statTags regression.
  • integration_test/bqstreamallevents TestBQStreamAllEvents/schema_modified_after_stream_writer_creation_(table_deleted) repeatedly logged BigQuery NotFound errors for the deleted/re-created tracks table stream and ended with Condition never satisfied while waiting for batch router count 15, expected: 20.

The branch is current with the remote PR branch and the working tree is clean. I did not push a commit because fixing this would require changing unrelated external-service tests or weakening assertions, which would be a symptom-only patch rather than a fix for the PR.

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr marked this pull request as ready for review July 17, 2026 08:16
@rudder-devbox

rudder-devbox Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

I fixed the actionable CI failure and pushed it.

The suppression-backup-service log showed TestMain/full_export_e-2-e_test failing at suppression-backup-service/cmd/main_test.go:54 with panic during restore: runtime error: makeslice: len out of range, followed by Condition never satisfied at line 105. The test was asserting inside a polling loop and trying to restore early /full-export responses before confirming they were successful, restorable backup payloads.

I changed the test to treat non-200 or not-yet-restorable backup responses as retryable during polling, and to pass only once the returned backup restores and contains the expected suppression record. Validation passed with go test ./suppression-backup-service/....

The other failed package-unit log is still the external BigQuery bqstreamallevents test: it repeatedly reports BigQuery NotFound for the deleted/re-created tracks stream and times out waiting for batch router count 15, expected: 20. I did not patch that unrelated external-service failure.

Commit: 1f04b16

@rudder-devbox

rudder-devbox Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

I fixed the CI failure and pushed the change.

The pytransformer contract log showed TestPyTransformerTestEndpoints/test_endpoint/should_run_inline_code_and_return_transformed_events_with_logs failing because the rudder-pytransformer container crashed during startup. The concrete log signal was FastAPI startup failing in prometheus_client.start_http_server(metrics_port) with OSError: [Errno 98] Address already in use, followed by the health-check failure at integration_test/pytransformer_contract/bc_helpers_test.go:578.

The root cause was a host-networking port race in the non-metrics pytransformer helper: it picked a free host port for METRICS_PORT, but another process could bind it before the container started. Since this helper does not scrape metrics, I changed it to pass METRICS_PORT=0 on Linux so the OS chooses an unused metrics port inside the shared host namespace.

Validation: go test ./integration_test/pytransformer_contract -run '^$' passed.

Commit: 1482543

@achettyiitr
achettyiitr merged commit c3c283c into master Jul 17, 2026
74 checks passed
@achettyiitr
achettyiitr deleted the harness/PIPE-3182-fix-avoid-redundant-transformer-03591361 branch July 17, 2026 10:42
sivaprasath550 added a commit to sivaprasath550/rudder-server that referenced this pull request Jul 17, 2026
fix: avoid redundant transformer statTags unmarshalling (rudderlabs#7182)
This was referenced Jul 20, 2026
mihir20 pushed a commit that referenced this pull request Jul 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.81.0-rc.1](v1.80.0...v1.81.0-rc.1)
(2026-07-20)


### Features

* run python transformation tests on ephemeral per-request pyt
deployments
([#7177](#7177))
([1008ae7](1008ae7))
* support partition migration job fanout per jobsdb
([#7141](#7141))
([be42e48](be42e48))


### Bug Fixes

* abort snowpipe events on channel bad request
([#7118](#7118))
([6c08584](6c08584))
* avoid redundant transformer statTags unmarshalling
([#7182](#7182))
([c3c283c](c3c283c))
* classify reverse-ETL sources from config for MAR metering
([#7159](#7159))
([fa7870f](fa7870f))
* detect server-side snowpipe channel failures via per-channel status at
stuck threshold
([#7166](#7166))
([581410c](581410c))
* kafkamanager compilation error
([#7189](#7189))
([1fb7f6e](1fb7f6e))
* **kafka:** support insecure TLS skip verify config
([#7022](#7022))
([d01574f](d01574f))
* preserve order when overflowing snowpipe insert batches
([#7178](#7178))
([9c01fa0](9c01fa0))
* quote postgres warehouse ddl identifiers
([#7127](#7127))
([5aeb481](5aeb481))
* **router:** emit invalid payload metric
([#7168](#7168))
([6e2009a](6e2009a))
* update null to #N/A for salesforce bulk upload
([#7151](#7151))
([1dffd93](1dffd93))
* **warehouse:** use pod identity for rudder-storage flow; keep S3-copy
user fallback for user S3 destinations
([#7167](#7167))
([3f9aa32](3f9aa32))


### Miscellaneous

* add contract tests for test endpoints in pytransformer
([#7147](#7147))
([3b210ec](3b210ec))
* bump compose-test to v0.1.5 to remediate pgx CVE-2026-33815
([#7162](#7162))
([7672f96](7672f96))
* **deps:** bump actions/checkout from 6.0.3 to 7.0.0
([#7132](#7132))
([d453c93](d453c93))
* **deps:** bump actions/setup-go from 6.4.0 to 6.5.0
([#7150](#7150))
([75d9648](75d9648))
* **deps:** bump aws-actions/amazon-ecr-login from 2.1.5 to 2.1.6
([#7109](#7109))
([7b2a859](7b2a859))
* **deps:** bump aws-actions/configure-aws-credentials from 6.2.0 to
6.2.2 ([#7152](#7152))
([c984268](c984268))
* **deps:** bump golangci/golangci-lint-action from 9.2.1 to 9.3.0
([#7170](#7170))
([4565d25](4565d25))
* **deps:** bump the frequent group across 1 directory with 4 updates
([#6891](#6891))
([88a0ddf](88a0ddf))
* support compression in bqstream destinations
([#7142](#7142))
([0694f12](0694f12))

---
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>
mihir20 pushed a commit that referenced this pull request Jul 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.81.0](v1.80.0...v1.81.0)
(2026-07-20)


### Features

* run python transformation tests on ephemeral per-request pyt
deployments
([#7177](#7177))
([1008ae7](1008ae7))
* support partition migration job fanout per jobsdb
([#7141](#7141))
([be42e48](be42e48))


### Bug Fixes

* abort snowpipe events on channel bad request
([#7118](#7118))
([6c08584](6c08584))
* avoid redundant transformer statTags unmarshalling
([#7182](#7182))
([c3c283c](c3c283c))
* classify reverse-ETL sources from config for MAR metering
([#7159](#7159))
([fa7870f](fa7870f))
* detect server-side snowpipe channel failures via per-channel status at
stuck threshold
([#7166](#7166))
([581410c](581410c))
* kafkamanager compilation error
([#7189](#7189))
([1fb7f6e](1fb7f6e))
* **kafka:** support insecure TLS skip verify config
([#7022](#7022))
([d01574f](d01574f))
* preserve order when overflowing snowpipe insert batches
([#7178](#7178))
([9c01fa0](9c01fa0))
* quote postgres warehouse ddl identifiers
([#7127](#7127))
([5aeb481](5aeb481))
* **router:** emit invalid payload metric
([#7168](#7168))
([6e2009a](6e2009a))
* update null to #N/A for salesforce bulk upload
([#7151](#7151))
([1dffd93](1dffd93))
* **warehouse:** use pod identity for rudder-storage flow; keep S3-copy
user fallback for user S3 destinations
([#7167](#7167))
([3f9aa32](3f9aa32))


### Miscellaneous

* add contract tests for test endpoints in pytransformer
([#7147](#7147))
([3b210ec](3b210ec))
* bump compose-test to v0.1.5 to remediate pgx CVE-2026-33815
([#7162](#7162))
([7672f96](7672f96))
* **deps:** bump actions/checkout from 6.0.3 to 7.0.0
([#7132](#7132))
([d453c93](d453c93))
* **deps:** bump actions/setup-go from 6.4.0 to 6.5.0
([#7150](#7150))
([75d9648](75d9648))
* **deps:** bump aws-actions/amazon-ecr-login from 2.1.5 to 2.1.6
([#7109](#7109))
([7b2a859](7b2a859))
* **deps:** bump aws-actions/configure-aws-credentials from 6.2.0 to
6.2.2 ([#7152](#7152))
([c984268](c984268))
* **deps:** bump golangci/golangci-lint-action from 9.2.1 to 9.3.0
([#7170](#7170))
([4565d25](4565d25))
* **deps:** bump the frequent group across 1 directory with 4 updates
([#6891](#6891))
([88a0ddf](88a0ddf))
* support compression in bqstream destinations
([#7142](#7142))
([0694f12](0694f12))

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

4 participants