Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS X-Ray Remote Sampler Part 1 - Initial Classes and Rules Poller Implementation #3366

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jj22ee
Copy link

@jj22ee jj22ee commented Mar 15, 2025

Description

This is an initial PR to address #3305 in order for OTel Python to support X-Ray Remote Sampling. A series of PRs to fully implement this feature will follow.

Changes:

  • Add xray sampler under opentelemetry-sdk-extension-aws
  • Code changes:
    • Add Sampling Client class to communicate with X-Ray Service for Sampling Rules/Targets
    • Add X-Ray Sampling Rules/Targets/Statistics class to help represent the Sampling related data from X-Ray
    • Added the AwsXRayRemoteSampler skeleton class
      • Ensure AwsXRayRemoteSampler is a ParentBased Sampler, with internal logic inside _AWSXRayRemoteSampler
      • Run poller upon instantiation to regularly obtain X-Ray Sampling Rules from X-Ray

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

This PR is not a full implementation of the sampler, so it cannot be tested for correct functionality.
Right now, it currently always return a Parent Based decision or a DROP decision as a placeholder.

  • Unit Tests

A couple more PRs will follow-up to complete the implementation, which should look like this Sampler code from the AWS ADOT repo. At that point in the future, a full E2E integration test will be run.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@jj22ee jj22ee requested a review from a team as a code owner March 15, 2025 12:31
@jj22ee jj22ee removed their assignment Mar 16, 2025
@xrmx
Copy link
Contributor

xrmx commented Mar 17, 2025

Question: would it make sense to add this to https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/sdk-extension/opentelemetry-sdk-extension-aws instead of creating a new package?

@jj22ee
Copy link
Author

jj22ee commented Mar 18, 2025

Yeah that makes sense, opentelemetry-sdk-extension-aws seems to hold all aws components... except the AWS XRay Propagator that I based my work off of...

I synced with package owner @srprash, there is no concern with moving this Sampler to the SDK Extensions.

@jj22ee jj22ee removed their assignment Mar 19, 2025
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