public static <T> List<CompletableFuture<T>>
    tracedFutures(Supplier<List<CompletableFuture<T>>> action, Supplier<Span> spanSupplier) {
    Span span = spanSupplier.get();
    try (Scope ignored = span.makeCurrent()) {
      List<CompletableFuture<T>> futures = action.get();
      endSpan(CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])), span);
      return futures;
    }
  }
Trace an asynchronous operation, and finish the create {@link Span} when all the given
{@code futures} are completed.
hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java