Skip to main content

Create Evidence connection

We will include one final component downstream of everything we have built. This will visualize some of the data we have been modeling in a dashboard using Evidence. In this step, you will:

  • Integrate with Evidence
  • Build an Evidence deployment asset connected to your model assets

1. Add the Evidence project

We need an Evidence project. We will clone one that is already configured to work with the data we have modeled with dbt:

git clone --depth=1 https://github.com/dagster-io/jaffle-dashboard.git dashboard && rm -rf dashboard/.git

There will now be a directory dashboard within the root of the project.

.
├── pyproject.toml
├── dashboard # Evidence project
├── src
├── tests
│   └── __init__.py
├── transform
└── uv.lock

2. Define the Evidence Component

Let's add the Dagster's Evidence integration:

uv pip install dagster-sling

Now we can scaffold Evidence with dg:

dg scaffold defs dagster_evidence.EvidenceProject dashboard

This will add the directory dashboard to the etl_tutorial module:

src
└── etl_tutorial
├── __init__.py
└── defs
├── __init__.py
└── dashboard
   └── defs.yaml

3. Configure the Evidence component

Unlike our other components which generated individual assets for each model in our project. The Evidence component will register a single asset for the entire Evidence deployment.

However we can still configure our Evidence component to be dependent on multiple upstream assets.

src/etl_tutorial/defs/dashboard/defs.yaml
type: dagster_evidence.EvidenceProject

attributes:
project_path: ../../../../dashboard
asset:
key: dashboard
deps:
- target/main/orders
- target/main/customers
deploy_command: 'echo "Dashboard built at $EVIDENCE_BUILD_PATH"'

Summary

Here is the final structure of the etl_tutorial module:

src
└── etl_tutorial
├── __init__.py
└── defs
├── __init__.py
├── dashboard
│   └── defs.yaml
├── ingest_files
│   ├── defs.yaml
│   └── replication.yaml
├── jdbt
│   └── defs.yaml
├── assets.py
├── resources.py
└── sensors.py

This contains a fully functional data platform that handles the end to end workflows necessary for working with data.