Metadata allows you to attach information to op jobs and the runs launched from those jobs. By the end of this guide, you'll understand what metadata is, how to attach it to an op job, and how to view the job metadata in the Dagster UI.
Attaching metadata to a job is done using the metadata argument and a dictionary of key/value pairs. Keys must be a string, but values can:
Be any of the MetadataValue classes provided by Dagster
Primitive Python types, which Dagster will convert to the appropriate MetadataValue
The information you provide can be whatever you want, but possible cases include:
Keeping track of the team responsible for maintaining a job
Linking to documentation or other resources
Displaying the git hash corresponding to the current job definition
Note: If you are running Dagster using separate webserver and user code installations (more info here), then your dagster-webserver installation must be >=0.14.18 to use metadata on jobs.
@opdefmy_op():return"Hello World!"@job(
metadata={"owner":"data team",# will be converted to MetadataValue.text"docs": MetadataValue.url("https://docs.dagster.io"),})defmy_job_with_metadata():
my_op()
After attaching metadata to a job, you can view it in the Dagster UI by navigating to the Job overview page. Metadata will be displayed in the right pane.