Metabase

🐕‍🦺 Setup guide

This guide will help you set up Metabase as a data source for Zenskar.

🚧

Prerequisites

To connect Metabase with Zenskar, you need:

  • username and password: credentials to authenticate with Metabase instance. This may be used to generate a new session_token, if necessary. An email from Metabase may be sent to the owner's account everytime this is being used to open a new session.
  • session_token: credential token to authenticate requests sent via Metabase API. A session token expires after 14 days by default.
  • instance_api_url: the URL to interact with Metabase instance API, that uses https.

⚙️ Acquire a session token

You can find or create session tokens from Metabase by running the following command:

curl -X POST \
-H "Content-Type: application/json" \
-d '{"username": "[email protected]", "password": "sample_password"}' \
http://localhost:3000/api/session

If you’re working with a remote server, you’ll need to replace localhost:3000 with your server address. This request will return a JSON object with a key called id and the token as value in the form of a UUID or GUID:

{"id":"38f4939c-ad7f-4cbe-ae54-78906daf1234"}

You can use the received token as your session_token when configuring the connector.

🚧

Expiration of tokens

Credential tokens expire after 14 days by default. You need to update your connector configuration with a new token when that happens.

If you are hosting your own Metabase instance, you can configure this session duration on your metabase server by setting the environment variable MAX_SESSION_AGE (in minutes).

❗️

Invalid or expired session token errors

The connector will alert you of an invalid or expired session token by returning a 401 Unauthorized response status code.

Supported streams