code: def ensure_parent_id(self):
          
          if self.trace_parent.span_id == self.id:
              self.trace_parent.span_id = "%016x" % random.getrandbits(64)
              logger.debug("Set parent id to generated %s", self.trace_parent.span_id)
          return self.trace_parent.span_id
docs: If current trace_parent has no span_id, generate one, then return it
  
          This is used to generate a span ID which the RUM agent will use to correlate
          the RUM transaction with the backend transaction.