def METHOD_NAME(self, metadata: Dict[str, Any]) -> None:
    """Buffer metadata and prefix keys with mosaicml."""
    if self._enabled:
        for key, val in metadata.items():
            if self.ignore_keys and any(fnmatch.fnmatch(key, pattern) for pattern in self.ignore_keys):
                continue
            self.buffered_metadata[f'mosaicml/{key}'] = format_data_to_json_serializable(val)
        self._flush_metadata()