Metabase
Requirements
A Warehouse type integration must already be configured to complete the first ingestion of this integration.
Preferred method: API access to Metabase - only available to Metabase Admins.
Only available for Client Managed integrations: Read-only access to your PostgreSQL Metabase system database. See the Metabase configuration documentation for details.
If Needed, Whitelist Catalog IP
Here are our fixed IPs:
- For instances on app.us.castordoc.com:
34.42.92.72 - For instances on app.castordoc.com:
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 48 h 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.
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 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 ashttp://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 the argument --help.
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 provided by Catalog, referred as
source_idin the code examples - Your Catalog Token given by Catalog
The Catalog team will provide you with:
Catalog Identifier(an id for us to match your Metabase files with your Catalog instance)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 areDBT,VIZ, orWAREHOUSE
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
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.
You are done.