opentelemetry-js-contrib icon indicating copy to clipboard operation
opentelemetry-js-contrib copied to clipboard

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

Open jj22ee opened this issue 9 months ago • 1 comments

Which problem is this PR solving?

  • https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2736
  • This PR will be followed up by 2 more PRs to complete the X-Ray Sampler Implementation

Short description of the changes

This PR is an update to https://github.com/open-telemetry/opentelemetry-js-contrib/pull/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 avatar Mar 10 '25 08:03 jj22ee

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.67%. Comparing base (27f5c66) to head (701b64b). Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2750   +/-   ##
=======================================
  Coverage   89.67%   89.67%           
=======================================
  Files         184      184           
  Lines        8946     8946           
  Branches     1834     1834           
=======================================
  Hits         8022     8022           
  Misses        924      924           
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 10 '25 08:03 codecov[bot]

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
    },

jj22ee avatar Mar 25 '25 17:03 jj22ee

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 avatar Apr 14 '25 17:04 jj22ee

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

jj22ee avatar Apr 21 '25 02:04 jj22ee

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

pichlermarc avatar Apr 25 '25 11:04 pichlermarc

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

jj22ee avatar Apr 28 '25 17:04 jj22ee

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

pichlermarc avatar Apr 30 '25 09:04 pichlermarc

oops, fixed package-lock.json!

jj22ee avatar Apr 30 '25 10:04 jj22ee

Looks like the TAV checks are also failing

dyladan avatar May 02 '25 15:05 dyladan

These TAV failures can be ignored. It's caused due to the incubator/ directory not being part of the root package.json's workspaces list. Any change to this incubator subproject will result in TAV failures, which we can ignore (until it is moved to packages/ directory).

jj22ee avatar May 08 '25 20:05 jj22ee