Andreas
03/07/2024, 12:54 PMScout
03/07/2024, 12:54 PMmonitored_jobs
parameter is used to specify which jobs a sensor should monitor, and it accepts a list of job definitions, graph definitions, or selectors such as RepositorySelector
, JobSelector
, or CodeLocationSelector
. If you want to monitor all jobs in a Dagster instance, you can use the monitor_all_code_locations
parameter instead of monitored_jobs
. Setting monitor_all_code_locations
to True
will configure the sensor to monitor all runs in the Dagster instance. However, it's important to note that if monitor_all_code_locations
is set to True
, you should not specify monitored_jobs
or job_selection
, as doing so will raise an error. Here's an example of how you might configure a sensor to monitor all jobs: python @sensor def my_sensor(context): # Sensor logic here pass my_sensor = my_sensor.configured({ "monitor_all_code_locations": True })
In this example, my_sensor
is configured to monitor all runs in the Dagster instance. If you want to monitor specific jobs, you would provide them in the monitored_jobs
parameter as a list of JobSelector
or other appropriate selectors. Please adjust your configuration according to these guidelines. If you need to monitor specific jobs, you would need to provide a list of selectors that match those jobs. If you want to monitor all jobs, use the monitor_all_code_locations
parameter with a value of True
.