Published May 23, 2023
This blog aims to provide a guide on implementing the Elementary package with dbt. The primary functionalities of this guide focus on:
Elementary is an open-source data observability package designed for data and analytics engineers using dbt. It provides a comprehensive solution for monitoring and ensuring the quality of your dbt projects and data. With Elementary, you can generate data observability reports, detect data anomalies through dbt tests, analyze models' performance, track dbt artifacts and run results, receive Slack alerts for data issues, and explore data lineage to understand the impact and root causes of data problems. By seamlessly integrating with dbt and leveraging its powerful features, Elementary empowers you to gain immediate visibility, take proactive actions, and maintain the integrity of your data pipelines.
Elementary's functionality revolves around its dbt package, which enables data monitoring and collection of dbt artifacts. Configuration for monitoring is done within your dbt project, using dbt macros and models as monitors. The collected data is stored in a dedicated schema called "elementary" in your data warehouse. To generate UI reports and send Slack alerts, Elementary CLI comes into play. This command-line interface simplifies the process of creating reports and ensures timely notifications of data issues. With Elementary, you can effortlessly monitor your dbt projects, detect anomalies, and gain valuable insights into your data's health and performance, enabling you to proactively address issues and optimize your data workflows.
This guide provides instructions for setting up Elementary using dbt's jaffle_shop as an example project.
packages.yml
file in your dbt project directory if it doesn't already exist. Add the following content to include the Elementary package. Depending on your dbt version, you may need to specify a particular version of dbt utils. Refer to the Elementary documentation for version compatibility details. packages:
- package: elementary-data/elementary
version: 0.8.0
dbt deps
dbt_project.yml
file and make the following additions to include Elementary:models:
jaffle_shop:
materialized: table
staging:
materialized: view
elementary:
+schema: "elementary"
# Include the following line if you only want Elementary to run when in a specified environment
+enabled: "false"
dbt run --select elementary
dbt_project.yml
, along with tables for models used with the Elementary package for data monitoring.dbt run-operation elementary.generate_elementary_cli_profile
Result
elementary:
outputs:
default:
type: "<connection_type>"
account: "<account_identifier>"
user: "<username>"
password: "<PASSWORD>"
role: "<role>"
warehouse: "<warehouse_name>"
database: "<database_name>"
schema: "<schema_name>"
pip install elementary-data
edr report