dbt Semantic Layer
You can use Lightdash to explore the semantic models you've defined in dbt's Semantic Layer.
Note that this integration is separate to the Lightdash Semantic Layer (which is configured in your dbt project under the meta
tags in your .yml files).
The dbt Semantic Layer integration is only available to Lightdash Cloud users. To have the dbt Semantic Layer integration activated on your account, please message support@lightdash.com.
Connect Lightdash to your dbt Semantic Layer
Before you can connect your dbt Semantic Layer to Lightdash, you need to:
- have an active dbt Cloud account (i.e. a paid dbt Cloud subscription).
- have the dbt Semantic Layer configured** in on of your dbt Cloud projects.
Set up your Semantic Layer Integration
- Click on
settings
-->project connection settings
- From the sidebar, head to
Semantic Layer Integrations
- Select
dbt Semantic Layer
from the list of Semantic Layer integrations
Service token
This is a service token to connect to the project configured with the dbt Semantic Layer. You need to create this service token from your dbt Cloud account.
To generate a service token:
- Go to https://cloud.getdbt.com/next/settings
- From the sidebar, click on
API tokens
-->service tokens
, thencreate new token
- Give your token at least
Semantic Layer Only
permissions and select the project where you've configured the dbt Semantic Layer. - Choose the Semantic Layer Credentials that you want to give to the token.
- Hit
save
Copy-paste the token into Service Token
in the Lightdash Semantic Layer Integration page.
Domain
This is the domain where you dbt Cloud instance is being hosted.
Environment
This is the unique identifier for the dbt production environment. This should match the environment that you selected when you configured your dbt Semantic Layer connection for your dbt Cloud project.
You can get this from the dbt Cloud URL when you navigate to Environments
under Deploy
. If your URL ends with .../environments/222222, your environmentId is 222222.
Run queries using the dbt Semantic Layer
Once you have your dbt Semantic Layer connected to a project in Lightdash, you can explore your Semantic Layer connection by clicking new
--> query using dbt Semantic Layer
.
Build dashboards using dbt Semantic Layer queries
You can save charts from your dbt Semantic Layer queries and use these to build dashboards.
Dashboards can only contain charts from one semantic layer connection. That means charts created using the Lightdash Semantic Layer cannot be used on dashboards that contain charts created from the dbt Semantic Layer.