Is there a way for me to see all the Runs done in ...
# ask-community
y
Is there a way for me to see all the Runs done in dagster, ideally I would get jobs, status, time, some of the metadata? I would like to build some basic analytics with it. I found this: https://docs.dagster.io/concepts/dagit/graphql#get-a-list-of-dagster-runs is that the only way to get all runs ever done?
o
@Yohann Potier graphql is one way of accessing that information, but you can also programmatically access the instance database, either in a script or in a dagster op. In an op, the instance is available as
context.instance
, or if you're not in an op, you can call
instance = DagsterInstance.get()
to load an instance based on the
dagster.yaml
file pointed to by your $DAGSTER_HOME environment variable (https://docs.dagster.io/_apidocs/internals#dagster.DagsterInstance). From there, you can call
instance.get_runs
(https://sourcegraph.com/github.com/dagster-io/dagster/-/blob/python_modules/dagster/dagster/_core/instance/__init__.py?L1341:5), which you could pass a RunsFilter into (if desired)
👍 1
y
Thank you, I’ll look into it 🎉 👍