Connect Cube
Decision Layer reads metrics and dimensions and queries data through Cube's REST API. Cube owns metric definitions and joins.
Start your project
In the environment where you installed Decision Layer, create and start a team project. If the demo is running, stop it with Ctrl+C first.
bash
decision-layer init my_team
cd my_team
decision-layer serveEnter the connection
Open Sources in the admin console.
- Enter the Cube API URL and authentication method.
- Test the connection and save it.
- Check that the required metrics and dimensions appear in Metrics.
| Cube location | Example API URL |
|---|---|
| Same computer | http://127.0.0.1:4000/cubejs-api/v1 |
| Remote server | https://your-cube.example/cubejs-api/v1 |
| Decision Layer runs inside Docker | http://host.docker.internal:4000/cubejs-api/v1 |
The address must be reachable from the Decision Layer server. Inside a container, localhost refers to that container.
Authentication
For an existing deployment, use a user token issued by that Cube environment. API-secret authentication and sample credentials are for local testing.
Saved credentials are encrypted; environment settings take precedence. See .env.example for connection administration settings.
Troubleshoot
| Symptom | Check |
|---|---|
| Unreachable | /cubejs-api/v1 in the URL, port and network |
| 401 or 403 | Token expiry and access scope |
| No metrics | Deployed Cube models and the user's model access |
| Missing date or variable | Whether Cube defines the required object |