Built-in conditions

Condition classes implement specific logic for query check conditions.

Example usage:

checks = [    
    ExecuteDurationCondition(
        name="AnalystDurationCheck",
        notice_duration=60 * 10,  # 10 minutes for notice
        warning_duration=60 * 20,  # 20 minutes for warning
        kill_duration=60 * 30,  # 30 minutes for kill
        query_filter=QueryFilter(
            include_user_name=["ANALYST_*"],
        ),
        enable_kill=True,
        enable_kill_query_filter=QueryFilter(
            exclude_warehouse_name=["ANALYST_SPECIAL_WH"],
        ),
    ),
]

Common arguments

  • name (str) - name, used to distinguish multiple checks of the same type (default: name of condition class)

  • notice_duration (int) - how long query should run to produce result with level NOTICE if it matches other condition, in seconds

  • warning_duration (int) - how long query should run to produce result with level WARNING if it matches conditions, in seconds

  • kill_duration (int) - how long query should run to produce result with level KILL if it matches other condition, in seconds

  • query_filter (QueryFilter) - narrow down scope of condition using filter

  • enable_kill (bool) - should be set to True for queries matching condition and exceeding kill_duration to be actually killed

  • enable_kill_query_filter (QueryFilter) - narrow down scope of query killer using filter

Most condition classes also have specific arguments, which are described on corresponding sub-pages.

Last updated