BI Platforms Configuration¶
BI platform connections are configured under agent.services.bi_platforms.
Structure¶
The serving DB (the database the BI platform reads from and Datus writes to)
is registered as a regular Datus datasource. The BI platform entry then
references it by name via dataset_db.datasource_ref. This keeps connector
pooling, schema metadata, and credentials shared with the rest of Datus.
agent:
services:
datasources:
# Existing source warehouse (read-only from the BI side)
src_warehouse:
type: starrocks
host: ${SRC_WAREHOUSE_HOST}
port: 9030
username: ${SRC_WAREHOUSE_USER}
password: ${SRC_WAREHOUSE_PASSWORD}
database: warehouse
# Serving DB — Datus writes here, the BI platform reads from here
serving_pg:
type: postgresql
host: 127.0.0.1
port: 5433
database: superset_examples
schema: bi_public
username: ${SERVING_WRITE_USER}
password: ${SERVING_WRITE_PASSWORD}
bi_platforms:
superset:
type: superset
api_base_url: http://localhost:8088
username: ${SUPERSET_USER}
password: ${SUPERSET_PASSWORD}
dataset_db:
datasource_ref: serving_pg # ← references services.datasources.serving_pg
bi_database_name: examples # Superset Database connection name shown in Settings > Database Connections
grafana:
type: grafana
api_base_url: http://localhost:3000
api_key: ${GRAFANA_API_KEY}
dataset_db:
datasource_ref: serving_pg # ← can share the same serving DB
bi_database_name: PostgreSQL # ← Grafana datasource name
agentic_nodes:
gen_dashboard:
bi_platform: superset
dataset_db fields¶
dataset_db is the BI-platform-specific layer on top of a Datus datasource.
It carries only what's BI-specific:
| Field | Required | Description |
|---|---|---|
datasource_ref |
Yes | Name of a services.datasources entry. Datus uses that datasource's connector for both schema introspection and writes. |
bi_database_name |
Recommended | Alias under which the BI platform itself has registered the same DB. gen_dashboard matches it against list_bi_databases() to resolve database_id for create_dataset. |
The legacy inline form (dataset_db: {uri: "..."} or
dataset_db: {type: ..., host: ..., ...}) is no longer accepted —
move the connection fields under services.datasources and reference them
by name.
Selection rules¶
BIFuncTool._resolved_platform resolves the active BI service in this
order — identical to Scheduler and Semantic resolution:
- Explicit
bi_serviceargument at the call site (orbi_platformon the agentic node). - Project-level pin in
./.datus/config.yml'sdashboard:field. - Global
default: trueflag — at most one entry underservices.bi_platformsmay carry it; multiple defaults are rejected at config load time so the user fixes the YAML rather than us silently picking one. - Single-entry shortcut when only one BI service is configured.
- Otherwise raise
Multiple BI platforms configuredso the operator sets a default explicitly.
Set the global default in YAML:
agent:
services:
bi_platforms:
superset:
type: superset
default: true # global default — picked when no project pin set
...
Configuring through the CLI (/services)¶
Run /services inside the Datus REPL to enter the configuration TUI
directly (Dashboard tab by default; pass /services scheduler to land on
the Scheduler tab; /services list keeps the legacy read-only listing).
The two-tab TUI lets you:
- Add a new dashboard with
Enteron the trailing+ Add new dashboardrow. When you pick atypewhose adapter package isn't installed yet (datus-bi-superset,datus-bi-grafana, …), Datus runspip installfor you and hot-reloads the registry — no restart needed. - Edit credentials with
e, delete an entry withx, run a connectivity probe witht. - Set the global
default: trueflag withd. Pressingdon a row marks it as the workspace-wide default and clears the flag from every other entry, so you cannot end up with two defaults. - Pin a project-level default with
p. The pin is written to./.datus/config.ymlasdashboard: <name>and outranks the global flag for the current project only. Presspagain on the pinned row to clear it.
On the first interactive launch, if a section is configured but has no
project pin, Datus auto-pins the only entry (or the one flagged
default: true) to ./.datus/config.yml so subsequent runs are
explicit. When multiple entries are configured without a default, the
launch prompts for a quick choice.
Service definitions are written to ~/.datus/conf/agent.yml, so the same
credentials are shared across every project. Only the active selection is
project-local.
Ownership¶
Dashboard creation is split into three explicit steps:
gen_joborschedulerprepares / refreshes data in the serving DB referenced bydataset_db.datasource_ref.gen_dashboardbuilds the dataset / chart / dashboard on the BI side from tables or SQL datasets that already exist in that BI-registered DB.bi-validationruns post-creation checks automatically throughValidationHook.on_end.
Source DB credentials never leave Datus — Superset / Grafana see only the
serving DB registered under bi_database_name.
Notes¶
services.bi_platformsis the only runtime source for BI credentials.- Top-level
dashboard:is no longer read at runtime. services.datasources.<datasource_ref>must exist beforeservices.bi_platforms.<x>.dataset_db.datasource_refis resolved — Datus validates this at startup and fails loudly if the ref is dangling.