code: protected Optional<HttpTracing> buildTracing(
        final Environment environment, final Reporter<Span> reporter) {
  
      LOGGER.info(
          "Registering Zipkin service ({}) at <{}:{}>", serviceName, serviceHost, servicePort);
  
      final Tracing tracing =
          Tracing.newBuilder()
              .currentTraceContext(
                  ThreadLocalCurrentTraceContext.newBuilder()
                      .addScopeDecorator(MDCScopeDecorator.create())
                      .build())
              .localIp(serviceHost)
              .localPort(servicePort)
              .spanReporter(reporter)
              .localServiceName(serviceName)
              .sampler(getSampler())
              .traceId128Bit(traceId128Bit)
              .build();
  
      final HttpTracing httpTracing =
          HttpTracing.newBuilder(tracing)
              .clientParser(clientParser)
              .clientSampler(clientSampler)
              .serverParser(serverParser)
              .serverSampler(serverSampler)
              .build();
  
      // Register the tracing feature for client and server requests
      environment.jersey().register(TracingApplicationEventListener.create(httpTracing));
      environment
          .lifecycle()
          .manage(
              new Managed() {
                @Override
                public void start() throws Exception {
                  // nothing to start
                }
  
                @Override
                public void stop() throws Exception {
                  tracing.close();
                }
              });
  
      return Optional.of(httpTracing);
    }
docs: Build a new {@link HttpTracing} instance for interfacing with Zipkin
  
  @param environment Environment
  @param reporter reporter
  @return HttpTracing instance