code: def span_to_tracing_field(span):
      
      if span is None:
          return common.random_tracing()
      # noinspection PyBroadException
      try:
          carrier = {}
          span.tracer.inject(span, ZIPKIN_SPAN_FORMAT, carrier)
          tracing = Tracing(span_id=carrier['span_id'],
                            trace_id=carrier['trace_id'],
                            parent_id=carrier['parent_id'] or 0L,
                            traceflags=carrier['traceflags'])
          return tracing
      except opentracing.UnsupportedFormatException:
          pass  # tracer might not support Zipkin format
      except:
          log.exception('Failed to inject tracing span into headers')
      return common.random_tracing()
docs: Inject the span into Trace field, if Zipkin format is supported
      :param span: OpenTracing Span