Repository navigation
Internal - Remove agent.internal.transactionSettings config - #688
cleverchuk wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A reload between configuration reads can leave both rule sets null and cache an incomplete sampling configuration; both properties must be read from the same captured container.
1 open issue
What changed in this PR
Centralizes transaction-rule precedence in SamplingConfigProvider, removing the synthetic internal configuration key from the standard and Lambda agent loaders.
Changes:
- Moves precedence resolution and its warning into sampling configuration construction.
- Renames the sampling configuration field to
transactionSettingsand updates consumers. - Adds tests for all four property-presence combinations and updates existing tests.
| File | Description |
|---|---|
testing/feature-tests/src/test/java/com/solarwinds/opentelemetry/instrumentation/feature/test/TransactionFilteringTest.java |
Updates filtering setup to the renamed builder method. |
libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/SamplingConfigProviderTest.java |
Adds precedence and fallback tests. |
libs/shared/src/test/java/com/solarwinds/opentelemetry/extensions/config/provider/AbstractSamplerComponentProviderTest.java |
Updates declarative configuration assertions and helpers. |
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/SamplingConfigProvider.java |
Resolves transaction settings directly from configuration properties. |
libs/shared/src/main/java/com/solarwinds/opentelemetry/extensions/config/provider/AbstractSamplerComponentProvider.java |
Uses the renamed builder method. |
libs/sampling/src/test/java/com/solarwinds/joboe/sampling/TraceDecisionUtilTest.java |
Updates sampling test setup for the rename. |
libs/sampling/src/main/java/com/solarwinds/joboe/sampling/TraceDecisionUtil.java |
Reads rules through the renamed getter. |
libs/sampling/src/main/java/com/solarwinds/joboe/sampling/SamplingConfiguration.java |
Renames the transaction-settings field. |
libs/lambda/src/main/java/com/solarwinds/opentelemetry/extensions/LambdaConfigurationLoader.java |
Removes duplicated precedence resolution and synthetic-key writes. |
libs/config/src/main/java/com/solarwinds/joboe/config/ConfigProperty.java |
Removes the internal transaction-settings key. |
custom/src/main/java/com/solarwinds/opentelemetry/extensions/config/ConfigurationLoader.java |
Removes duplicated precedence resolution and synthetic-key writes. |
Review effort: Balanced
cheempz
left a comment
There was a problem hiding this comment.
LGTM but maybe it's time we stopped supporting url_sample_rate entirely since inherited from legacy and in effect can only lower the rate (since remote settings typically come with the override flag). Now that we document the agent config in YAML (yay!) it might give end users the wrong impression to keep this one around.
okay. i'll do that on this pr. |

TL;DR
Removes the
agent.internal.transactionSettingsconfig property. The precedence betweenagent.transactionSettingsandagent.urlSampleRatesis now resolved in one place, when the sampling configuration is built, instead of being written back into the config as a synthetic "internal" key.Background
agent.internal.transactionSettingswas never a user-facing option. Both the standard and the Lambda configuration loader comparedagent.transactionSettingswithagent.urlSampleRatesand stored the winner under this internal key. The sampling configuration then read that key. This approach had three problems:ConfigPropertyexposed a key that users must never set, protected only by a code comment.Changes
SamplingConfigProvider. A newresolveTransactionSettings()reads both properties directly fromConfigManager:agent.transactionSettingswins if it is set; ifagent.urlSampleRatesis also set, the existing "is ignored" warning is logged.agent.urlSampleRates.nullwhen neither is set.AGENT_INTERNAL_TRANSACTION_SETTINGSremoved fromConfigProperty.SamplingConfiguration.internalTransactionSettingsrenamed totransactionSettings. The "internal" prefix only made sense alongside the deleted key. Callers, includingTraceDecisionUtiland the declarative sampler provider, are updated.Behavioural notes
transactionSettingsstill beatsurlSampleRates.AbstractSamplerComponentProvider) is unaffected apart from the rename.Testing
transactionSettings, onlyurlSampleRates, and neither set.