https://dagster.io/ logo
Title
a

Arun Kumar

05/18/2023, 8:24 PM
Hi team, Reposting as I didn't get any response on the original thread. Anyone has thoughts on how we can fix this?
j

jamie

05/18/2023, 8:48 PM
Hey @Arun Kumar there might be a better way to do this, but one option is to write a script that lists all of the sensors using
dagster sensor list
and then stops each sensor with
dagster sensor stop [sensor_name]
a

Arun Kumar

05/19/2023, 12:36 AM
Thanks Jamie. How can we identify the sensors that are unloaded? Is there any field in graphQL API that we can use to differentiate?
d

daniel

05/19/2023, 2:19 PM
something like this could work:
query UnloadableSensorsQuery {
    unloadableInstigationStatesOrError(instigationType: SENSOR) {
      ... on InstigationStates {
        results {
          id
         .name
          repositoryName
          repositoryLocationNAme
        }
      }
a

Arun Kumar

05/19/2023, 11:23 PM
Thanks @daniel. Are there any ways we can make the sensor turn off automatically when it is not available in the code location? Or the only way is to stop the unloadable sensors periodically using the above graphQL query?
d

daniel

05/19/2023, 11:24 PM
I think if you set to be automatically running in code then it should go away automatically when it’s no longer in code
a

Arun Kumar

05/19/2023, 11:25 PM
Ah ok. Let me try that. Thanks 🙏