Skip to main content

dbt Semantic Layer

Lightdash is dbt Semantic Layer ready and the integration is now available in public preview for Lightdash Cloud Pro and Lightdash Cloud Enterprise users. By integrating Lightdash with your dbt Semantic Layer, you can consume dbt metrics in real time and you can be sure you're calculating the exact metrics you see in your other semantic layer-connected tools.

info

Ensure you have access to the dbt Semantic Layer via your dbt Cloud account, follow their getting started guide for more information.

Features:

  • Query your Semantic Layer via the Lightdash UI
  • Dynamically show matching metrics and dimensions based on current selected fields
  • Dimensions are grouped by dbt Entities
  • Modify time granularity for any timegrain dimensions
  • (coming soon) Share & save Semantic Layer to Lightdash dashboards
  • (coming soon) Search field for easier discover of metrics and dimensions

Getting started with dbt Semantic Layer in Lightdash

Our dbt Semantic Layer integration is now available to all Lightdash Cloud Pro and Lightdash Cloud Enterprise customers. To have this activated on your account, please reach out to your Lightdash support team directly or ping us at support@lightdash.com.

Query metrics

Once you're connected, you can head over to the explorer and you'll see a new sidebar showing all the available metrics and dimensions from the dbt Semantic Layer that you can query. To get started, simply select a metric from the list in the sidebar and Lightdash will automatically figure out the correct accompanying dimensions and only show those available for selection.

dbt-semantic-layer-selection-gif

Visualize results

Once you've selected your dimensions and metrics, Lightdash will automatically generate visualizations for you. You can use the full power of the Lightdash visualization library to change and customize these entirely.

The dbt Semantic Layer integration with Lightdash is actively being developed and we're always open to feedback on how it can be improved. Report any bugs directly on our GitHub repository or join the community to join the discussion with the team and have your say on the future feature roadmap for Lightdash.

Configuration for self-hosted users

  1. Add these dbt semantic layer environment variables to your Lightdash deployment https://docs.lightdash.com/self-host/customize-deployment/environment-variables

    1. DBT_CLOUD_DOMAIN (optional): set this if your domain is different from https://semantic-layer.cloud.getdbt.com
    2. DBT_CLOUD_ENVIRONMENT_ID: If your dbt URL ends with .../environments/1234, your environmentId is 1234
    3. DBT_CLOUD_BEARER_TOKEN: https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens
  2. Restart server/lightdash

  3. Click New and then Query using dbt semantic layer, like so:

danger

Once the integration is completed, the dbt semantic layer will be enabled for all organizations and projects.