code: def pack_metadata(self) -> List[Tuple[str, Any]]:
          
          metadata = [(k, v) for k, v in self._invocation_metadata.items()
                      if k != LOG_FIELDS_KEY_META]
          metadata.append((LOG_FIELDS_KEY_META, self._log_fields.dumps()))
          return metadata
docs: Packs the log fields and the invocation metadata into a new metadata
  
          The log fields are added in the new metadata with the key
          `LOG_FIELDS_KEY_META`.