Attach metadata to a run
Learn how to attach metadata to a run.
In ZenML, you can log metadata directly to a pipeline run, either during or
after execution, using the log_metadata
function. This function allows you
to attach a dictionary of key-value pairs as metadata to a pipeline run,
with values that can be any JSON-serializable data type, including ZenML
custom types like Uri
, Path
, DType
, and StorageSize
.
Logging Metadata Within a Run
If you are logging metadata from within a step that’s part of a pipeline run,
calling log_metadata
will attach the specified metadata to the current
pipeline run where the metadata key will have the step_name::metadata_key
pattern. This allows you to use the same metadata key from different steps
while the run's still executing.
Manually Logging Metadata to a Pipeline Run
You can also attach metadata to a specific pipeline run without needing a step, using identifiers like the run ID. This is useful when logging information or metrics that were calculated post-execution.
Fetching Logged Metadata
Once metadata has been logged in a pipeline run, you can retrieve it using the ZenML Client:

Last updated
Was this helpful?