dbt Core
Validio supports integrating with dbt (data build tool) to validate metadata for test results and model runs. To integrate with dbt Core,
- Add a warehouse credential for the warehouse where your dbt output is stored.
- Add a dbt Core credential which will be used when uploading your dbt files.
- Upload your dbt manifest and run results files to Validio.
- Add dbt sources for monitoring model runs and test results.
Prerequisites for Integrating with dbt Core
You must have the Validio CLI or Validio SDK installed on the machine or image that runs dbt. You can use either service to upload your dbt manifest and run results files to Validio. (Installing the CLI will automatically install the Validio SDK.) For more information, see Getting Started with Developer Toolkit and Validio CLI.
Add a Warehouse Credential
Before creating a dbt Core credential, you must create a valid credential for the warehouse where your dbt output is stored. You will reference this warehouse credential when you configure the dbt Core credential. For specific credential setup instructions, see Data Warehouse Sources and select the relevant warehouse (for example, BigQuery or PostgreSQL).
Add a dbt Core Credential
To add a credential for monitoring dbt sources,
- Navigate to Observability > Credentials and click + Add Credential.
- Under Credential type, select dbt Core Credential.
- Fill in the configuration parameters. For more information, see dbt Core Credential Parameters.
- Click Create.
Validio will perform a validation step. Unlike with the dbt Cloud Credential, Validio cannot automatically fetch the data from your dbt Core account. Instead, you will need to manually upload your dbt files for model runs and test results to Validio.
dbt Core Credential Parameters
Parameter | Description |
---|---|
Credential Type | dbt Core Credential |
Name | Identifier for the credential. This name will be referenced when creating a source. |
Warehouse Credential | Credential for the table where your dbt output is stored. |
Upload dbt Files to Validio
You can use either the Validio CLI or Validio SDK to upload your dbt manifest and run files to Validio.
Upload with Validio CLI
In the Validio CLI, run the validio dbt upload
command as shown in the following example. For available options, refer to the dbt CLI Parameters table.
DBT_CREDENTIAL_ID="my-dbtCore-credential_12345"
validio dbt upload --target-path ./target --job-name local-test --credential-id $DBT_CREDENTIAL_ID
CLI Parameter | Description |
---|---|
credential-id | The ID or name for the dbt Core credential. |
job-name | A unique name or identifier for the job. |
target-path | The path to the manifest and run results JSON files. |
Upload with Validio SDK
The following is an example of how to use the Validio SDK to upload the dbt files to Validio. For available options, refer to the dbt SDK Parameters table.
from validio_sdk.validio_client import ValidioAPIClient
from validio_sdk.graphql_client.input_types import DbtArtifactUploadInput
from pathlib import Path
client = ValidioAPIClient()
client.dbt_artifact_upload(DbtArtifactUploadInput(
credentialId='',
jobName='',
manifest=Path("/tmp/target/manifest.json").read_text*(),
dbt SDK Parameter | Description |
---|---|
credentialID | The ID or name or the dbt Core credential. |
jobName | A unique name or identifier for the job. |
manifest | The contents of the manifest JSON file. |
runResults | The contents of the run results JSON file. |
Add a dbt Source
Validio provides two types of dbt sources that you can add for monitoring dbt runs and tests: dbt Model Runs and dbt Test Results.
To add a dbt source:
- Navigate to Observability > Sources and click + New Source.
- Under Source type, select either dbt Model Runs or dbt Test Results.
- Under Credentials,
- Select Use existing Credential.
- Select the valid credential from the list.
- Under Config,
- Enter a Name for the source.
- Select a Project Name and Job Name.
- Select a Cron preset to specify the polling frequency for the data.
- Under Window, select the Window type, which should be either Tumbling Window or Global Window. For more information, see Configuring Windows.
- Click Continue to create the source.
You can view the summary of the source configuration.
Note
Validio automatically infers the schema and defines default segmentation.
- For dbt Model Runs, the default segment is
model_id
.- For dbt Test Results, the default segments are
model_id
andtest_name
.
Updated 6 months ago