Skip to content

feat: Allow disabling of default anomaly condition#1329

Merged
majanjua-amzn merged 3 commits intomainfrom
disable-default-anomaly
Mar 9, 2026
Merged

feat: Allow disabling of default anomaly condition#1329
majanjua-amzn merged 3 commits intomainfrom
disable-default-anomaly

Conversation

@majanjua-amzn
Copy link
Copy Markdown
Contributor

Background

Currently, when enabling adaptive sampling through the SamplingRateBoost field in a sampling rule the ADOT Java SDK immediately starts capturing 5XX errors as anomalies and this triggers boost behaviour in all services that have spans that match the rule. This is not always desired, so we are providing an option to turn this off per sampling rule.

The new API will have DisableDefaultAnomalyDetection set to true in this case.

Changes

  • Added the new field to the API model
  • Added logic to use this when in the default path
  • Extracted some logic into the getEffectiveSamplingRuleApplier method such that decisions about boosting and capturing can be made without having to repeatedly find this value again for a single span
  • Updated unit tests where relevant

Testing

  • ./gradlew clean && ./scripts/local_patch.sh && ./gradlew build
  • Manual E2E test where I set the field to true and validate no anomalies are recorded and also set it to false to ensure nothing has changed

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@majanjua-amzn majanjua-amzn requested a review from a team as a code owner February 25, 2026 17:12
@majanjua-amzn majanjua-amzn added enhancement New feature or request X-Ray AWS X-Ray components traces Tracing related issues java Pull requests that update Java code labels Feb 25, 2026
@majanjua-amzn majanjua-amzn force-pushed the disable-default-anomaly branch from 97ec509 to da15cef Compare February 25, 2026 17:31
wangzlei
wangzlei previously approved these changes Feb 27, 2026
@majanjua-amzn majanjua-amzn enabled auto-merge (squash) March 5, 2026 21:01
@majanjua-amzn majanjua-amzn merged commit b58e829 into main Mar 9, 2026
7 checks passed
@majanjua-amzn majanjua-amzn deleted the disable-default-anomaly branch March 9, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Pull requests that update Java code traces Tracing related issues X-Ray AWS X-Ray components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants