Metabase

Integrating your Metabase in Catalog

Requirements

Preferred method: API access to Metabase - only available to Metabase Admins

Only available for Client Managed integrations: Read-only access to your PostgresSQL Metabase system database (doc is here)

If needed, whitelist Catalog IP

Here is our fixed IP: 35.246.176.138

Catalog managed

Please:

  • Input your credentials directly in the App

Using the API:

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

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

If you are not comfortable giving us access to your credentials, please 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's

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

Running the Extraction package

Install the PyPi package

pip install castor-extractor[metabase]

For further details: link

Running the PyPi 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 following:

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:

  • with 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

  • with API connector

    • -b, --base-url: Metabase base url, such http://company.cloud.metabase.com

    • -u, --user: Metabase user

    • -p, --password: Metabase password

Other arguments

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

You can also get help with argument --help

Scheduling and Push to Catalog

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

  • Your source id provided by Catalog, referred as source_id in the code examples

  • Your Catalog Token given by Catalog

The Catalog team will provide you with

  1. Catalog Identifier (an id for us 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 | 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 (*)

Then you'll have to schedule the script run and the push to Catalog, use your preferred scheduler to create this job

You're done!

Last updated

Was this helpful?