-
Notifications
You must be signed in to change notification settings - Fork 129
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
sampler and span processor prototype implementations for consistent sampling #226
sampler and span processor prototype implementations for consistent sampling #226
Conversation
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.
Did a very quick skim - 3700 lines is too huge though, let's start with a PR that only adds ConsistentProbabilityBasedSampler
please
...main/java/io/opentelemetry/contrib/export/ConsistentReservoirSamplingBatchSpanProcessor.java
Outdated
Show resolved
Hide resolved
...ent-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentAlwaysOffSampler.java
Outdated
Show resolved
Hide resolved
...t-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentComposedAndSampler.java
Show resolved
Hide resolved
...nt-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentComposedOrSampler.java
Outdated
Show resolved
Hide resolved
...t-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentParentBasedSampler.java
Outdated
Show resolved
Hide resolved
...pling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentProbabilityBasedSampler.java
Outdated
Show resolved
Hide resolved
consistent-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentSampler.java
Outdated
Show resolved
Hide resolved
...-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentRateLimitingSampler.java
Outdated
Show resolved
Hide resolved
…plers/ConsistentParentBasedSampler.java Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
...-sampling/src/main/java/io/opentelemetry/contrib/samplers/ConsistentRateLimitingSampler.java
Outdated
Show resolved
Hide resolved
consistent-sampling/src/main/java/io/opentelemetry/contrib/state/OtelTraceState.java
Outdated
Show resolved
Hide resolved
consistent-sampling/src/main/java/io/opentelemetry/contrib/state/OtelTraceState.java
Outdated
Show resolved
Hide resolved
consistent-sampling/src/main/java/io/opentelemetry/contrib/state/OtelTraceState.java
Outdated
Show resolved
Hide resolved
consistent-sampling/src/main/java/io/opentelemetry/contrib/state/OtelTraceState.java
Outdated
Show resolved
Hide resolved
…te/OtelTraceState.java Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
…te/OtelTraceState.java Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
…te/OtelTraceState.java Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
…te/OtelTraceState.java Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
…te/OtelTraceState.java Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…b/opentelemetry-java-contrib into consistent-sampling
@trask, thank you very much for your valuable suggestions! I hope I have not overlooked anything and have addressed all your points. |
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.
@open-telemetry/java-contrib-approvers let me know if anyone is planning to review this further, otherwise I will merge before making the upcoming release, thx!
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 looks like RandomGenerator
can be moved into the samplers
package and made package private? We can have package-private factories accepting it for use in unit tests only in this repo, but let's keep the public API using just a default threadlocalrandom based generator without user configuration.
For OtelTraceState
it also looks like it can be made package private. If you expect other packages needing the utility methods, then it's also ok to move into io.opentelemetry.contrib.samplers.internal
but suspect we don't need to do more than package private at least at this time.
Note that we cannot have packages present in multiple artifacts in our codebase. So currently the generic sounding packages io.opentelemetry.contrib.state
and io.opentelemetry.contrib.util
could cause problems in the future. The above internalizing suggestions will hopefully fix that naturally.
…m to samplers package
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.
Thanks!
thanks @oertl 🎉 |
Description:
This PR adds various Sampler and SpanProcessor prototype implementations for consistent sampling as defined by https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/tracestate-probability-sampling.md and open-telemetry/opentelemetry-specification#2047:
EDIT: ConsistentReservoirSamplingBatchSpanProcessor was removed to make this PR smaller as requested by @anuraaga. It can now be found in https://github.com/dynatrace-oss-contrib/opentelemetry-java-contrib/tree/consistent-reservoir-sampling.