Skip to main content

Set up the dbt Semantic Layer

With the dbt Semantic Layer, you can centrally define business metrics, reduce code duplication and inconsistency, create self-service in downstream tools, and more. Configure the dbt Semantic Layer in dbt Cloud to connect with your integrated partner tool.

Prerequisites

  • Have a dbt Cloud Team or Enterprise account. Suitable for both Multi-tenant and Single-tenant deployment.
    • Note: Single-tenant accounts should contact their account representative for necessary setup and enablement.
  • Have both your production and development environments running dbt version 1.6 or higher.
  • Use Snowflake, BigQuery, Databricks, or Redshift.
  • Create a successful run in the environment where you configure the Semantic Layer.
    • Note: Semantic Layer currently supports the Deployment environment for querying. (development querying experience coming soon)
  • Set up the Semantic Layer API in the integrated tool to import metric definitions.
    • dbt Core or Developer accounts can define metrics but won't be able to dynamically query them.
  • Understand MetricFlow's key concepts, which powers the latest dbt Semantic Layer.
  • Note that the dbt Semantic Layer doesn't yet support SSH tunneling for Postgres or Redshift connections. It also doesn't support using Single sign-on (SSO) for Semantic Layer production credentials, however, SSO is supported for development user accounts.
📹 Learn about the dbt Semantic Layer with on-demand video courses!

Explore our dbt Semantic Layer on-demand course to learn how to define and query metrics in your dbt project.

Additionally, dive into mini-courses for querying the dbt Semantic Layer in your favorite tools: Tableau (beta), Hex, and Mode.

Set up dbt Semantic Layer

You can set up the dbt Semantic Layer in dbt Cloud at the environment and project level. Before you begin:

  • You must be part of the Owner group, and have the correct license and permissions to configure the Semantic Layer:
    • Enterprise plan Developer license with Account Admin permissions. Or Owner with a Developer license, assigned Project Creator, Database Admin, or Admin permissions.
    • Team plan Owner with a Developer license.
  • You must have a successful run in your new environment.
tip

If you've configured the legacy Semantic Layer, it has been deprecated. dbt Labs strongly recommends that you upgrade your dbt version to dbt version 1.6 or higher to use the latest dbt Semantic Layer. Refer to the dedicated migration guide for details.

  1. In dbt Cloud, create a new deployment environment or use an existing environment on dbt 1.6 or higher.

    • Note Deployment environment is currently supported (development experience coming soon)
  2. Navigate to Account Settings and select the specific project you want to enable the Semantic Layer for.

  3. In the Project Details page, navigate to the Semantic Layer section, and select Configure Semantic Layer.

Semantic Layer section in the Project Details pageSemantic Layer section in the Project Details page
  1. In the Set Up Semantic Layer Configuration page, enter the credentials you want the Semantic Layer to use specific to your data platform.

    • Use credentials with minimal privileges. This is because the Semantic Layer requires read access to the schema(s) containing the dbt models used in your semantic models for downstream applications
    • Note, Environment variables such as {{env_var('DBT_WAREHOUSE')}, doesn't supported the dbt Semantic Layer yet. You must use the actual credentials.
Enter the credentials you want the Semantic Layer to use specific to your data platform, and select the deployment environment.Enter the credentials you want the Semantic Layer to use specific to your data platform, and select the deployment environment.
  1. Select the deployment environment you want for the Semantic Layer and click Save.

  2. After saving it, you'll be provided with the connection information that allows you to connect to downstream tools. If your tool supports JDBC, save the JDBC URL or individual components (like environment id and host). If it uses the GraphQL API, save the GraphQL API host information instead.

After configuring, you'll be provided with the connection details to connect to you downstream tools.After configuring, you'll be provided with the connection details to connect to you downstream tools.
  1. Save and copy your environment ID, service token, and host, which you'll need to use downstream tools. For more info on how to integrate with partner integrations, refer to Available integrations.

  2. Return to the Project Details page, then select Generate Service Token. You will need Semantic Layer Only and Metadata Only service token permissions.

Great job, you've configured the Semantic Layer 🎉!

0