code: private Span startTracing(String spanName) {
          if (!environment.operationTracingEnabled()) {
              return null;
          }
          Scope scope = environment.tracer()
              .buildSpan(spanName)
              .startActive(false);
          Span parent = scope.span();
          scope.close();
          return parent;
      }
docs: Helper method to start tracing and return the span.