void (CompletionParameters parameters, Consumer<? super CompletionResult> consumer) { runWithSpan(myCompletionTracer, "performCompletion", span -> { var countingConsumer = new Consumer<CompletionResult>() { int count = 0; @Override public void consume(CompletionResult result) { count++; consumer.consume(result); } }; super.performCompletion(parameters, countingConsumer); span.setAttribute("lookupsFound", countingConsumer.count); }); }