Skip to content

Commit

Permalink
Pass unmodifiable list to exporters (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal authored Feb 26, 2021
1 parent f1c38ef commit 0d467ab
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.opentelemetry.sdk.trace.SpanProcessor;
import io.opentelemetry.sdk.trace.data.SpanData;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -261,7 +262,8 @@ private void exportCurrentBatch() {
}

try {
final CompletableResultCode result = spanExporter.export(batch);
final CompletableResultCode result =
spanExporter.export(Collections.unmodifiableList(batch));
result.join(exporterTimeoutNanos, TimeUnit.NANOSECONDS);
if (result.isSuccess()) {
exportedSpans.add(batch.size());
Expand Down

0 comments on commit 0d467ab

Please sign in to comment.