Is there a way to grab code location name to be sh...
# ask-community
a
Is there a way to grab code location name to be shown in slack when using
make_slack_on_run_failure_sensor
? I see it is not there in the
RunFailureSensorContext
.
o
hi @Abhishek Agrawal! It's a bit burried, but context.dagster_run.external_job_origin.external_repository_origin.code_location_origin.code_location_name should be what you want
a
Wow, how would I see a list of fields I an get from
RunFailureSensorContext
? I would have never gone that far searching for it. Few days before, Daniel mentioned about the environment variable
DAGSTER_RUN_JOB_NAME
which was a blessing as it is saving us heaps of time when running the jobs as we load only the job that is running. How can I see list of environment variables that Dagster sets?
o
I believe the DAGSTER_RUN_JOB_NAME is a run-launcher specific thing (where it's not set for all run launchers)
the most reliable thing would probably just be an
env | grep DAGSTER
sort of thing in your prod environment
a
ah thanks for the tip!
Hey @owen, a question regarding the use of variable
DAGSTER_RUN_JOB_NAME
. We have multiple code locations in our instance. When a run is being instantiated, will dagster load all the code definitions in all the code locations or only the specific code location? Earlier, we had one code location with all the jobs in it and use of this variable helped us a lot to save up the process at the time of runs but now that we have split out the code locations, I'm wondering if we still need to use it.
o
Hi! Assuming each of the code locations lives in a different file, then only the specified code location will be loaded in the runtime process
👍 1