Metabase
Official · maintained by Marmotmarmotdata/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://table/postgresql/orders for a Postgres table), 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
In the UI
Point-and-click, no config file needed.
- 1 Open Runs Create pipeline
- 2 Pick Metabase from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-metabase-pipeline
runs:
- metabase:
host: "<host>"$ marmot ingest -c ingest.yamlNot using plugins? Other ways to populate Marmot
Configuration
12 top-level fields. * marks required fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
host string Metabase URL, for example https://metabase.example.com
api_key password API key (Metabase 0.49 and newer)
username string Username for session login, used when no API key is set
password password Password for session login
include_charts bool Discover questions and metrics as Chart assets
- default
- true
include_models bool Discover models as Data Model Object assets
- default
- true
discover_lineage bool Link cards to the tables and models they read
- default
- true
include_archived bool Include archived dashboards and cards
- default
- false
verify_ssl bool Verify the server's TLS certificate
- default
- true
Assets emitted
Metadata this plugin attaches to each discovered asset.
Dashboard
MetabaseDashboardFieldsThe metadata fields the plugin emits for Dashboard assets.
id intDashboard id in Metabase
collection stringPath of the collection holding the dashboard
collection_id intId of the collection holding the dashboard
creator_id intId of the user who created the dashboard
created_at stringCreation timestamp
updated_at stringLast update timestamp
card_count intNumber of cards placed on the dashboard
archived boolWhether the dashboard is archived
url stringLink to the dashboard in Metabase
Card
MetabaseCardFieldsThe metadata fields the plugin emits for Chart and Data Model Object assets, which Metabase both calls cards.
id intCard id in Metabase
display stringMetabase visualisation, for example bar or scalar
chart_type stringNormalised chart type (Table, Bar, Line, Pie, Area, Scatter, Map, Gauge, Text, Other)
card_type stringCard kind: question, metric or model
query_type stringWhether the card runs SQL (native) or the query builder (query)
database stringName of the Metabase database the card queries
database_id intId of the Metabase database the card queries
table_id intId of the card's source table, for query builder cards
collection stringPath of the collection holding the card
collection_id intId of the collection holding the card
creator_id intId of the user who created the card
created_at stringCreation timestamp
updated_at stringLast update timestamp
archived boolWhether the card is archived
url stringLink to the card in Metabase