Example alert policy configuration
Dagster+ feature
This feature is only available in Dagster+.
If you prefer to manage your alerts through configuration files instead of the UI, you can create a YAML file using the following snippets and adjust as needed. To sync the file to your Dagster+ deployment, run:
dagster-cloud deployment alert-policies sync -a /path/to/alert_policies.yaml
Asset alert
Alerting when an asset fails to materialize
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends an email when an asset fails to materialize.
  event_types:
  - ASSET_MATERIALIZATION_FAILED
  name: asset-materialization-failure-alert-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a Microsoft Teams webhook when an asset fails to materialize.
  event_types:
  - ASSET_MATERIALIZATION_FAILED
  name: asset-materialization-failure-alert-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a PagerDuty alert when an asset fails to materialize.
  event_types:
  - ASSET_MATERIALIZATION_FAILED
  name: asset-materialization-failure-alert-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a Slack message when an asset fails to materialize.
  event_types:
  - ASSET_MATERIALIZATION_FAILED
  name: asset-materialization-failure-alert-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
Alerting when an asset check fails
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends an email when an asset check fails.
  event_types:
  - ASSET_CHECK_SEVERITY_ERROR
  name: asset-check-failed-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a Microsoft Teams webhook when an asset check fails.
  event_types:
  - ASSET_CHECK_SEVERITY_ERROR
  name: asset-check-failed-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a PagerDuty alert when an asset check fails.
  event_types:
  - ASSET_CHECK_SEVERITY_ERROR
  name: asset-check-failed-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
- alert_targets:
  - asset_key_target:
      asset_key:
      - s3
      - report
  - asset_group_target:
      asset_group: transformed
      location_name: prod
      repo_name: __repository__
  description: Sends a Slack message when an asset check fails.
  event_types:
  - ASSET_CHECK_SEVERITY_ERROR
  name: asset-check-failed-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
Run alert
Alerting when a run fails
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- description: Sends an email when a run fails.
  event_types:
  - JOB_FAILURE
  name: run-alert-failure-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- description: Sends a Microsoft Teams webhook when a run fails.
  event_types:
  - JOB_FAILURE
  name: run-alert-failure-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- description: Sends a PagerDuty alert when a run fails.
  event_types:
  - JOB_FAILURE
  name: run-alert-failure-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- description: Sends a Slack message when a run fails.
  event_types:
  - JOB_FAILURE
  name: run-alert-failure-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
  tags:
    important: 'true'
Alerting when a run is taking too long to complete
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- alert_targets:
  - long_running_job_threshold_target:
      threshold_seconds: 3600
  description: Sends an email when a run is taking too long to complete.
  event_types:
  - JOB_LONG_RUNNING
  name: job-running-over-one-hour-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- alert_targets:
  - long_running_job_threshold_target:
      threshold_seconds: 3600
  description: Sends a Microsoft Teams webhook when a run is taking too long to complete.
  event_types:
  - JOB_LONG_RUNNING
  name: job-running-over-one-hour-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- alert_targets:
  - long_running_job_threshold_target:
      threshold_seconds: 3600
  description: Sends a PagerDuty alert when a run is taking too long to complete.
  event_types:
  - JOB_LONG_RUNNING
  name: job-running-over-one-hour-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
  tags:
    important: 'true'
# alert_policies.yaml
alert_policies:
- alert_targets:
  - long_running_job_threshold_target:
      threshold_seconds: 3600
  description: Sends a Slack message when a run is taking too long to complete.
  event_types:
  - JOB_LONG_RUNNING
  name: job-running-over-one-hour-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
  tags:
    important: 'true'
Code location alert
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- description: Sends an email when a code location fails to load.
  event_types:
  - CODE_LOCATION_ERROR
  name: code-location-error-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
- description: Sends a Microsoft Teams webhook when a code location fails to load.
  event_types:
  - CODE_LOCATION_ERROR
  name: code-location-error-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
- description: Sends a PagerDuty alert when a code location fails to load.
  event_types:
  - CODE_LOCATION_ERROR
  name: code-location-error-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
- description: Sends a Slack message when a code location fails to load.
  event_types:
  - CODE_LOCATION_ERROR
  name: code-location-error-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
Automation alert
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- description: Sends an email when a schedule or sensor tick fails.
  event_types:
  - TICK_FAILURE
  name: schedule-sensor-failure-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
- description: Sends a Microsoft Teams webhook when a schedule or sensor tick fails.
  event_types:
  - TICK_FAILURE
  name: schedule-sensor-failure-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
- description: Sends a PagerDuty alert when a schedule or sensor tick fails.
  event_types:
  - TICK_FAILURE
  name: schedule-sensor-failure-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
- description: Sends a Slack message when a schedule or sensor tick fails.
  event_types:
  - TICK_FAILURE
  name: schedule-sensor-failure-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
Agent unavailable alert
note
Alerting when a Hybrid agent becomes unavailable is only available for Hybrid deployments.
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
- description: Sends an email when a Hybrid agent hasn't sent a heartbeat in the last
    5 minutes.
  event_types:
  - AGENT_UNAVAILABLE
  name: agent-unavailable-alert-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
- description: Sends a Microsoft Teams webhook when a Hybrid agent hasn't sent a heartbeat
    in the last 5 minutes.
  event_types:
  - AGENT_UNAVAILABLE
  name: agent-unavailable-alert-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
- description: Sends a PagerDuty alert when a Hybrid agent hasn't sent a heartbeat
    in the last 5 minutes.
  event_types:
  - AGENT_UNAVAILABLE
  name: agent-unavailable-alert-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
- description: Sends a Slack message when a Hybrid agent hasn't sent a heartbeat in
    the last 5 minutes.
  event_types:
  - AGENT_UNAVAILABLE
  name: agent-unavailable-alert-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli
Credit budget alert
note
The example configuration below can be used in both Serverless and Hybrid deployments.
- Microsoft Teams
- PagerDuty
- Slack
# alert_policies.yaml
alert_policies:
  alert_targets:
  - insights_asset_threshold_target:
      asset_key:
      - s3
      - report
      metric_name: __dagster_dagster_credits
      operator: GREATER_THAN
      selection_period_days: 7
      threshold: 50
  description: Sends an email when a credit budget limit has been exceeded.
  event_types:
  - INSIGHTS_CONSUMPTION_EXCEEDED
  name: credit-budget-alert-email
  notification_service:
    email:
      email_addresses:
      - richard.hendricks@hooli.com
      - nelson.bighetti@hooli.com
# alert_policies.yaml
alert_policies:
  alert_targets:
  - insights_asset_threshold_target:
      asset_key:
      - s3
      - report
      metric_name: __dagster_dagster_credits
      operator: GREATER_THAN
      selection_period_days: 7
      threshold: 50
  description: Sends a Microsoft Teams webhook when a credit budget limit has been
    exceeded.
  event_types:
  - INSIGHTS_CONSUMPTION_EXCEEDED
  name: credit-budget-alert-microsoft_teams
  notification_service:
    microsoft_teams:
      webhook_url: https://yourdomain.webhook.office.com/...
# alert_policies.yaml
alert_policies:
  alert_targets:
  - insights_asset_threshold_target:
      asset_key:
      - s3
      - report
      metric_name: __dagster_dagster_credits
      operator: GREATER_THAN
      selection_period_days: 7
      threshold: 50
  description: Sends a PagerDuty alert when a credit budget limit has been exceeded.
  event_types:
  - INSIGHTS_CONSUMPTION_EXCEEDED
  name: credit-budget-alert-pagerduty
  notification_service:
    pagerduty:
      integration_key: <pagerduty_integration_key>
# alert_policies.yaml
alert_policies:
  alert_targets:
  - insights_asset_threshold_target:
      asset_key:
      - s3
      - report
      metric_name: __dagster_dagster_credits
      operator: GREATER_THAN
      selection_period_days: 7
      threshold: 50
  description: Sends a Slack message when a credit budget limit has been exceeded.
  event_types:
  - INSIGHTS_CONSUMPTION_EXCEEDED
  name: credit-budget-alert-slack
  notification_service:
    slack:
      slack_channel_name: notifications
      slack_workspace_name: hooli