Skip to main content

DBT Integration

Definity's dbt Agent wraps the dbt CLI to provide automatic observability — capturing lineage, metrics, and execution details with no changes to your dbt project.

Quick Start

  1. Install — Add the agent via pip
  2. Configure — Set environment variables
  3. Run — Replace dbt with definity-dbt

Key Features

  • Zero-config lineage — Automatically traces data flow across all your dbt models
  • Change detection — Compiled SQL fingerprinting flags when a model's logic changes between runs
  • End-to-end pipeline tracking — Every step of your dbt workflow tracked in a single unified pipeline view
  • Execution Metrics — Performance and resource monitoring for every model run

Installation

Latest version is 0.5.1 (compatible with dbt 1.5.x–1.11.x)

pip install --extra-index-url=https://user:[email protected]/pypi/simple/ definity-agent-dbt

Generate an Agent Token

In the Definity app, click your user avatar (top right) and select Generate Token.

User menu — Generate Token

Select the Agent token type, optionally add a label, and click Generate. Copy the token.

Generate Agent Token dialog

Environment Variables

Core

NameValueNote
DEFINITY_SERVER_URLhttps://app.definity.runmandatory
DEFINITY_TOKENyour agent tokenmandatory for SaaS
DEFINITY_ENVe.g. prod, stagingoptional

Pipeline Tracking

NameValueNote
DEFINITY_PIPELINE_NAMEdefault - dbt project nameoptional
DEFINITY_PIPELINE_PITdefault - current timelogical point in time
DEFINITY_TASK_NAMEdefault - dbt project nameoptional

Advanced Configuration

NameValueNote
DEFINITY_LOG_LEVELdefault - info
DEFINITY_SERVER_ATTEMPTSdefault - 2
DEFINITY_SERVER_ATTEMPT_SLEEPdefault - 10
DEFINITY_SERVER_TIMEOUTdefault - 5

Usage

Replace dbt with definity-dbt. All dbt flags and arguments pass through unchanged.

definity-dbt seed
definity-dbt run
definity-dbt test

Complete Example

export DEFINITY_SERVER_URL=https://app.definity.run
export DEFINITY_TOKEN=your-token
export DEFINITY_ENV=prod

definity-dbt run --project-dir /path/to/project

Airflow Integration

When running from Airflow, DEFINITY_PIPELINE_NAME, DEFINITY_TASK_NAME, and DEFINITY_PIPELINE_PIT are automatically inherited from the Airflow DAG and task context. No additional configuration needed.