Installing a dbt package is straightforward, but understanding and effectively utilizing the metadata produced by dbt packages can be challenging. Many data engineers and analytics engineers install packages, briefly check the tables, and often uninstall them due to a lack of insight into the package's value. Data engineers may struggle without access to BI dashboards, while analytics engineers might spend days trying to understand how to consume the data.
This application addresses the challenge of harnessing the power of dbt packages and their metadata. It aims to provide easy access to data produced by the semantic layer and dbt packages. The key objectives of this project are:
-
Simplified Data Access: With just the setup of your
dbt_cloud_api_key
, you can effortlessly access dashboards that display the output of dbt packages in a static way. This simplifies the data access process for data engineers and analytics engineers. -
Dashboard Customization: For those who lack access to BI dashboards or need customized data views, this application offers the ability to create and maintain dashboards with visual representations of the dbt package outputs. Analytics engineers can create dashboards that align with their specific needs.
-
DevOps Integration: The application provides a solution for DevOps professionals to incorporate key performance indicators (KPIs) from dbt packages into their existing dashboards. This enables the monitoring of critical metrics and simplifies the process of ensuring data accuracy.
-
Package Value Understanding: By visualizing the data produced by dbt packages, users can better understand the value of each package. This helps in making informed decisions about whether to install, maintain, or uninstall a package.
In summary, this application streamlines the utilization of semantic layer and dbt package data, making it easily accessible for data engineers, analytics engineers, and DevOps professionals. It simplifies data access, allows for customization, and provides valuable insights into the output of dbt packages.
To run the application locally, follow these step-by-step instructions:
-
Clone this repository to your local machine:
git clone https://github.com/infinitelambda/dbt-central-app.git cd dbt-central-app
-
Create a virtual environment for the project. Replace
<venv_name>
with your preferred environment name (e.g., "myenv"):python3 -m venv <venv_name>
Activate the virtual environment:
source <venv_name>/bin/activate
-
Install the required Python dependencies:
pip install -r requirements.txt
-
Open the
config.toml
file in the root directory of the project. -
You can add your
dbt_cloud_api_key
in the configuration file to authenticate if you would like to use dbt cloud's API. Replace<your_api_key>
with your actual API key:[dbt] dbt_cloud_api_key = "<your_api_key>"
-
Navigate to the
src
directory:cd src
-
Once in the
src
directory, start the Streamlit application with the following command:streamlit run app.py
The application should now be running locally, and you can access it through your web browser.
Defining a Dashboard
To define a dashboard in your application, follow these steps:
-
Dashboard Name: Choose a unique name for your dashboard.
- Example:
Data Quality Tools Dashboard
- Example:
-
Dashboard Title: Set a title for your dashboard, which is displayed in the application.
- Example:
Data Quality Overview
- Example:
-
Dashboard Description: Provide a description for your dashboard. You can include additional information or links.
- Example:
Make simple storing test results and visualization of these in a BI dashboard. 👉 [Data Quality Tools](https://infinitelambda.github.io/dq-tools/)
- Example:
-
Package Name: Specify the package name for your dashboard to organize it within your application.
- Example:
dq-tools
- Example:
-
Assets: Define the assets that will be displayed on the dashboard. Each asset represents a specific metric or visualization.
- Asset Name: Choose a unique name for the asset within the dashboard.
- Asset Title: Provide a title for the asset displayed within the dashboard.
- Asset Type: Specify the type of asset (e.g., "indicator," "table," "line_chart").
- Metrics: List the metrics that should be displayed on the asset.
Example:
assets: - name: Data Quality Score title: Data Quality Score description: Average value of `records_passed / records_scanned` metric: data_quality_score type: indicator - name: Data Quality Score over Time title: Data Quality Score over Time description: Average scoring every day metric: data_quality_score type: line_chart sort_by: METRIC_TIME__MONTH ascending: True x: METRIC_TIME__MONTH y: DATA_QUALITY_SCORE - name: dpe_undocumented_models_group_by title: Undocumented Models description: | `fct_undocumented_models` [(source)](https://github.com/dbt-labs/dbt-project-evaluator/blob/main/models/marts/documentation/fct_undocumented_models.sql) lists every model with no description configured. 👉 Docs [dbt project evaluator docs](https://dbt-labs.github.io/dbt-project-evaluator/0.8/rules/documentation/#undocumented-models) metric: met_dpe_undocumented_models type: table group by: ent_fct_undocumented_models__resource_name,ent_fct_undocumented_models__model_type
-
Save your dashboard configuration.
Configuring Assets and Metrics
Assets within a dashboard represent individual components displaying specific metrics or visualizations. To configure an asset, follow these steps:
-
Asset Name: Choose a unique name for the asset within the dashboard.
- Example:
Data Quality Score
- Example:
-
Asset Title: Provide a title for the asset, which is displayed within the dashboard.
- Example:
Data Quality Score
- Example:
-
Asset Type: Specify the type of asset, such as "indicator," "table," or "line_chart."
-
Description: Optionally, provide a description for the asset to offer additional context or information.
-
Metrics: Associate the asset with specific metrics by specifying the metric's name.
Example:
metrics: data_quality_score
-
Depending on the asset type, you may have additional configuration options, such as "sort_by," "ascending," "x," and "y." Customize these as needed.
-
Save your asset configuration.
This guide should help you set up and run the application locally, accessing dbt project data effortlessly. If you have any questions or face issues during the setup, feel free to reach out for assistance.