Install Elementary dbt package
To start using Elementary to monitor you tests, executions and data, you need to add our dbt package to your dbt project.
How to install Elementary dbt package?
Install dbt package
1. Add elementary to packages.yml
Add the following to your packages.yml
file (if missing, create it where dbt_project.yml
is):
Make sure to copy the packages that are relevant to your dbt version.
For dbt 1.3.0 and above:
packages:
- package: elementary-data/elementary
version: 0.8.0
## Docs: https://docs.elementary-data.com
For dbt >=1.2.0 <1.3.0:
packages:
- package: elementary-data/elementary
version: 0.8.0
## Docs: https://docs.elementary-data.com
## !! Important !! For dbt >=1.2.0 \<1.3.0 ##
## (Prevents dbt_utils versions exceptions) ##
- package: dbt-labs/dbt_utils
version: [">=0.8.0", "<1.0.0"]
For dbt >=1.0.0 <1.2.0:
packages:
- package: elementary-data/elementary
version: 0.8.0
## Docs: https://docs.elementary-data.com
## !! Important !! For dbt <1.2.0 ##
## (Prevents dbt_utils versions exceptions) ##
- package: dbt-labs/dbt_utils
version: [">=0.8.0", "<0.9.0"]
2. Add to your dbt_project.yml
This means Elementary models will have their own schema.
Depending on your project custom schema rules (see dbt custom schema docs), the schema will be named elementary
or <target_schema>_elementary
(being <target_schema> = analytics
very often).
Make sure your user (or the orchestrator user) has permissions to create schemas. If not, ask your admin to create both schemas and grant permissions to the relevant users / groups.
models:
## see docs: https://docs.elementary-data.com/
elementary:
## elementary models will be created in the schema '<your_schema>_elementary'
+schema: "elementary"
## To disable elementary for dev, uncomment this:
# enabled: "{{ target.name in ['prod','analytics'] }}"
3. Import the package
dbt deps
4. Run to create the package models
dbt run --select elementary
This will mostly create empty tables, that will be updated with artifacts, metrics and test results in your future dbt executions.
5. Run tests
dbt test
You can also run only some tests. Only tests you run after the installation will show up in the UI.
After you ran your tests, we recommend that you ensure that the results were loaded to elementary_test_results
table.
What happens now?
Once the elementary dbt package has been installed and configured, your test results, run results and dbt artifacts will be loaded to elementary schema tables.
If you see data in these models you completed the package deployment (Congrats! 🎉).