From 28804c72dddcf48b9964f6c2617f3ac8d8e21d5e Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Sun, 9 Jun 2024 19:06:55 -0700 Subject: [PATCH] Remove warehouse events history --- .changes/5.2.2.md | 7 +++++ CHANGELOG.md | 8 ++++++ dbt_project.yml | 2 +- .../staging/stg_warehouse_events_history.sql | 20 -------------- .../staging/stg_warehouse_events_history.yml | 26 ------------------- 5 files changed, 16 insertions(+), 47 deletions(-) create mode 100644 .changes/5.2.2.md delete mode 100644 models/staging/stg_warehouse_events_history.sql delete mode 100644 models/staging/stg_warehouse_events_history.yml diff --git a/.changes/5.2.2.md b/.changes/5.2.2.md new file mode 100644 index 0000000..e7fe495 --- /dev/null +++ b/.changes/5.2.2.md @@ -0,0 +1,7 @@ +## dbt-snowflake-monitoring 5.2.2 - June 09, 2024 + +### Features + +- Pull out stg_warehouse_events_history ([#159](https://github.com/get-select/dbt-snowflake-monitoring/pull/159)) + + diff --git a/CHANGELOG.md b/CHANGELOG.md index b237090..d6e6407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-snowflake-monitoring 5.2.2 - June 09, 2024 + +### Features + +- Pull out stg_warehouse_events_history ([#159](https://github.com/get-select/dbt-snowflake-monitoring/pull/159)) + + + ## dbt-snowflake-monitoring 5.2.1 - June 09, 2024 ### Features diff --git a/dbt_project.yml b/dbt_project.yml index c203847..8f4f8df 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'dbt_snowflake_monitoring' -version: '5.2.1' +version: '5.2.2' config-version: 2 profile: dbt_snowflake_monitoring diff --git a/models/staging/stg_warehouse_events_history.sql b/models/staging/stg_warehouse_events_history.sql deleted file mode 100644 index 70ac2d7..0000000 --- a/models/staging/stg_warehouse_events_history.sql +++ /dev/null @@ -1,20 +0,0 @@ -{{ config(materialized='incremental') }} - -select - timestamp, - warehouse_id, - warehouse_name, - cluster_number, - event_name, - event_reason, - event_state, - user_name, - role_name, - query_id -from {{ source('snowflake_account_usage', 'warehouse_events_history') }} - -{% if is_incremental() %} - where timestamp > (select coalesce(max(timestamp), '1970-01-01') from {{ this }}) -{% endif %} - -order by timestamp asc diff --git a/models/staging/stg_warehouse_events_history.yml b/models/staging/stg_warehouse_events_history.yml deleted file mode 100644 index fa7b683..0000000 --- a/models/staging/stg_warehouse_events_history.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 - -models: - - name: stg_warehouse_events_history - description: An incrementally materialized copy of the snowflake.account_usage.warehouse_events_history view. It can be used to return the events that have been triggered for the single-cluster and multi-cluster warehouses in your account in the last 365 days (1 year). It contains 1 row per hour per warehouse event. - columns: - - name: timestamp - description: The timestamp when the event is triggered. - - name: warehouse_id - description: The unique warehouse ID (assigned by Snowflake) that corresponds to the warehouse name in your account. - - name: warehouse_name - description: The name of the warehouse in your account. - - name: cluster_number - description: If an event was triggered for a specific cluster in a multi-cluster warehouse, the number of the cluster for which the event was triggered; if the event was triggered for all clusters in the warehouse or is not applicable for a single-cluster warehouse, no value is displayed. - - name: event_name - description: Name of the event. https://docs.snowflake.com/en/sql-reference/account-usage/warehouse_events_history.html#event-name-descriptions - - name: event_reason - description: The cause of the event. https://docs.snowflake.com/en/sql-reference/account-usage/warehouse_events_history.html#event-reason-descriptions - - name: event_state - description: "State of an event that takes time to complete or can be canceled: STARTED, COMPLETED, PARTIALLY_COMPLETED." - - name: user_name - description: User who initiated the event. - - name: role_name - description: Role that was active in the session at the time the event was initiated. - - name: query_id - description: Internal/system-generated identifier for the SQL statement.