marmotdata/metabase
Discover dashboards, charts and models from Metabase, with lineage from the tables they read
The Metabase plugin discovers dashboards, questions, metrics and models from a Metabase instance, and links them to the warehouse tables they read.
Assets
| Metabase object | Marmot type | Name |
|---|---|---|
| Dashboard | Dashboard | <collection path>/<dashboard name> |
| Question, metric | Chart | <collection path>/<card name> |
| Model | Data Model Object | <collection path>/<card name> |
The collection path is the names of the collections from the root down, joined with /, without the root collection itself. Items in the root collection keep their bare name. Numeric ids stay in metadata.
Native (SQL) cards carry their query. Every asset links back to Metabase.
Lineage
- Dashboard CONTAINS every card placed on it.
- Table FEEDS card, and Table FEEDS every dashboard showing the card. Query builder cards name their source table and joins by id; native cards are scanned for the tables after
FROMandJOIN, with[[optional clauses]], CTEs, subqueries and comments ignored, and matched against the tables Metabase has synced for the card's database. - Model or question FEEDS the cards built on it, including
{{#id}}references in native SQL.
Tables are addressed exactly as the warehouse's own Marmot plugin addresses them (for example mrn://asset/table/postgresql/shop.public.orders for a Postgres table, with the database host and port as a hint for picking the zone), so the edges land on the assets that plugin creates. No table assets are created by this plugin; until the warehouse plugin has run, the server drops those edges.
| Metabase engine | Provider | Table name |
|---|---|---|
| postgres, mysql, mariadb, bigquery-cloud-sdk, clickhouse, sqlite | PostgreSQL, MySQL, MariaDB, BigQuery, ClickHouse, SQLite | bare table name |
| athena | Glue | bare table name |
| mongo | MongoDB (type Collection) | bare collection name |
| snowflake, redshift, sqlserver | Snowflake, Redshift, SQL Server | database.schema.table |
| presto-jdbc, starburst, databricks | Trino, Databricks | catalog.schema.table |
| oracle, druid | Oracle, Druid | schema.table |
| anything else (h2, ...) | engine name, first letter upper-cased | schema.table |
Authentication
Set api_key (Metabase 0.49 and newer, created under Settings, Authentication, API keys; the key needs read access to the collections and databases to discover). Without one the plugin logs in with username and password and uses the session for the run.
Supported Versions
Tested against Metabase 0.63. Both the current stages query shape (0.57 and newer) and the older type: native | query shape are read, and ordered_cards is accepted in place of dashcards on servers before 0.48.
Example Configuration
host: "https://metabase.example.com"
api_key: "${METABASE_API_KEY}"
include_charts: true
include_models: true
discover_lineage: true
include_archived: false
Naming
Dashboards, charts and models are named by their own name, and their MRN carries one level per collection holding them, for example mrn://asset/dashboard/metabase/marketing.finance.overview. Set zone when you catalogue more than one Metabase.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick Metabase from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
hostText RequiredMetabase URL, for example https://metabase.example.com
api_keySecretAPI key (Metabase 0.49 and newer)
usernameTextUsername for session login, used when no API key is set
passwordSecretPassword for session login
include_chartsYes or noDiscover questions and metrics as Chart assets
include_modelsYes or noDiscover models as Data Model Object assets
discover_lineageYes or noLink cards to the tables and models they read
include_archivedYes or noInclude archived dashboards and cards
verify_sslYes or noVerify the server's TLS certificate
Assets emitted
Metadata this plugin attaches to each discovered asset.
Dashboard
The metadata fields the plugin emits for Dashboard assets.
Card
The metadata fields the plugin emits for Chart and Data Model Object assets, which Metabase both calls cards.