Add URL substitution to registered uploaded files when reporting an event

This commit is contained in:
allegroai 2024-05-04 23:45:36 +03:00
parent f267466926
commit 81c02dbfdd

View File

@ -136,6 +136,15 @@ class Metrics(InterfaceBase):
kwargs = {}
if entry:
key, url = ev.get_target_full_upload_uri(storage_uri, self.storage_key_prefix, quote_uri=False)
orig_url = url
try:
storage = self._get_storage(url)
if storage:
url = storage._apply_url_substitutions(url)
except Exception as err:
self._get_logger().warning("Failed applying URL substitutions on {} ({})".format(orig_url, err))
kwargs[entry.key_prop] = key
kwargs[entry.url_prop] = url
if not entry.stream: