code: private Action0 stopTracing(final Span parent) {
          return new Action0() {
              @Override
              public void call() {
                  if (parent != null) {
                      environment.tracer().scopeManager()
                          .activate(parent, true)
                          .close();
                  }
              }
          };
      }
docs: Helper method to stop tracing for the parent span given.