Skip to content

feat(router): read transformerProxy from transformer features before env - #7337

Merged
shekhar-rudder merged 5 commits into
masterfrom
feature/int-6881-proxy-from-features
Sep 9, 2026
Merged

shekhar-rudder merged 5 commits into
masterfrom
feature/int-6881-proxy-from-features

Conversation

@shekhar-rudder

@shekhar-rudder shekhar-rudder commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

What

The router now asks the transformer whether a destination is generally available for proxy delivery, and only consults Router.<DEST>.transformerProxy when the transformer has not declared it.

func (rt *Handle) transformerProxyEnabled() bool {
	if rt.transformerProxyGA.Load() {
		return true
	}
	return rt.reloadableConfig.transformerProxy.Load()
}

Pairs with rudderlabs/rudder-transformer#5546, which publishes the transformerProxy capability map on /features. Either side can merge first.

Behaviour change

None today. Every destination the transformer declares already has the env set to true, so the result is identical. Version skew is safe in both directions: an older transformer omits the map, gjson returns false, and the env decides exactly as before; an older rudder-server never reads the map.

The change lands when the env entries are deleted from operator/devops in a follow-up and delivery keeps working.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.75862% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.30%. Comparing base (887f6d2) to head (d591c1e).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
services/transformer/features_impl.go 89.83% 4 Missing and 2 partials ⚠️
testhelper/transformertest/builder.go 28.57% 4 Missing and 1 partial ⚠️
app/apphandlers/embeddedAppHandler.go 0.00% 1 Missing and 1 partial ⚠️
app/apphandlers/processorAppHandler.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7337      +/-   ##
==========================================
+ Coverage   79.88%   80.30%   +0.42%     
==========================================
  Files         612      615       +3     
  Lines       68673    69144     +471     
==========================================
+ Hits        54856    55528     +672     
+ Misses      10599    10350     -249     
- Partials     3218     3266      +48     

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

@shekhar-rudder
shekhar-rudder marked this pull request as ready for review September 2, 2026 15:39
The router decided proxy delivery solely from Router.<DEST>.transformerProxy,
an env key populated from serverConfigOverride across 29 hand-maintained YAML
files in rudderstack-operator and rudder-devops. Nothing tied it to the
transformer image that implements the proxy handler, so the two drifted per
environment — including 8 destinations enabled only in MT-US and two keys
mis-indented under `throttler:` that rudder-server never reads at all.

The transformer now publishes a transformerProxy capability map on /features.
transformerProxyEnabled treats it as authoritative: a destination the
transformer declares is proxied without the env being consulted. The env stays
the enablement path for everything not declared — destinations still rolling
out, and those with no proxy handler of their own (delivered by the generic
handler), which can never appear in the capability map.

It is an OR rather than an override because getRouterConfigKeys resolves
Router.<DEST>.transformerProxy then Router.transformerProxy, and that second
key is set to false in the operator base values.yaml. It is therefore always
present for every destination, so any "env wins when set" scheme would have
that global false silently beat the capability fleet-wide.

The features service is read on each call rather than cached, matching how
RouterTransform, Regulations, TransformerProxyVersion and
SourceTransformerVersion are all consumed. That keeps it live: upgrading the
transformer to an image which newly declares a destination takes effect on the
next features poll rather than at the next rudder-server restart, which
matters because the two services deploy independently. On a representative
4.3KB payload a gjson lookup is 823ns, a few microseconds per job on a path
dominated by a network round trip.

All five reads on the delivery path go through the accessor, as does
newBarrierFn's metadata read.

No behaviour change today: every destination the transformer declares already
has the env set to true. Version skew is safe both ways — an older transformer
omits the map and the env decides exactly as before, and an older
rudder-server never reads it.

createTestWorker gets the noop features service; it declares nothing, so
Router.<DEST>.transformerProxy keeps deciding there.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01HbD4xkXp922cKx6zAVQnbg
@shekhar-rudder
shekhar-rudder force-pushed the feature/int-6881-proxy-from-features branch from 916a91d to 7040998 Compare September 2, 2026 15:41
Comment thread router/handle.go Outdated
// The transformer's own declaration wins: a destination it declares is proxied without consulting
// the environment at all. Router.<DEST>.transformerProxy remains the enablement path for every
// destination the transformer has not declared — those still rolling out, and those with no proxy
// handler of their own, which are delivered by the generic handler and so can never appear in the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the one via generic handler also need to be advertised via transformer capability rather than environment variable

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the comment

@krishna2020
krishna2020 requested a review from atzoum September 3, 2026 07:06
…Enabled

The comment explained which destinations can appear in the transformer's
capability map in terms of whether they have a proxy handler of their own
or fall back to the generic handler. That is transformer-side detail, and
it is not something rudder-server knows or should encode: all it consumes
is the value /features returns for this destination type.

Leaves the two things that are server-side semantics — that the
declaration takes precedence over Router.<DEST>.transformerProxy, and why
this reads the features service per call instead of caching.

Comment only, no behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011yjk6jXLM3R7uLNr8fLV6p

@atzoum atzoum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The features service design has quite a few weaknesses, and this is a good opportunity to fix most of them:

  • Features caching: parse /features once into an immutable snapshot behind an atomic.Pointer and swap only when the body differs (bytes.Equal is enough). This will fix the current race on t.features and, more importantly, will take gjson out of the hot path.

  • Fix the SourceTransformerVersion/isInitialized inconsistency on the first poll by introducing an internal method. Right now the deprecation check in makeFeaturesFetchCall is a no-op, since waitChan closes only after it returns: the panic fires one poll interval late, after Wait() has already released the gateway, router and processor.

  • makeFeaturesFetchCall should return an error, not a bool.

  • Non-200/404 responses shouldn't be treated as success. Today a transformer 500
    closes waitChan and the server proceeds on the hardcoded defaults believing
    features were fetched.

  • defaultTransformerFeatures should not be invalid JSON as it is now (trailing
    comma). Let's add a test to guard it.

- parse /features once into an immutable snapshot behind an
  atomic.Pointer, swapping only when the body differs; removes the data
  race on the features field and takes gjson out of the hot path
- run the v0 deprecation check against every fetched snapshot before it
  is published and before Wait() releases, so a deprecated transformer
  panics on the first poll instead of one interval late
- makeFeaturesFetchCall returns an error instead of a retry bool
- treat any non-200 response (404 included) as a failure so the server
  no longer proceeds on defaults believing features were fetched
- define defaultTransformerFeatures as a typed struct literal instead of
  a JSON string, making an invalid default impossible
- extract retry handling into fetchWithRetries to simplify the sync loop

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GHw4awCvKV77ZFbkGLjAqa
golangci-lint forbids encoding/json.Unmarshal in favour of jsonrs.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KztEWQc216jBXVz8VJR65V
Comment thread services/transformer/features_impl.go Resolved
Comment thread services/transformer/features_impl.go Resolved
Comment thread services/transformer/features_impl.go Resolved
Comment thread services/transformer/features_impl.go Resolved
Comment thread services/transformer/features_impl.go Resolved
- SourceTransformerVersion: drop the isInitialized() guard; the default
  snapshot already advertises v2, so the guard was redundant. The helper
  itself goes with it, as it had no other production caller.
- Restore HTTP 404 handling: transformer images without a /features
  endpoint serve the hardcoded defaults and the fetch counts as
  successful, as before.
- fetchWithRetries: use cenkalti/backoff with an exponential backoff
  capped at the poll interval, retrying perpetually until ctx is
  cancelled. FeaturesRetryMaxAttempts is now unused and removed.
- syncTransformerFeatureJson: close waitChan when the context is
  cancelled before the first successful fetch, so a shutdown mid-
  initialisation doesn't leave Wait() callers blocked forever.
- makeFeaturesFetchCall: take a context and honour it on the request.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01UyJk2fpVz3vNpWR5cHR1d7
Comment thread services/transformer/features_impl.go Resolved
@shekhar-rudder
shekhar-rudder merged commit e8f0ea6 into master Sep 9, 2026
114 of 117 checks passed
@shekhar-rudder
shekhar-rudder deleted the feature/int-6881-proxy-from-features branch September 9, 2026 08:37
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.1](v1.86.0...v1.87.0-rc.1)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
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>
This was referenced Sep 14, 2026
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.2](v1.86.0...v1.87.0-rc.2)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
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>
This was referenced Sep 14, 2026
atzoum pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.3](v1.86.0...v1.87.0-rc.3)
(2026-09-14)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

---
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>
This was referenced Sep 15, 2026
atzoum pushed a commit that referenced this pull request Sep 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.87.0-rc.4](v1.86.0...v1.87.0-rc.4)
(2026-09-15)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **batchrouter:** retry failed async manager initialization
([#7374](#7374))
([974d383](974d383))
* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* singer-protocol sources filtered destination config for source type
cloud instead of cloudSource
([#7389](#7389))
([f48c997](f48c997))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

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


##
[1.87.0](v1.86.0...v1.87.0)
(2026-09-15)


### Features

* backend config shadow mode
([#7340](#7340))
([4898165](4898165))
* bump rudder-go-kit and go modules to Go 1.27.1
([#7345](#7345))
([8d95c68](8d95c68))
* **router:** read transformerProxy from transformer features before env
([#7337](#7337))
([e8f0ea6](e8f0ea6))


### Bug Fixes

* **batchrouter:** retry failed async manager initialization
([#7374](#7374))
([974d383](974d383))
* **router:** redact credentials from destination URLs in failure
responses
([#7372](#7372))
([14659bf](14659bf))
* **router:** request fails with unexpected use of stub RoundTripper
error ([#7386](#7386))
([2ff491f](2ff491f))
* singer-protocol sources filtered destination config for source type
cloud instead of cloudSource
([#7389](#7389))
([f48c997](f48c997))
* **warehouse:** instrument the clickhouse v2 load path
([#7355](#7355))
([4d743db](4d743db))
* **warehouse:** pass temporary credentials to the clickhouse v2 s3 copy
engine
([#7353](#7353))
([4d743db](4d743db))
* **warehouse:** retire idle clickhouse v2 connections
([#7352](#7352))
([4d743db](4d743db))
* **warehouse:** retry a failed clickhouse v2 block
([#7354](#7354))
([4d743db](4d743db))


### Miscellaneous

* log the candidate error when a backend config shadow sample fails to
fetch ([#7383](#7383))
([eaa9b61](eaa9b61))
* **processor:** assemble side-PU report metrics at end of preprocess
stage ([#7346](#7346))
([4540876](4540876))
* sync release v1.86.0 to main branch
([#7356](#7356))
([6868c6c](6868c6c))

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