https://dagster.io/ logo
#ask-ai
Title
# ask-ai
a

Andreas

03/07/2024, 10:41 AM
monitored_jobs code location
s

Scout

03/07/2024, 10:41 AM
In the context of Dagster, the
monitored_jobs
parameter is used within sensors to specify which jobs should be monitored for certain events, such as run status changes. According to the documentation,
monitored_jobs
can include
JobDefinition
,
GraphDefinition
,
UnresolvedAssetJobDefinition
,
RepositorySelector
,
JobSelector
, and
CodeLocationSelector
. These allow you to define the scope of the jobs that the sensor will monitor. If you want to monitor jobs within a specific code location, you can use the
CodeLocationSelector
within the
monitored_jobs
parameter to target jobs that are loaded from that code location. This is useful when you have multiple code locations and want to ensure that the sensor is only triggered by jobs from a particular location. Here's a brief explanation of how you might use
monitored_jobs
with `CodeLocationSelector`: - `CodeLocationSelector`: This is used to specify a particular code location that you want to monitor. When you use this within
monitored_jobs
, the sensor will only be triggered by jobs from the specified code location. It's important to note that if you set
monitor_all_code_locations
to
True
, the sensor will monitor all runs in the Dagster instance, and you should not specify
monitored_jobs
or
job_selection
as this will raise an error. Please ensure that you are using the latest version of Dagster, as the
job_selection
parameter is deprecated and will be removed in version 2.0. You should use
monitored_jobs
instead. For specific code examples and more detailed usage, you should refer to the official Dagster documentation or the API reference for sensors.
6 Views