Skip to content

Internal - Remove agent.internal.transactionSettings config - #688

Open
cleverchuk wants to merge 3 commits into
mainfrom
cc/NH-153456
Open

cleverchuk wants to merge 3 commits into
mainfrom
cc/NH-153456

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

TL;DR

Removes the agent.internal.transactionSettings config property. The precedence between agent.transactionSettings and agent.urlSampleRates is 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.transactionSettings was never a user-facing option. Both the standard and the Lambda configuration loader compared agent.transactionSettings with agent.urlSampleRates and stored the winner under this internal key. The sampling configuration then read that key. This approach had three problems:

  • The same precedence logic was copied into both loaders.
  • ConfigProperty exposed a key that users must never set, protected only by a code comment.
  • Anyone reading the code had to trace three places to learn which setting takes effect.

Changes

  • Precedence resolution moved to SamplingConfigProvider. A new resolveTransactionSettings() reads both properties directly from ConfigManager:
    • agent.transactionSettings wins if it is set; if agent.urlSampleRates is also set, the existing "is ignored" warning is logged.
    • Otherwise it falls back to agent.urlSampleRates.
    • It returns null when neither is set.
  • Loaders simplified. The duplicated comparison blocks are gone from both the standard and the Lambda configuration loader. They no longer write derived values back into the config container.
  • AGENT_INTERNAL_TRANSACTION_SETTINGS removed from ConfigProperty.
  • SamplingConfiguration.internalTransactionSettings renamed to transactionSettings. The "internal" prefix only made sense alongside the deleted key. Callers, including TraceDecisionUtil and the declarative sampler provider, are updated.

Behavioural notes

  • No change to which settings take effect: transactionSettings still beats urlSampleRates.
  • The "urlSampleRates is ignored" warning is now logged the first time the sampling configuration is built, not during config file loading. Both happen at agent startup.
  • The declarative config path (AbstractSamplerComponentProvider) is unaffected apart from the rename.

Testing

  • New unit tests cover all four resolution cases: both set, only transactionSettings, only urlSampleRates, and neither set.
  • Existing sampler provider, trace decision and feature tests are updated for the rename.

@cleverchuk
cleverchuk requested review from a team as code owners November 20, 2026 21:10
Copilot AI balanced review requested due to automatic review settings November 20, 2026 21:10

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

🟡 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 transactionSettings and 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
cheempz previously approved these changes Nov 23, 2026

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

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.

@cleverchuk

Copy link
Copy Markdown
Contributor Author

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants