-
Notifications
You must be signed in to change notification settings - Fork 619
feat(opentelemetry-sampler-aws-xray): Add Rate Limiter and Sampling Targets Poller Logic #2924
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
feat(opentelemetry-sampler-aws-xray): Add Rate Limiter and Sampling Targets Poller Logic #2924
Conversation
…argets Poller Logic
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2924 +/- ##
=======================================
Coverage 89.84% 89.84%
=======================================
Files 188 188
Lines 9282 9282
Branches 1903 1903
=======================================
Hits 8339 8339
Misses 943 943 🚀 New features to boost your workflow:
|
| } from './rule-cache'; | ||
|
|
||
| import { SamplingRuleApplier } from './sampling-rule-applier'; | ||
| import { PACKAGE_NAME } from './version'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this file is generated? I tried 'npm run setup:dev' and 'npm run compile', none of them generate this file and that is causing build failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is generated by npm run version:update. However, while this package is in the incubator folder, this command isn't automatically run for this package until it is moved out of this directory.
incubator/opentelemetry-sampler-aws-xray/src/fallback-sampler.ts
Outdated
Show resolved
Hide resolved
incubator/opentelemetry-sampler-aws-xray/test/fallback-sampler.test.ts
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| public toString(): string { | ||
| return `RateLimitingSampler{rate limiting sampling with sampling config of ${this.quota} req/sec and 0% of additional requests}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we need 'and 0% of additional requests' in the context of rate limiting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I kept this text to be aligned with the Python implementation.
incubator/opentelemetry-sampler-aws-xray/src/aws-xray-sampling-client.ts
Outdated
Show resolved
Hide resolved
|
@dyladan Yes, Luke is from AWS, and he can be considered as an SME for this PR. Will be addressing his comments soon. |
yiyuan-he
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Which problem is this PR solving?
Short description of the changes
This PR is a followup to #2824
SamplingRuleApplier.SamplingRuleApplierwill sample the requests.GetSamplingTargetscall to determine the next targetRateLimitingSampler(applied before the fixed rate sampler) to be used in each rule applier.FallbackSampleris updated to be a combination of above samplers to sample1 req/secand5%of additional requests in that second.This PR's implementation was tested against X-Ray's Centralized Sampling Integration tests.