public static Runnable tracedRunnable(final Runnable runnable,
    final Supplier<Span> spanSupplier) {
    // N.B. This method name follows the convention of this class, i.e., tracedFuture, rather than
    // the convention of the OpenTelemetry classes, i.e., Context#wrap.
    return () -> {
      final Span span = spanSupplier.get();
      try (final Scope ignored = span.makeCurrent()) {
        runnable.run();
        span.setStatus(StatusCode.OK);
      } finally {
        span.end();
      }
    };
  }
Wrap the provided {@code runnable} in a {@link Runnable} that is traced.
hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java