SnowDDL
  • 👋Introduction
  • 🚩Getting started
  • 📋Main features
  • 🪤SnowDDL vs. Declarative DCM
  • In-depth guides
    • 👓Object identifiers
    • 📐Data types
    • 📦Object types
    • 🎭Role hierarchy
    • 🚧Permission model
    • 🔦Other guides
      • Administration user
      • Integrations
      • Inbound shares
      • Object OWNERSHIP
      • Safe & unsafe DDL
      • Dependency management
      • Short hash explained
      • Env Prefix explained
      • Team workflow
      • Limitations & workarounds
      • Fivetran
      • Airbyte
      • Encrypt user passwords
      • Iceberg Tables
  • Basic usage (CLI + YAML)
    • 💻CLI interface
    • 📦YAML configs
      • ACCOUNT PARAMETER
      • ACCOUNT POLICY
      • AGGREGATION POLICY
      • ALERT
      • AUTHENTICATION POLICY
      • BUSINESS ROLE
      • DATABASE
      • DYNAMIC TABLE
      • EVENT TABLE
      • EXTERNAL ACCESS INTEGRATION
      • EXTERNAL FUNCTION
      • EXTERNAL TABLE
      • FILE FORMAT
      • FUNCTION
      • HYBRID TABLE
      • ICEBERG TABLE
      • MASKING POLICY
      • MATERIALIZED VIEW
      • NETWORK POLICY
      • NETWORK RULE
      • PERMISSION MODEL
      • PIPE
      • PLACEHOLDER
      • PROCEDURE
      • PROJECTION POLICY
      • RESOURCE MONITOR
      • ROW ACCESS POLICY
      • SCHEMA
      • SECRET
      • SEQUENCE
      • SHARE (outbound)
      • STAGE
      • STAGE FILE
      • STREAM
      • TABLE
      • TASK
      • TECHNICAL ROLE
      • USER
      • VIEW
      • WAREHOUSE
    • 🏷️YAML placeholders
    • 📬YAML tag !include
    • 🔐YAML tag !decrypt
  • Single DB
    • 🦀Overview
  • Advanced usage (Python)
    • ⚙️Programmatic config
    • 🐍Architecture overview
      • 🔵Blueprints
      • 🟣Config
      • 🟠Parsers
      • 🟢Resolvers
      • 🔴Engine
    • 🏗️Query builder & formatter
  • Breaking changes log
    • 0.45.0 - March 2025
    • 0.41.0 - January 2025
    • 0.37.0 - December 2024
    • 0.36.0 - November 2024
    • 0.33.0 - October 2024
    • 0.27.0 - May 2024
  • Links
    • GitHub repository
    • PyPI package
    • YouTube tutorials
    • Changelog
    • LinkedIn profile
Powered by GitBook
On this page
  • Schema
  • Usage notes
  • Additional privileges
  • Links
  1. Basic usage (CLI + YAML)
  2. YAML configs

ALERT

Config path: /<database>/<schema>/alert/<name>.yaml

Example:

warehouse: al001_wh1
schedule: 1 minute

condition: |-
  SELECT gauge_value
  FROM ${{ env_prefix }}db1.sc1.gauge
  WHERE gauge_value>200

action: |-
  INSERT INTO ${{ env_prefix }}db1.sc1.gauge_value_exceeded_history
  VALUES (current_timestamp())

Schema

  • warehouse (ident) - warehouse used to executed alert

  • schedule (str) - schedule for periodically evaluating the condition for the alert

  • condition (str) - SQL statement that represents the condition for the alert

  • action (str) - SQL statement that should be executed if the condition returns one or more rows

  • comment (str)

Usage notes

  1. SnowDDL only creates alerts. Alerts are initially suspended. You should execute ALTER ALERT ... RESUME via different means to enable alert execution.

  2. Schema objects should be referred using fully-qualified identifiers, with ${{ env_prefix }} placeholder, database name, schema name and object name. It is currently required due to limitations of ALTER ALERT command missing scope during validation of SQL statements.

  3. Alerts can only be created via SnowDDL config. Users with OWNER privilege on specific schemas cannot create custom alerts in such schemas.

Additional privileges

  • owner_warehouse_usage - list warehouses used to execute alerts

  • owner_integration_usage - if you send alert notifications, add name of notification integration here

  • owner_account_grants - Snowflake requires EXECUTE ALERT or EXECUTE MANAGED ALERT privilege to run alerts

Links

PreviousAGGREGATION POLICYNextAUTHENTICATION POLICY

Last updated 2 months ago

Alerts are executed with full privileges of role.

In order for ALERT objects to operate properly, the following additional grants should be added to OWNER role in :

📦
SnowDDL Administrator User
schema config
CREATE ALERT
ALTER ALERT
SHOW ALERTS
Setting up Alerts
Parser & JSON Schema (GitHub)