-
Notifications
You must be signed in to change notification settings - Fork 17
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
AWS X-Ray Remote Sampler Part 1 - Initial Rules Poller Implementation #33
Conversation
3186a64
to
d78b734
Compare
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_remote_sampler.py
Outdated
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_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/aws_xray_sampling_client.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/aws_xray_sampling_client.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/sampling_rule.py
Outdated
Show resolved
Hide resolved
In the PR description can you also post the output from your testing script? |
Also, I didn't go through the unit tests in this pass. Will review them some time soon. |
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_sampling_client.py
Outdated
Show resolved
Hide resolved
...ntelemetry-distro/tests/amazon/opentelemetry/distro/sampler/test_aws_xray_sampling_client.py
Outdated
Show resolved
Hide resolved
Pending #36 to fix failing checks |
f86db1b
to
51d76a0
Compare
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.
Minor comments regarding the types of SamplingRule properties. Since typing in python is very fluid, it can easily lead to confusion and possible bugs if we don't treat the properties with correct types.
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule.py
Outdated
Show resolved
Hide resolved
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/sampler/_sampling_rule.py
Outdated
Show resolved
Hide resolved
ecfd24d
to
8dcaba7
Compare
…g Logic (#47) *Issue #, if available:* Second PR of 3 parts for adding the X-Ray remote sampling support for OTel Python SDK. [See Part 1](#33) *Description of changes:* - Sampling `RuleCache` - Caches a list of `Rule`s, ordered by rule priority then rule name. Each rule corresponds to the Sampling Rule from GetSamplingRules. Each call to GetSamplingRules will only update the `Rule`s that have changed properties, to preserve the state of unchanged rules. This means when Reservoir and Statistics are implemented in the `Rule`s, they will persist for unchanged rules. - The RuleCache will determine which Rule a set of {ResourceAttributes,SpanAttributes} matches with that has highest priority. - `Rule` - Corresponds to a `SamplingRule` and has logic to match with provided set of ResourceAttribute and SpanAttribute using the `Matcher` class. - Will determine the final sampling decision - `Matcher` class with methods to perform: - Convert X-Ray sampling rule options to regex patterns - Wild card and attribute matching - Initial class for `FallbackSampler` Testing: Unit tests By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available:
First PR of 3 parts for adding the X-Ray remote sampling support for OTel Python SDK.
Description of changes:
AwsXRayRemoteSampler
- extendsopentelemetry.sdk.trace.sampling.Sampler
and implementsshould_sample
.resource
, Collectorendpoint
, rulespolling_interval
are configurable.AwsXRaySamplingClient
- client to call GetSamplingRulesSamplingRule
- Class for SamplingRules typeTesting Script to poll Sampling Rules every 5 seconds:
Output:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.