-
Notifications
You must be signed in to change notification settings - Fork 22
AWS X-Ray Remote Sampler Part 3 - rate limiter logic and get sampling targets #55
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
srprash
reviewed
Feb 14, 2024
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/aws_xray_remote_sampler.py
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/aws_xray_remote_sampler.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_aws_xray_sampling_client.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_rate_limiter.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_rate_limiting_sampler.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule_applier.py
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule_applier.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule_applier.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule_applier.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule_applier.py
Outdated
Show resolved
Hide resolved
srprash
approved these changes
Feb 16, 2024
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. Thanks!
srprash
approved these changes
Feb 16, 2024
jj22ee
added a commit
that referenced
this pull request
Feb 16, 2024
#64) *Issue #, if available:* Use X-Ray default sampler as default sampler if user has not specified one Requires #55 to be merged first before this PR can work. *Description of changes:* Use X-Ray default sampler as default sampler if user has not specified one *Testing:* Assume #55 is merged 1. Enabled span_metrics_processor and added debug statement to print out Sampled status of a span in `on_start()` ``` # aws_span_metrics_processor.py if span.get_span_context().trace_flags.sampled: print("sampled") ``` 2. Replaced resource detectors and manually set resource with service.name=test-service-name and build ADOT SDK 3. Setup OTel collector with XRay proxy for sampling and AWS credentials 4. In AWS account, create sampling rule to match service_name=test-service-name 5. Setup sample app in `sample-applications/simple-client-server/server_automatic_s3client.py` 6. Update `sample-applications/simple-client-server/client.py` to call server/sample-app a variable number of times to verify sampling rule is applied 7. Repeat 6 after changing sampling rule rate/reservoir By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue #, if available:
This is the 3rd and final part of the X-Ray Remote Sampler implementation for Python
See Part 2
Description of changes:
GetSamplingTargets
call to determine the next targetTesting:
Unit Tests and Remote Sampling Testbed
Testbed:
Have XRay Daemon running or OTel collector with XRay Proxy Client setup running. Ensure AWS credentials used has only default rule with 5% sampling and 1 req/s
Checkout this PR Branch, and install
pip3 install aws-opentelemetry-distro/
Download this Python Sample App: https://github.com/jj22ee/aws-otel-community/tree/python-sample/centralized-sampling-tests/sample-apps/python-flask
Install python3 requirements.txt
Replace the following:
with:
Run Python Sample app with
python3 app.py
Within directory
centralized-sampling-tests/
run:./gradlew :integration-tests:run
Check that the tests have passed.
TODO: wire in the remote sampler to the ADOT Python customizer in this PR or a new PR
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.