AWS X-Ray Remote Sampler Part 2 - Add Rules Caching, Rules Matching Logic, Rate Limiter, and Sampling Targets Poller #3761
+2,498
−54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes:
RuleCache
_SamplingRuleApplier
s, ordered by rule priority then rule name. Each Rule Applier corresponds to the Sampling Rule from GetSamplingRules. Each call to GetSamplingRules will only update theRule
s that have changed properties, to preserve the state of unchanged rules. This means Reservoir and Statistics will persist in Rules for unchanged rules._SamplingRuleApplier
._SamplingRuleApplier
will sample the requests.GetSamplingTargets
call to determine the next target_SamplingRuleApplier
to perform Fixed Rate & Reservoir Sampling, and to include a method to apply matching logic against a set of {resource, attributes} by using the wild card and attribute matching from Utils_RateLimitingSampler
(applied before the fixed rate sampler) to be used in each rule applier.FallbackSampler
, a combination of_RateLimitingSampler
andTraceIdRatioBased
samplers to sample1 req/sec
and5%
of additional requests in that second._InternalAwsXRayRemoteSampler
to depend onRuleCache
and aFallbackSampler
Sampler for making sampling decisionsFixes #3305 -- This is the final PR to support X-Ray Remote Sampling.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.