Skip to content

Fix: Support new fields in X-Ray API responses#577

Merged
wangzlei merged 1 commit intomainfrom
gsr-fix
Jan 14, 2026
Merged

Fix: Support new fields in X-Ray API responses#577
wangzlei merged 1 commit intomainfrom
gsr-fix

Conversation

@majanjua-amzn
Copy link
Copy Markdown
Contributor

Background

Recently, a new field was added to the X-Ray GetSamplingRules API that was not accounted for in the AWS X-Ray Remote Sampler implementation done in ADOT Python. As a result, enabling this new field would cause a failure and cease the parsing of any other rules in a given API response.

Example: Received 10 rules from the API, third of which has the SamplingRateBoost field. The SDK will successfully parse the first two, fail on the third, then stop there. As such, the SDK will only have 2/10 of the sampling rules and will not be able to effectively make sampling decisions based on the sampling rules set by the user. Any unmatched spans will use the _FallbackSampler.

Changes

  • Add usage of kwargs in X-Ray sampling API related objects, e.g. SamplingRule, SamplingTarget, etc.
  • Add unit tests proving additional fields do not cause errors.

Testing

  • Unit tests
  • Tested in depth as part of Adaptive Sampling Support #576, which this change was a part of but is now separated out to get it in more quickly

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@majanjua-amzn majanjua-amzn self-assigned this Jan 14, 2026
@majanjua-amzn majanjua-amzn requested a review from a team as a code owner January 14, 2026 21:11
@majanjua-amzn majanjua-amzn added bug Something isn't working python Pull requests that update Python code labels Jan 14, 2026
@majanjua-amzn majanjua-amzn force-pushed the gsr-fix branch 2 times, most recently from 4fbd20f to 0d50248 Compare January 14, 2026 21:18
@wangzlei wangzlei merged commit 7c4d60c into main Jan 14, 2026
16 checks passed
@wangzlei wangzlei deleted the gsr-fix branch January 14, 2026 21:58
ezhang6811 pushed a commit to ezhang6811/aws-otel-python-instrumentation that referenced this pull request Jan 15, 2026
Recently, a new field was added to the X-Ray GetSamplingRules API that
was not accounted for in the AWS X-Ray Remote Sampler implementation
done in ADOT Python. As a result, enabling this new field would cause a
failure and cease the parsing of any other rules in a given API
response.

Example: Received 10 rules from the API, third of which has the
SamplingRateBoost field. The SDK will successfully parse the first two,
fail on the third, then stop there. As such, the SDK will only have 2/10
of the sampling rules and will not be able to effectively make sampling
decisions based on the sampling rules set by the user. Any unmatched
spans will use the _FallbackSampler.

- Add usage of `kwargs` in X-Ray sampling API related objects, e.g.
SamplingRule, SamplingTarget, etc.
- Add unit tests proving additional fields do not cause errors.

- Unit tests
- Tested in depth as part of
aws-observability#576,
which this change was a part of but is now separated out to get it in
more quickly

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@ezhang6811 ezhang6811 mentioned this pull request Jan 15, 2026
ezhang6811 added a commit that referenced this pull request Jan 15, 2026
*Issue #, if available:*

*Description of changes:*
Ports the following commits from main into the 0.14.x release branch for
pending 0.14.2 release:

* #570 
* #571 
* #572 
* #573 
* #574 
* #575 
* #577 

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Syed Ahsan Ishtiaque <176968742+syed-ahsan-ishtiaque@users.noreply.github.com>
Co-authored-by: Lei Wang <66336933+wangzlei@users.noreply.github.com>
Co-authored-by: Jonathan Lee <107072447+jj22ee@users.noreply.github.com>
Co-authored-by: Steve Liu <liustve@amazon.com>
Co-authored-by: Mahad Janjua <134644284+majanjua-amzn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants