dbt Cloud

📘

Prerequisites

Requires admin privileges for the dbt Cloud account that hosts and runs your production dbt models

To connect Monte Carlo to a dbt Cloud account, follow these steps:

  1. Install the Monte Carlo CLI
  2. Obtain a dbt Cloud API token and account ID
  3. Create a dbt Cloud integration with the Monte Carlo CLI

Install the Monte Carlo CLI

Please follow this guide to install and configure the CLI.

Obtain a dbt Cloud API token and account ID

Please follow the instructions in dbt Cloud's API documentation to create a dbt Cloud API token. This token will be needed when creating the integration with the Monte Carlo CLI.

To obtain your dbt Cloud account ID, sign into dbt Cloud in your browser. Take note of the number directly following the accounts path component of the URL -- this is your account ID. For example, if the URL is https://cloud.getdbt.com/#/accounts/1234/projects/6789/dashboard/, the account ID is 1234.

Create a dbt Cloud integration with the Monte Carlo CLI

  1. Choose a warehouse to link with your dbt Cloud:
    • If you only have a single warehouse integrated with Monte Carlo, proceed to step two.
    • Otherwise, you will need to select a warehouse to link with the dbt Cloud integration. Use montecarlo integrations list to list out all available connections, and take note of the ID of the warehouse that is used as the target for your dbt Cloud production models.
  2. Add a dbt Cloud integration:
    • Run:
      montecarlo integrations add-dbt-cloud \
        --dbt-cloud-api-token <dbt Cloud API token> \
        --dbt-cloud-account-id <dbt Cloud account ID> \
        --connection-id <connection ID of warehouse>
      
      The --connection-id argument is required if you have multiple warehouses integrated -- supply the chosen warehouse connection from step (1).
      If you prefer a prompt (with hidden input), supply -1 as an argument to --dbt-cloud-api-token
    • Monte Carlo will perform a validation step to ensure that the dbt Cloud account can be successfully accessed. If validation passes, you will be prompted to create the dbt Cloud integration. If validation fails, please double-check that you provided the correct API token and account ID.

At this point, the integration has been created. By default, Monte Carlo will poll your dbt Cloud account hourly to import the latest manifests and run results, across all projects and jobs.


Did this page help you?