-
Notifications
You must be signed in to change notification settings - Fork 586
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
base: main
Are you sure you want to change the base?
Conversation
…argets Poller Logic
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2924 +/- ##
=======================================
Coverage 89.06% 89.06%
=======================================
Files 188 188
Lines 9219 9219
Branches 1900 1900
=======================================
Hits 8211 8211
Misses 1008 1008 🚀 New features to boost your workflow:
|
|
||
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. |
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
.SamplingRuleApplier
will sample the requests.GetSamplingTargets
call to determine the next targetRateLimitingSampler
(applied before the fixed rate sampler) to be used in each rule applier.FallbackSampler
is updated to be a combination of above samplers to sample1 req/sec
and5%
of additional requests in that second.This PR's implementation was tested against X-Ray's Centralized Sampling Integration tests.