https://dagster.io/ logo
Title
r

R Lucas

05/18/2023, 2:20 PM
Hello, I am working with multiple code locations linked to the same Dagster instance and am trying to setup Microsoft Teams failure sensor using make_teams_on_run_failure_sensor for each code location (only trigger a webhook if any run fails for the sensor code location ONLY). Despite
monitor_all_repositories
being set to
False
by default, it seems like any failure on a given code location will be catched by any
teams_on_run_failure
sensor regardless of the sensor code location.
I am able to replicate with rather simple code locations and can see all failure sensors being triggered regardless of failing asset location. Please find below an sample definition for one of the code location.
from dagster import asset, Definitions, load_assets_from_current_module
from dagster_msteams import make_teams_on_run_failure_sensor
from os import getenv

LOCATION = "a"

# Assets
@asset(name=f"error_asset_{LOCATION}")
def error_asset() -> None:
    raise Exception(f"Error from location {LOCATION}")


defs = Definitions(
    assets  = load_assets_from_current_module(key_prefix=LOCATION),
    sensors=[
        make_teams_on_run_failure_sensor(
            hook_url=getenv("MS_TEAMS_WEBHOOK"),
            dagit_base_url=getenv("DAGIT_URL"),
        )
    ],
)
How can I ensure failure sensor is triggered only for the code location it has been defined for ?
j

jamie

05/18/2023, 3:08 PM
Hey @R Lucas I think this is a bug. Do you mind opening a GH issue with your replication case and I’ll get it to the right people
r

R Lucas

05/18/2023, 3:49 PM
Hello Jamie, An issue has been opened. Thanks for the quick response !