Deploy your metrics
This section explains how you can perform a job run in your deployment environment in dbt Cloud to materialize and deploy your metrics. Currently, the deployment environment is only supported.
-
Once you’ve defined your semantic models and metrics, commit and merge your metric changes in your dbt project.
-
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)
-
To create a new environment, navigate to Deploy in the navigation menu, select Environments, and then select Create new environment.
-
Fill in your deployment credentials with your Snowflake username and password. You can name the schema anything you want. Click Save to create your new production environment.
-
Create a new deploy job that runs in the environment you just created. Go back to the Deploy menu, select Jobs, select Create job, and click Deploy job.
-
Set the job to run a
dbt parse
job to parse your projects and generate asemantic_manifest.json
artifact file. Although runningdbt build
isn't required, you can choose to do so if needed. -
Run the job by clicking the Run now button. Monitor the job's progress in real-time through the Run summary tab.
Once the job completes successfully, your dbt project, including the generated documentation, will be fully deployed and available for use in your production environment. If any issues arise, review the logs to diagnose and address any errors.
What’s happening internally?
- Merging the code into your main branch allows dbt Cloud to pull those changes and build the definition in the manifest produced by the run.
- Re-running the job in the deployment environment helps materialize the models, which the metrics depend on, in the data platform. It also makes sure that the manifest is up to date.
- The Semantic Layer APIs pull in the most recent manifest and enables your integration to extract metadata from it.
Next steps
After you've executed a job and deployed your Semantic Layer:
- Set up your Semantic Layer in dbt Cloud. g
- Discover the available integrations, such as Tableau, Google Sheets, Microsoft Excel, and more.
- Start querying your metrics with the API query syntax.
Related docs
- Optimize querying performance using declarative caching.
- Validate semantic nodes in CI to ensure code changes made to dbt models don't break these metrics.
- If you haven't already, learn how to build you metrics and semantic models in your development tool of choice.