marmotdata/starrocks
Discover databases, tables, views and materialized views from StarRocks clusters
The StarRocks plugin discovers databases, tables, views and asynchronous materialized views from StarRocks clusters.
StarRocks speaks the MySQL wire protocol, so the plugin connects to a frontend (FE) node on the query port with the go-sql-driver/mysql driver. It records the details a StarRocks table has and a plain SQL table does not: the key model, the aggregate function of each value column, partitioning, bucketing and the sort key.
Required Permissions
The user needs read access to the databases you want in the catalog:
CREATE USER 'marmot_reader'@'%' IDENTIFIED BY 'your-password';
GRANT SELECT ON shop.* TO 'marmot_reader'@'%';
SHOW CATALOGS, SHOW DATABASES and SHOW CREATE TABLE only return objects the user can read, so a reader with no grants discovers nothing rather than failing.
Catalogs
Discovery runs against one catalog per configuration block. catalog defaults to default_catalog, the cluster's own storage. Naming an external catalog runs SET CATALOG first and discovers the tables it exposes; add a second run to cover a second catalog.
Row Counts
Row counts and sizes come from information_schema.tables, which StarRocks fills in from backend tablet reports. A cluster that has not reported yet, and the starrocks/allin1-ubuntu image in particular, returns 0 for both. Set include_statistics: false to leave them out.
Testing
Unit tests need nothing installed:
go test ./...
The end to end tests run against a real cluster and are skipped unless MARMOT_TEST_STARROCKS_HOST is set. They read a shop database holding the four key models, a view and a materialized view, which starrocks/testdata/seed.sql creates:
docker run -d --name starrocks --memory 4g -p 9030:9030 -p 8030:8030 starrocks/allin1-ubuntu:latest
# wait until SHOW BACKENDS reports Alive: true, about one to three minutes
mysql -h127.0.0.1 -P9030 -uroot < starrocks/testdata/seed.sql
MARMOT_TEST_STARROCKS_HOST=localhost MARMOT_TEST_STARROCKS_USER=root go test ./starrocks -run TestE2E
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick StarRocks from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
hostText RequiredFrontend (FE) hostname or IP address
portNumberFrontend MySQL protocol port
userText RequiredUsername for authentication
passwordSecretPassword for authentication
catalogTextCatalog to discover; an external catalog name switches discovery to it
tlsOne ofTLS mode (false, true, skip-verify, preferred)
databasesList of textDatabases to discover; all when empty
exclude_databasesList of textDatabases to skip
include_columnsYes or noWhether to include column information
include_viewsYes or noWhether to discover views
include_materialized_viewsYes or noWhether to discover asynchronous materialized views
include_statisticsYes or noWhether to include row counts, sizes and column counts
Assets emitted
Metadata this plugin attaches to each discovered asset.
Database
The metadata on a Database asset.
Table
The metadata on Table and View assets.
Column
The per-column fields in an asset's schema.