code: def generate_id():
      
      global _current_pid
  
      pid = os.getpid()
      if _current_pid != pid:
          _current_pid = pid
          _rnd.seed(int(1000000 * time.time()) ^ pid)
      id = format(_rnd.randint(0, 18446744073709551615), '02x')
  
      if len(id) < 16:
          id = id.zfill(16)
  
      return id
docs: Generate a 64bit base 16 ID for use as a Span or Trace ID