Ingest dbt-core artifacts into OpenMetadata with the metadata ingest-dbt CLI command, which reads its settings from dbt_project.yml and finds artifacts itself.
Auto Ingest dbt-core
Learn how to automatically ingest dbt-core artifacts into OpenMetadata using the simplified metadata ingest-dbt CLI command that reads configuration directly from your dbt_project.yml file.
This feature eliminates the need for separate YAML configuration files. All configuration is done directly in your existing dbt_project.yml file.
Overview
The metadata ingest-dbt command provides a streamlined way to ingest dbt artifacts into OpenMetadata by:
Reading configuration directly from your dbt_project.yml file
Environment Variables: For security, you can use environment variables instead of hardcoding sensitive values. See the Environment Variables section below for supported patterns.
2. Generate dbt artifacts
cd your-dbt-projectdbt compile # or dbt run
3. Run the ingestion
If you’re already in your dbt project directory:
metadata ingest-dbt
Or if you’re in a different directory:
metadata ingest-dbt -c /path/to/your/dbt-project
Environment Variables
For security and flexibility, you can use environment variables in your dbt_project.yml configuration instead of hardcoding sensitive values like JWT tokens. The system supports three different environment variable patterns:
Alternative: Using .env FilesFor local development, you can create a .env file in your dbt project directory:
# .env file in your dbt project rootOPENMETADATA_HOST_PORT=https://your-openmetadata-server-url/endpointOPENMETADATA_JWT_TOKEN=your-jwt-tokenOPENMETADATA_SERVICE_NAME=your-database-service
Note: The system automatically loads environment variables from .env files in both the dbt project directory and the current working directory. Environment variables set in the shell take precedence over .env file values.
Error Handling: If a required environment variable is not set and no default is provided, the ingestion will fail with a clear error message indicating which variable is missing.
Configuration Options
Required Parameters
Parameter
Description
openmetadata_host_port
OpenMetadata server URL (must start with https://)
openmetadata_jwt_token
JWT token for authentication
openmetadata_service_name
Name of the database service in OpenMetadata
Optional Parameters
Parameter
Default
Description
openmetadata_dbt_update_descriptions
true
Update table/column descriptions from dbt
openmetadata_dbt_update_owners
true
Update model owners from dbt
openmetadata_include_tags
true
Include dbt tags as OpenMetadata tags
openmetadata_search_across_databases
false
Search for tables across multiple databases
openmetadata_dbt_classification_name
null
Custom classification name for dbt tags
Filter Patterns
Control which databases, schemas, and tables to include or exclude:
metadata ingest-dbt [OPTIONS]Options: -h, --help Show help message and exit -c, --dbt-project-path PATH Path to the dbt project directory (default: current directory)
Note: Global options like --version, --log-level, and --debug are available at the main metadata command level:
metadata --version # Show version informationmetadata --log-level DEBUG ingest-dbt -c /path/to/project # Set log levelmetadata --debug ingest-dbt -c /path/to/project # Enable debug mode
Artifacts Discovery
The command automatically discovers artifacts from your dbt project’s target/ directory:
Artifact
Required
Description
manifest.json
✅ Yes
Model definitions, relationships, and metadata
catalog.json
Optional
Table and column statistics from dbt docs generate