Skip to main content

Metabase

Integrate Metabase into Coalesce Catalog so dashboard and metadata content stays available alongside your warehouse lineage.

Requirements

Warehouse Integration Required

A Warehouse type integration must already be configured to complete the first ingestion of this integration.

Catalog ingests Metabase metadata using one of two technical paths: the Metabase HTTP API, or read-only SQL against the PostgreSQL database Metabase uses as its application database. Metabase stores questions, dashboards, and collections there. That PostgreSQL instance is not your warehouse.

How you connect breaks down along two choices: the connector and whether extraction is Catalog managed or client managed. The connector is either the API or the PostgreSQL application database. Catalog managed means credentials live in the Coalesce App. Client managed means you run the extractor. Use this table to match your setup to the connector:

SetupConnectorWhat you use
Catalog managedMetabase APIJSON credentials in the Coalesce App. See Catalog Managed.
Client managedMetabase APIcastor-extract-metabase-api with API credentials. See Client Managed.
Client managedPostgreSQL application databasecastor-extract-metabase-db with read-only PostgreSQL credentials for Metabase application tables. See Client Managed.

Metabase API Prerequisites

For Catalog managed onboarding or the API extraction script, the Metabase account must meet Metabase privilege requirements for metadata access through the API. The castor-extractor documentation refers to this as the Metabase superuser role. That is a permission on the Metabase account, not a requirement tied to a person's job title. For API limitations such as popularity metrics, see Metabase package documentation.

PostgreSQL Application Database Path

Read-only access to the PostgreSQL instance Metabase uses for application metadata applies when you run client-managed extraction with castor-extract-metabase-db. Catalog managed onboarding does not collect PostgreSQL host or database credentials for Metabase. See Metabase configuration documentation for how Metabase configures its application database.

Allowlist Catalog IP

Here are our fixed IPs:

Catalog Managed

You can enter your credentials directly in the Coalesce App.

Using the API:

{
"baseUrl": "http://company.cloud.metabase.com",
"user": "catalog",
"password": "abcdefgh"
}

For your first sync, it will take up to 48 hours and we will let you know when it is complete.

If you are not comfortable giving us access to your credentials, continue to Client Managed.

Client Managed

Doing a One-Shot Extract

For your trial, you can simply give us a one-shot view of your BI tool.

To get things working quickly, here is a Google Colab to run our package swiftly.

Running the Extraction Package

Install the PyPI Package

pip install castor-extractor[metabase]

For further details, see the castor-extractor installation instructions.

Run the Package

Once the package has been installed, you should be able to run the following command in your terminal:

castor-extract-metabase-db [arguments]

# or, if you use the API connector:
castor-extract-metabase-api [arguments]

The script will run and display logs as follows:

INFO - Getting session_id: {'id': '****'}
INFO - Fetching USER (15 results)
INFO - Wrote output file: /tmp/catalog/1649081473-user.json
INFO - Fetching COLLECTION (41 results)

...

INFO - Wrote output file: /tmp/catalog/1649081473-dashboard_cards.json
INFO - Wrote output file: /tmp/catalog/1649081473-summary.json

Credentials

You can sign in using one of the following methods:

  • Postgres connector
    • -H, --host: Host name where the server is running
    • -P, --port: TCP/IP port number
    • -d, --database: Database name
    • -s, --schema: Schema name where the views or tables are located
    • -u, --user: User
    • -p, --password: Password
    • -o, --output: Directory to write to
    • --require_ssl: Flag to require SSL
  • API connector
    • -b, --base-url: Metabase base URL, such as http://company.cloud.metabase.com
    • -u, --user: Metabase user
    • -p, --password: Metabase password

Other Arguments

  • -o, --output: target folder to store the extracted files

Run any extractor command with --help to list all arguments.

Scheduling and Push to Catalog

When moving out of trial, you will want to refresh your Metabase content in Catalog. Here is how to do it:

  • Your source id from Catalog. In the code examples, this value is called source_id.
  • Your Catalog Token from the Catalog team

The Catalog team will provide you with:

  1. Catalog Identifier: An id we use to match your Metabase files with your Catalog instance
  2. Catalog Token: An API token

You can then use the castor-upload command:

castor-upload [arguments]

Arguments

  • -k, --token: Token provided by Catalog
  • -s, --source_id: account id provided by Catalog
  • -t, --file_type: source type to upload. Currently supported are DBT, VIZ, or WAREHOUSE

Target Files

To specify the target files, provide one of the following:

  • -f, --file_path: to push a single file

or

  • -d, --directory_path: to push several files at once
Directory Contents

The tool will upload all files included in the given directory.

Make sure it contains only the extracted files before pushing.

Then you will have to schedule the script run and the push to Catalog. Use your preferred scheduler to create this job.

After you schedule the extractor runs and uploads, Metabase content stays current in Catalog.