https://dagster.io/ logo
#ask-community
Title
# ask-community
m

Moody Edghaim

05/17/2023, 4:05 PM
Is there anyway to get the
job_def
or
executor_def
of a job from either
DagsterRun
or
DagsterInstance
? I can't find a way in the documentation.
j

jamie

05/17/2023, 8:34 PM
i think you should be able to do
context.job_def
in your asset/op. let me know if that doesnt work
m

Moody Edghaim

05/17/2023, 11:19 PM
i don't have access to the
OpExecutionContext
in this flow - we're monkey patching datadog internals and this is function is a hook into job launching. unless I can get from
DagsterRun
->
OpExecutionContext
somehow.
j

jamie

05/18/2023, 2:57 PM
oh i see. in that case i’m not sure. I dug into those two classes a bit and i don’t see anything that will get you there directly. you might be able to combine some things though. for example you can get the job name from DagsterRun and you might be able to get the definition from the instance using the name (not sure id that’s possible though)
4 Views