https://dagster.io/ logo
Title
b

Bryan Chavez

01/11/2022, 6:16 PM
Is there a way to get job metadata like start time, duration or endtime?
c

chris

01/11/2022, 6:36 PM
Where are you trying to get it from? Via a python API, dagit, etc
b

Bryan Chavez

01/11/2022, 6:38 PM
ideally from within a job success sensor
c

chris

01/11/2022, 6:38 PM
In dagit, this information is visible from the runs page. From python, you can get run stats from the DagsterInstance object by passing in a run_id:
from dagster import DagsterInstance

instance = DagsterInstance.get()
run_stats = instance.get_run_stats(my_run_id)
run_stats.start_time, run_stats.end_time, ...
b

Bryan Chavez

01/11/2022, 6:39 PM
great, thank you!
y

yuhan

06/15/2022, 7:52 PM
@Dagster Bot discussion How to get job metadata within a sensor
d

Dagster Bot

06/15/2022, 7:52 PM
Question in the thread has been surfaced to GitHub Discussions for future discoverability: https://github.com/dagster-io/dagster/discussions/8417