add: obs models test

This commit is contained in:
WHYTEWYLL 2023-09-05 15:14:40 +02:00
parent ef9a245ea0
commit 841d0b56a5
12 changed files with 175 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{% docs blocks_impacted_array %}
An array of the impacted blocks during the observability run.
{% enddocs %}

View File

@ -0,0 +1,6 @@
{% docs blocks_impacted_count %}
The number of blocks impacted during the observability run.
Impacted is defined as missing or having bad data.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs blocks_tested %}
The number of blocks tested in the observability run.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs max_block %}
The maximum block tested in the range of the observability test run.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs max_block_timestamp %}
The block timestamp of the max block tested in the observability run.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs min_block %}
The minimum block tested in the range of the observability test run.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs min_block_timestamp %}
The block timestamp of the min block tested in the observability run.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs test_name %}
The name of the test for observability models.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs test_timestamp %}
The timestamp of the observability test run.
{% enddocs %}

View File

@ -0,0 +1,43 @@
version: 2
models:
- name: silver_observability__blocks_completeness
description: |-
Observability model that queries the blocks table at a designated interval to record and track the completeness of the data.
tests:
- dbt_utils.recency:
datepart: day
field: test_timestamp
interval: 1
- dbt_utils.recency:
datepart: hours
field: max_block_timestamp
interval: 24
columns:
- name: TEST_NAME
description: "{{ doc('test_name') }}"
- name: MIN_BLOCK
description: "{{ doc('min_block') }}"
- name: MAX_BLOCK
description: "{{ doc('max_block') }}"
- name: MIN_BLOCK_TIMESTAMP
description: "{{ doc('min_block_timestamp') }}"
- name: MAX_BLOCK_TIMESTAMP
description: "{{ doc('max_block_timestamp') }}"
- name: BLOCKS_TESTED
description: "{{ doc('blocks_tested') }}"
- name: BLOCKS_IMPACTED_COUNT
description: "{{ doc('blocks_impacted_count') }}"
- name: BLOCKS_IMPACTED_ARRAY
description: "{{ doc('blocks_impacted_array') }}"
- name: TEST_TIMESTAMP
description: "{{ doc('test_timestamp') }}"

View File

@ -0,0 +1,43 @@
version: 2
models:
- name: silver_observability__chunks_completeness
description: |-
Observability model that queries the blocks table at a designated interval to record and track the completeness of the data.
tests:
- dbt_utils.recency:
datepart: day
field: test_timestamp
interval: 1
- dbt_utils.recency:
datepart: hours
field: max_block_timestamp
interval: 24
columns:
- name: TEST_NAME
description: "{{ doc('test_name') }}"
- name: MIN_BLOCK
description: "{{ doc('min_block') }}"
- name: MAX_BLOCK
description: "{{ doc('max_block') }}"
- name: MIN_BLOCK_TIMESTAMP
description: "{{ doc('min_block_timestamp') }}"
- name: MAX_BLOCK_TIMESTAMP
description: "{{ doc('max_block_timestamp') }}"
- name: BLOCKS_TESTED
description: "{{ doc('blocks_tested') }}"
- name: BLOCKS_IMPACTED_COUNT
description: "{{ doc('blocks_impacted_count') }}"
- name: BLOCKS_IMPACTED_ARRAY
description: "{{ doc('blocks_impacted_array') }}"
- name: TEST_TIMESTAMP
description: "{{ doc('test_timestamp') }}"

View File

@ -0,0 +1,43 @@
version: 2
models:
- name: silver_observability__logs_completeness
description: |-
Observability model that queries the blocks table at a designated interval to record and track the completeness of the data.
tests:
- dbt_utils.recency:
datepart: day
field: test_timestamp
interval: 1
- dbt_utils.recency:
datepart: hours
field: max_block_timestamp
interval: 24
columns:
- name: TEST_NAME
description: "{{ doc('test_name') }}"
- name: MIN_BLOCK
description: "{{ doc('min_block') }}"
- name: MAX_BLOCK
description: "{{ doc('max_block') }}"
- name: MIN_BLOCK_TIMESTAMP
description: "{{ doc('min_block_timestamp') }}"
- name: MAX_BLOCK_TIMESTAMP
description: "{{ doc('max_block_timestamp') }}"
- name: BLOCKS_TESTED
description: "{{ doc('blocks_tested') }}"
- name: BLOCKS_IMPACTED_COUNT
description: "{{ doc('blocks_impacted_count') }}"
- name: BLOCKS_IMPACTED_ARRAY
description: "{{ doc('blocks_impacted_array') }}"
- name: TEST_TIMESTAMP
description: "{{ doc('test_timestamp') }}"