Skip to content
Merged
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public final class AwsXrayRemoteSampler implements Sampler, Closeable {

static final long DEFAULT_TARGET_INTERVAL_NANOS = TimeUnit.SECONDS.toNanos(10);

private static final Random RANDOM = new Random();
private static final Logger logger = Logger.getLogger(AwsXrayRemoteSampler.class.getName());

private final Resource resource;
Expand Down Expand Up @@ -97,7 +96,7 @@ public static AwsXrayRemoteSamplerBuilder newBuilder(Resource resource) {

this.pollingIntervalNanos = pollingIntervalNanos;
// Add ~1% of jitter
jitterNanos = RANDOM.longs(0, pollingIntervalNanos / 100).iterator();
jitterNanos = new Random().longs(0, pollingIntervalNanos / 100).iterator();

// Execute first update right away on the executor thread.
executor.execute(this::getAndUpdateSampler);
Expand Down