> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt observability layer

> See which Hightouch syncs are using your dbt models from your dbt docs and lineage graph.

Hightouch provides two separate features to monitor your dbt models as they relate to Hightouch syncs:

* [dbt CI checks](#dbt-ci-checks)
* [dbt exposure sync](#dbt-exposure-sync)

You can use either one or both of these features together. Both require that you've [set up dbt-based models](https://docs.hightouch.com/extensions/dbt-models.md) in Hightouch.

## dbt CI checks

<video controls src="https://cdn.sanity.io/files/pwmfmi47/production/8e2d00e0f289dc7341537dd68b8a2ce4fa251841.mp4" poster="https://cdn.sanity.io/images/pwmfmi47/production/30fa52a12054367ea83d598a9d61bf5d9b397d52-5120x2880.webp" title="Learn about dbt CI Checks" />

> [!NOTE]
>
> The dbt CI checks feature doesn't currently work with [Customer
> Studio](https://docs.hightouch.com/customer-studio/overview.md) models.

You can use Hightouch's **dbt CI checks** to validate changes in your dbt project Git repository. This feature checks your GitHub pull requests to ensure they don't break any existing, [enabled](https://docs.hightouch.com/syncs/overview.md#individual-sync-overview-page) dbt-based syncs in Hightouch.

To enable this, toggle on **GitHub Pull Request checks** from your dbt connected source's [configuration page](https://app.hightouch.com/extensions/dbt-models/configuration?from=docs) and then select **Save**. You need to do this for every connected source you want to enable CI checking on.

Once enabled, Hightouch runs a CI check on any pull request made to the dbt project's Git repository. If a breaking change is detected—for example, deleting, renaming, or moving a model used in a sync—the check fails.

![Failed dbt CI check](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/dbt-failed-code-check.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=4761eaab9455269f1e1ee26fafec04a4)

Clicking into the details of a failed CI check shows which sync the breaking change effects.

![Failed dbt CI check details](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/dbt-code-checks-broken-sync.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=63e5bc66be8000fb86297d9e4a45509f)

The CI check passes if the pull request doesn't affect any [enabled](https://docs.hightouch.com/syncs/overview.md#individual-sync-overview-page) Hightouch syncs.

> [!NOTE]
>
> Though dbt CI checks work similarly to [version control with Git
> Sync](https://docs.hightouch.com/extensions/git-sync.md#validate-changes), these are separate features and
> aren't dependent on one another.

## dbt exposure sync

<video controls src="https://cdn.sanity.io/files/pwmfmi47/production/49b8cec8d4a0f1e642e8ebaf01bd46abdf99333e.mp4" poster="https://cdn.sanity.io/images/pwmfmi47/production/30fa52a12054367ea83d598a9d61bf5d9b397d52-5120x2880.webp" title="Learn about dbt exposures" />

Hightouch exposure sync lets you see which Hightouch syncs are using your dbt models via your dbt docs and lineage graph.

![dbt Lineage graph without exposure sync](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/exposures-lineage-before.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=381ed13e48398218f712ff37f1cc5af1)

![dbt Lineage graph with exposure sync](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/exposures-lineage-graph.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=70da31ea7949ddcbadb918277039eba4)

Exposure sync works by defining and updating exposures in your chosen dbt repository anytime a Hightouch sync that uses a dbt model is added or modified.

### Turn on exposure sync

You can enable exposure sync by navigating to **dbt Models** on the [**Extensions page**](https://app.hightouch.com/extensions?from=docs) and selecting your **dbt Connected Source**. From there, activate the **dbt Exposures Sync** toggle and click **Save**.

You should see exposures starting to sync within a few minutes.

![Turning on dbt Exposure Sync in Hightouch](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/dbt-enable-exposures.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=e925dd5e6f66b42794b4cc0eef9dc299)

In your dbt repository, you should see a new file called `hightouch_sync_exposures.yml`. This file updates every time a Hightouch sync that uses a dbt model is added, modified or disabled.

![GitHub commit screenshot](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/exposures-commit.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=bd55ab398ab7f00935f84ff113e26ec0)

> [!TIP]
>
> Exposures will be created for syncs using audiences created with Customer
> Studio where the [parent
> model](https://docs.hightouch.com/customer-studio/schema.md#create-the-parent-model) is a dbt model. If an
> audience references [related or event
> models](https://docs.hightouch.com/customer-studio/schema.md#add-a-related-model) that are built with dbt
> models, this information won't be included in the exposure file. If you'd like
> to request this functionality, please&#x20;
>
> [reach out to customer support](#pylon-chat)
>
> .

## Tips and troubleshooting

### Git credentials

If your Git credentials are out of date, you won't be able to connect your dbt models and analyses. We recommend using [Hightouch's GitHub app](https://github.com/apps/hightouch-connect/) for your credentials if you're using GitHub.

![Git credential error](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/git-credential-error.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=1efba5d4f21f44947c0ec7cc28d6d1c0)

The Hightouch GitHub app must have commit access to your chosen dbt branch to create exposures. If Hightouch is unable to push to your branch you may have to update your branch protection rules in your dbt GitHub repository.

### dbt build errors

The Hightouch exposures file is intended to stop you from breaking Hightouch syncs as a result of deleted dbt models. If you need to delete a model defined in the Hightouch exposures file, you can remove the Hightouch exposures file at any point—Hightouch will automatically recreate it.

### Your local changes to the following files would be overwritten by checkout

This error generally occurs if the **exposure sync branch** in your linked Git repository has diverged from your main branch.

![Git branches](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/git-branches.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=207b8df2856ca35cb799731fc04526a3)

Once you update your exposure branch so that it's up-to-date with your main one, it should resolve the error. You can find more information on how you can resolve this type of error in this [Stack Overflow article](https://stackoverflow.com/questions/22424142/error-your-local-changes-to-the-following-files-would-be-overwritten-by-checkou).

### Remote rejected, protected branch hook declined

You may receive this error if you have [branch protections](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) on the **branch** you selected for you [exposure sync configuration](#turn-on-exposure-sync).
To avoid this, you can select a branch to use for exposure syncs specifically.

![Git branches](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/integrations/exposure-sync-branch.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=b395a3907e61e832b616aac5e6f9b64c)

Then, you can open a pull request from the dbt exposure sync branch to your main dbt branch.
This allows the exposure sync with Hightouch to operate smoothly while also allowing branch protection rules to be applied to the main branch.

> [!TIP]
>
> You can read more about a similar error in [this
> section](https://docs.hightouch.com/extensions/git-sync.md#protected-branch-update-failed) of the Git Sync
> page.
