Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Sep 23, 2024
1 parent f8a8ba0 commit 9f9fdc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public SamplingResult shouldSample(
SamplingResult result =
fallback.shouldSample(parentContext, traceId, name, spanKind, attributes, parentLinks);

if (existingKeyTransactions.isEmpty() && startKeyTransactions.isEmpty()) {
return result;
}
return new TransactionSamplingResult(
existingKeyTransactions, startKeyTransactions, endKeyTransactions, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static Sampler getSampler(
// as
// it will ensure consistent traces, however it does not accurately compute item counts, since
// item counts are not propagated in trace state (yet)
return Sampler.parentBasedBuilder(sampler).build();
sampler = Sampler.parentBasedBuilder(sampler).build();
}

if (KeyTransactionConfigSupplier.KEY_TRANSACTIONS_ENABLED) {
Expand Down

0 comments on commit 9f9fdc5

Please sign in to comment.