Skip to content

feat(opentelemetry-sampler-aws-xray): Update Rules Poller Implementation #2750

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

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

Conversation

jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Mar 10, 2025

Which problem is this PR solving?

Short description of the changes

This PR is an update to #1443

  • Updated the AWSXRayRemoteSampler skeleton class
    • Ensure AwsXRayRemoteSampler is a ParentBased Sampler, with internal logic inside _AWSXRayRemoteSampler
    • Refactor for obtaining X-Ray Sampling Rules and polling the Sampling Rules
  • Added class for SamplingRule and Skeleton class for SamplingRuleApplier
  • Add Statistics class for sampling rules statistics (not used yet)
  • Removed axios as a dependency, rely on http module for polling rules
  • Extracted all external http calls into aws-xray-sampling-client.ts

@jj22ee jj22ee requested a review from a team as a code owner March 10, 2025 08:31
@jj22ee jj22ee changed the title AWS X-Ray Remote Sampler - Update Rules Poller Implementation feat(opentelemetry-sampler-aws-xray): Update Rules Poller Implementation Mar 10, 2025
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.53%. Comparing base (64d358e) to head (dbfd302).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2750   +/-   ##
=======================================
  Coverage   89.53%   89.53%           
=======================================
  Files         180      180           
  Lines        8725     8725           
  Branches     1771     1771           
=======================================
  Hits         7812     7812           
  Misses        913      913           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jj22ee jj22ee force-pushed the xray-remote-sampler-pr0 branch from 27c82e6 to e571be0 Compare March 10, 2025 18:19
@jj22ee jj22ee force-pushed the xray-remote-sampler-pr0 branch from e571be0 to 198fcf9 Compare March 10, 2025 18:37
@jj22ee jj22ee removed their assignment Mar 18, 2025
@jj22ee
Copy link
Contributor Author

jj22ee commented Mar 25, 2025

Hi @trentm, in this PR I am continuing the X-Ray Sampler Implementation, which I plan to finish in 2 followup PRs.

I've moved the Sampler out from incubator/opentelemetry-sampler-aws-xray and into packages/opentelemetry-sampler-aws-xray in this PR. Would you prefer that I keep it in incubator for now, and move it into packages only when the implementation is complete?

Since I added it to packages, I also had to update release-please-config.json to make the PR checks to pass:

    "packages/opentelemetry-sampler-aws-xray": {
      "skip-github-release": true
    },

Copy link
Contributor

@yiyuan-he yiyuan-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are just publishing our internal implementation that has already been reviewed by team, nothing more to add from my side.

Will defer to any further feedback provided by upstream approvers/maintainers.

@jj22ee jj22ee added the has:owner-approval Approved by Component Owner label Apr 14, 2025
@jj22ee
Copy link
Contributor Author

jj22ee commented Apr 14, 2025

Note that this PR is moving the Sampler out from incubator/opentelemetry-sampler-aws-xray and into packages/opentelemetry-sampler-aws-xray, and added this package to release-please-config.json to skip the release of this component for now. Otherwise I can keep it in incubator/ until the implementation is complete if that is preferred.

@jj22ee
Copy link
Contributor Author

jj22ee commented Apr 21, 2025

@pichlermarc Looking for approval. Also wondering if you are fine with moving this sampler out of /incubator?

@pichlermarc
Copy link
Member

@pichlermarc Looking for approval. Also wondering if you are fine with moving this sampler out of /incubator?

@jj22ee I'd rather have it remain in incubating for now since the dependencies still need to be updated to reference SDK 2.0 (node engine field also needs to be adapted since we don't support Node.js 14 anymore in the latest releases of the contrib repo and we don't test for it anymroe).

@jj22ee jj22ee force-pushed the xray-remote-sampler-pr0 branch from f40264e to 82e7236 Compare April 26, 2025 00:19
@jj22ee
Copy link
Contributor Author

jj22ee commented Apr 28, 2025

@pichlermarc Moved the Sampler back into incubator, also updated to SDK 2.0.
I assume we can ignore the TAV checks here?

@pichlermarc
Copy link
Member

@pichlermarc Moved the Sampler back into incubator, also updated to SDK 2.0.

@jj22ee thanks!

There also seem to be some changes to the top-level package-lock.json from a previous commit that included the sampler package in the workspace - would you mind undoing them?

I assume we can ignore the TAV checks here?

Yes, we can safely ignore them here.

@jj22ee
Copy link
Contributor Author

jj22ee commented Apr 30, 2025

oops, fixed package-lock.json!

Copy link
Member

dyladan commented May 2, 2025

Looks like the TAV checks are also failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants