-
Notifications
You must be signed in to change notification settings - Fork 168
Add AWS X-Ray Adaptive Sampling Support #2147
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
Conversation
|
|
aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
Outdated
Show resolved
Hide resolved
aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
Outdated
Show resolved
Hide resolved
aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
Outdated
Show resolved
Hide resolved
aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java
Outdated
Show resolved
Hide resolved
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.
@majanjua-amzn @wangzlei please review new public API carefully since this module is already marked stable (if you are unsure you can always add it initially under .internal. package as an experimental feature), thanks
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.
We've tested and reviewed it extensively more than once as part of a contribution to https://github.com/aws-observability/aws-otel-java-instrumentation, and have also verified there is no impact on existing behaviour for those not using the new APIs.
As such, we're okay with releasing these APIs directly. Thanks for the callout!
Description:
Adding support for X-Ray's new Adaptive Sampling feature. The feature will allow users to detect anomalies in their application across distributed services and boost the sampling rate of their root service based on their X-Ray sampling rule configuration and optionally a user-provided SDK level configuration. It will also allow users to optionally provide an error capture configuration, where - if configured - the sampler will send unsampled anomaly spans to be exported directly:
statusCode > 499(i.e. 5XX) will be considered anomaliesThe changes:
setSpanExporterandsetAdaptiveSamplingConfigto set up the feature - if these are not provided any attempt to use theadaptSamplingAPI will throw anIllegalStateExceptionadaptSamplingthat accepts a span and its associated spanData:XrayRulesSamplerwhile ensuring the statistics are correct to ensure the adaptive sampling logic is always triggered: Ensure all XRay Sampler functionality is under ParentBased logic #1488. Implemented a unit testgenerateStatistics()to verify.W3CBaggagePropagator.getInstance().inject(context.with(baggage), setter, carrier);Testing:
tracecontext,baggage,b3,xraypropagators, and service C with the contrib changes as wellDocumentation:
https://aws.amazon.com/blogs/mt/dynamically-adjusting-x-ray-sampling-rules/
Outstanding items:
These changes are the first phase and iteration of AWS X-Ray's adaptive sampling feature. As we get feedback, more changes may be introduced to improve or streamline the experience.