Skip to content
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

Merged
merged 54 commits into from
Apr 20, 2022
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7116c5e
sampler and exporter implementations for consistent sampling
oertl Feb 4, 2022
d8dd6e6
Merge branch 'main' into consistent-sampling
oertl Feb 7, 2022
6b4ba10
improved dependencies (in particular, removed dependency on guava)
oertl Feb 14, 2022
5ca2625
Merge remote-tracking branch 'origin' into consistent-sampling
oertl Feb 14, 2022
038f803
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Feb 14, 2022
a686b3a
reverted some changes
oertl Feb 14, 2022
08bbc40
removed wrong immutable annotation
oertl Feb 15, 2022
9258ef4
added javadoc
oertl Feb 15, 2022
000ffea
avoid else statements when returning
oertl Feb 15, 2022
f7911c3
factory methods for consistent samplers, avoid exposure of implementa…
oertl Feb 15, 2022
b3459f9
added javadoc for AND and OR sampler composition
oertl Feb 15, 2022
0bbdb73
Merge remote-tracking branch 'origin' into consistent-sampling
oertl Feb 15, 2022
185f579
replaced use of synchronized by atomic reference
oertl Feb 15, 2022
abb7e71
simplified thread local initialization
oertl Feb 15, 2022
dd3df4e
removed consistent reservoir sampling
oertl Feb 16, 2022
90a2960
Merge branch 'open-telemetry:main' into consistent-sampling
oertl Mar 9, 2022
6f731b6
improved comment
oertl Mar 9, 2022
d40c0f1
removed unnecessary clipping of sampling probability
oertl Mar 10, 2022
775ca52
added javadoc explaining maths of implementation
oertl Mar 10, 2022
2ffe08f
Merge branch 'open-telemetry:main' into consistent-sampling
oertl Mar 10, 2022
a82eee6
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 9, 2022
6e8a38a
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 9, 2022
ae9670b
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 9, 2022
83c21f4
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 9, 2022
35d0373
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Apr 19, 2022
348a240
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Apr 19, 2022
0afaa2f
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Apr 19, 2022
f63bb0b
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Apr 19, 2022
aaffdd7
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sam…
oertl Apr 19, 2022
56eec39
added component owner for consistent sampling
oertl Apr 19, 2022
667e1f7
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 19, 2022
7910939
Merge branch 'consistent-sampling' of github.com:dynatrace-oss-contri…
oertl Apr 19, 2022
3fae630
removed nonnull annotation
oertl Apr 19, 2022
5040a74
renamed variable s -> pair
oertl Apr 19, 2022
e0041c0
renamed char parameter r -> c
oertl Apr 19, 2022
767e52f
renamed method isLowerCaseNum -> isDigit
oertl Apr 19, 2022
c18dcfe
use empty list instead of null for otherKeyValuePairs
oertl Apr 19, 2022
be68ff2
simplified isValueByte method
oertl Apr 19, 2022
30e42e3
Update consistent-sampling/src/main/java/io/opentelemetry/contrib/sta…
oertl Apr 19, 2022
d209258
Merge branch 'consistent-sampling' of github.com:dynatrace-oss-contri…
oertl Apr 19, 2022
7f58aa1
renamed variable sepPos -> separatorPos
oertl Apr 19, 2022
938382a
replaced 0. and 1. by 0.0 and 1.0
oertl Apr 19, 2022
630b157
improved readability as suggested by @trask
oertl Apr 19, 2022
1dca6f4
removed unused methods from RandomUtil
oertl Apr 19, 2022
09cc3a0
added javadoc
oertl Apr 19, 2022
15a8d50
renamed targetSpansPerNanosLimit -> targetSpansPerNanosecondLimit
oertl Apr 19, 2022
f70454a
throw IllegalArgumentException instead of returning NaN + added comments
oertl Apr 19, 2022
8d3a731
renamed tsStartPos -> startPos and eqPos -> colonPos
oertl Apr 19, 2022
3b7f045
improved readability of invariant check
oertl Apr 19, 2022
878c236
added some more test cases
oertl Apr 19, 2022
6fc45cd
fixed typo
oertl Apr 19, 2022
06cbeea
removed unused method
oertl Apr 19, 2022
edac8a9
refactored random generator
oertl Apr 19, 2022
da42018
made OtelTraceState and RandomGenerator package private and moved the…
oertl Apr 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
renamed targetSpansPerNanosLimit -> targetSpansPerNanosecondLimit
  • Loading branch information
oertl committed Apr 19, 2022
commit 15a8d50e282ff2442f542a66ce1e55d7c7f24239
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public State(double effectiveWindowCount, double effectiveWindowNanos, long last
private final String description;
private final LongSupplier nanoTimeSupplier;
private final double inverseAdaptationTimeNanos;
private final double targetSpansPerNanosLimit;
private final double targetSpansPerNanosecondLimit;
private final AtomicReference<State> state;

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public State(double effectiveWindowCount, double effectiveWindowNanos, long last
this.nanoTimeSupplier = requireNonNull(nanoTimeSupplier);

this.inverseAdaptationTimeNanos = 1e-9 / adaptationTimeSeconds;
this.targetSpansPerNanosLimit = 1e-9 * targetSpansPerSecondLimit;
this.targetSpansPerNanosecondLimit = 1e-9 * targetSpansPerSecondLimit;

this.state = new AtomicReference<>(new State(0, 0, nanoTimeSupplier.getAsLong()));
}
Expand All @@ -156,7 +156,7 @@ protected int getP(int parentP, boolean isRoot) {
State currentState = state.updateAndGet(s -> updateState(s, currentNanoTime));

double samplingProbability =
(currentState.effectiveWindowNanos * targetSpansPerNanosLimit)
(currentState.effectiveWindowNanos * targetSpansPerNanosecondLimit)
/ currentState.effectiveWindowCount;

if (samplingProbability >= 1.) {
Expand Down