Skip to content

dbt and Git Extensions Public Beta [DOC-862] #6573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/_data/sidenav/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,15 @@ sections:
title: System for Cross-domain Identity Management (SCIM) Configuration Guide
- path: /segment-app/iam/mfa
title: Multi-Factor Authentication (MFA)
- section_title: Extensions
slug: segment-app/extensions
section:
- path: /segment-app/extensions
title: Extensions Overview
- path: /segment-app/extensions/dbt
title: dbt
- path: /segment-app/extensions/git
title: Git
- path: /segment-app/iam/secure-password
title: Picking a Secure Password
- path: /segment-app/set-up-envs
Expand Down
69 changes: 69 additions & 0 deletions src/segment-app/extensions/dbt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: dbt Extension
---

Segment's dbt extension lets you use [Reverse ETL](/docs/connections/reverse-etl/) with your existing dbt labs models and syncs to help centralize model management and versioning, reduce redundancies, and run CI checks to prevent breaking changes.

With Segment's dbt extension, you can:

- Securely connect Segment to the GitHub repository that stores your dbt models.
- Use centralized dbt models to set up Reverse ETL.
- Trigger Reverse ETL syncs from dbt jobs.

This page explains how to set up a dbt Model and then use the model with Reverse ETL.

> info ""
> Extensions, including dbt sync, is currently in public beta and is governed by Segment's [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}.

## Before you begin

Keep the following in mind as you set up the dbt extension:

- The extension supports [dbt Core v1.7](https://docs.getdbt.com/docs/dbt-versions/core-upgrade/upgrading-to-v1.7){:target="_blank"}.
- You can use [Snowflake](/docs/connections/reverse-etl/reverse-etl-source-setup-guides/snowflake-setup/), [Databricks](/docs/connections/reverse-etl/reverse-etl-source-setup-guides/databricks-setup/), [Redshift](/docs/connections/reverse-etl/reverse-etl-source-setup-guides/redshift-setup/), [Postgres](/docs/connections/reverse-etl/reverse-etl-source-setup-guides/postgres-setup/), and [BigQuery](/docs/connections/reverse-etl/reverse-etl-source-setup-guides/bigquery-setup/) as Reverse ETL sources.
- dbt models aren't synchronized from the dbt cloud. The model sync connects to a Git repository that loads models into Segment for use with Reverse ETL.

## Set up Git dbt Models and dbt Cloud

To set up the dbt extension, you'll need:

- an existing dbt account with a Git repository
- (for job syncs:) dbt cloud with jobs already created

### Git repository and dbt Models setup

Follow these steps to connect the Git repository that stores your dbt Models:

1. In your Segment workspace, navigate to **Settings > Extensions**.
2. Click **Set up Git sync**.
3. On the **Configure service credentials** page, select a service and protocol, add your SSH private key or GitHub token, then click **Next**.
4. In the **Connect source** window, select a Reverse ETL warehouse source from the dropdown, then click **Save**.

After you've saved your setup, you can configure your Git repository's settings to your needs by changing the repository, branch, dbt version, default schema, and project path.

### dbt Cloud setup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passive voice


You can also use dbt Cloud to schedule Reverse ETL syncs after a dbt Cloud job successfully runs.

To set up dbt Cloud:

1. In your Segment workspace, navigate to **Settings > Extensions**.
2. Click **Manage dbt Cloud**.
3. Add your dbt Cloud API key, and, optionally, a custom subdomain. Click **Save**.

### Model syncs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passive voice


After you set up dbt, Segment runs an initial sync to load models from your connected Git repository. This initial sync lets you use the most recent models when you set up Reverse ETL. In addition to Segment's initial dbt sync, you can also trigger manual dbt model syncs.

### Use a model with Reverse ETL

After you've successfully set up dbt with a warehouse and connected to your Git repository, you can select dbt models for use with Reverse ETL by following these steps:

1. In your Segment workspace, navigate to **Connections > Sources** and select the Reverse ETL tab.
2. Click **+Add Reverse ETL source** , select your source, then click **Add Model**.
3. Click **dbt Models** as your modeling method, then select and preview a model from the dbt model dropdown.
4. Add a primary key, then click **Preview your model**.
5. Click **Next**.
6. Enter your **Model Name**, then click **Create Model**.

To change a connected model, ensure that you've removed it from all active Reverse ETL syncs.
24 changes: 24 additions & 0 deletions src/segment-app/extensions/git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Git Sync Extension
---

Segment's Git extension lets you manage versioning by syncing changes you make in Sources and Destinations from your Segment workspace to a Git repository.

> info ""
> Extensions, including Git sync, is currently in public beta and is governed by Segment's [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}.

## Set up Git sync

Follow these steps to set up Git sync:

1. In your Segment workspace, navigate to **Settings > Extensions**.
2. Click **Set up Git sync**.
3. On the **Configure service credentials** page, select a service and protocol, add your SSH private key or GitHub token, then click **Next**.

## Working with Git syncs

The Git sync extension syncs [Connections](/docs/connections/) ([Sources](/docs/connections/sources/) and [Destinations](/docs/connections/destinations/)) from Segment to your Git repository.

After you set up the Git sync extension for the first time, Segment performs an initial sync that sends source and destination information in your Segment workspace to the Git repository you connected.

You can run syncs at any time by clicking **Full resync** on the Git sync page. To disable Git sync from the Git sync page, switch the **Enabled** toggle to off.
13 changes: 13 additions & 0 deletions src/segment-app/extensions/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Extensions
---

Extensions integrate third-party tools into your existing Segment workspace to help you automate tasks.

> info ""
> Extensions is currently in public beta and is governed by Segment's [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}. During Public Beta, Extensions is available for Team and Developer plans only. [Reach out to Segment](mailto:friends@segment.com) if you're on a Business Tier plan and would like to participate in the Public Beta.

During public beta, Segment offers the following extensions:

- [dbt models and dbt Cloud](/docs/segment-app/extensions/dbt), which lets you sync models with dbt Labs.
- [Git sync](/docs/segment-app/extensions/git), which you can use to manage versioning and track changes in your Segment workspace.
Loading