Apache Cloudberry Command Center is a diagnostic and monitoring agent for Apache Cloudberry clusters. It collects query and session telemetry from the database (via the gp_stats_collector extension), aggregates it across Coordinator and Segment hosts, and exposes it over gRPC for real-time and historical use.
- Collects query and session telemetry from the database (via the gp_stats_collector extension).
- Aggregates it across Coordinator and Segment hosts.
- Exposes it over gRPC for real-time and historical use.
- Provides an HTTP CSV export API mirroring the gRPC GetGPInfo service for easy scripting and spreadsheet integration.
- Optionally archives telemetry (sessions, statements, segments) to ClickHouse via native batch inserts, running as a fan-out target alongside the file archive writer.
- Web UI — a browser-based Command Center for monitoring sessions, queries, cluster health, and managing resources (terminate sessions/queries, move queries between resource groups).
| Document | Description |
|---|---|
| Service architecture | Services, roles, interfaces (UDS, TCP, libpq, HTTP), data flow, and default listen ports. |
| Architecture overview | High-level design and system diagram (with Mermaid). |
| API description | gRPC API reference (GetGPInfo, ActionService), CSV HTTP API, messages, and metrics. |
| Per-process resource statistics | Procfs (GetPidProcStat) data flow per running query and proposed coordinator-only 5/15/30-minute top-style averages (per-session and cluster-wide rollup). |
| Troubleshooting | Lockfile location, permissions, and configuration. |
| Performance tuning | Memory limits (GOMEMLIMIT), config knobs (procfs, segment pull, stored queries, aggregation), Prometheus metrics reference, and pprof profiling guide. |
| Historical stats flow | Archive writer pipeline: file and ClickHouse fan-out targets, writers.targets config, and the ClickHouse schema/DDL. |
Prerequisites:
- Go 1.25+ (see
go.mod). - protoc compiler (see https://protobuf.dev/installation/
apt install -y protobuf-compiler) protoc-gen-go,protoc-gen-go-grpc, andbufCLI are auto-installed by the Makefile (go installin thegenprototarget); just make sure$GOPATH/bin(usually~/go/bin) is in yourPATH.- protoc-gen-go, use https://protobuf.dev/reference/go/go-generated/
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - protoc-gen-go-grpc, use
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - buf CLI, install with
go install github.com/bufbuild/buf/cmd/buf@v1.71.0
- protoc-gen-go, use https://protobuf.dev/reference/go/go-generated/
- Node.js 18+ and npm (only needed for building the web UI)
Build the binary (generates protos and outputs to devbin/yagpcc):
make buildBuild with the web UI embedded:
make build-allOr build the UI separately and then the Go binary:
make build-ui # builds web/ → copies dist to internal/httpui/dist
make build # compiles Go binary with embedded UI assetsOr build without regenerating protos:
go build -o devbin/yagpcc ./cmd/serverThe binary is produced at devbin/yagpcc.
The executable, yagpcc.yaml configuration filename, and existing YAGPCC_*
environment variables retain their current names.
The application reads yagpcc.yaml from the current working directory by default. A valid config file is required to run. Use --config-path to specify a different directory.
Config files differ by role:
- Coordinator — runs on the Apache Cloudberry coordinator host: connects to the cluster, pulls data from segments, and exposes the aggregated gRPC API. Requires
role: coordinatorandcoordinator_connection(and typicallysegment_pull_rate_sec,segment_pull_threads). - Segment — runs on each segment host: collects local metrics and serves them to the coordinator. Requires
role: segmentandlisten_port.
Example configs are in cmd/server/:
| File | Role | Use as |
|---|---|---|
cmd/server/yagpcc_coordinator.yaml |
coordinator | Template for coordinator node: set coordinator_connection.addrs, coordinator_connection.password, and optionally sslrootcert. |
cmd/server/yagpcc_segment.yaml |
segment | Template for segment nodes. |
No CA bundle is shipped with the source. If your coordinator TLS configuration
requires a custom CA certificate, set coordinator_connection.sslrootcert to the
CA file supplied by your cluster operator.
Copy or adapt the right file to yagpcc.yaml in the directory from which you will run the binary, or use --config-path to point to its location (see Running).
Minimal structure:
Coordinator (yagpcc.yaml):
role: coordinator
listen_port: 1432
segment_pull_rate_sec: 3
segment_pull_threads: 2
coordinator_connection:
addrs:
- host1:6432
- host2:6432
sslmode: allow
password: "your_password"
app:
logging:
level: debugSegment (yagpcc.yaml):
role: segment
listen_port: 1432
app:
logging:
level: debugAdjust listen_port, logging, and other options as needed (see internal/config/config.go for full options).
The agent's uds_file defaults to /tmp/gpsc_agent.sock, matching the default
gpsc.uds_path in Cloudberry's gp_stats_collector extension. Both paths must
match on each host for query telemetry to reach the agent.
If you customize the collector's gpsc.uds_path, set uds_file to the same path
in the local agent's yagpcc.yaml:
uds_file: /path/to/collector.sockWhen upgrading an existing deployment, check for an explicit uds_file setting:
it overrides the default and must still match gpsc.uds_path.
To enable the web UI, add ui_port to the coordinator config:
ui_port: 1441The UI is disabled by default (ui_port: 0). When enabled, the web UI is available at http://[::1]:1441/.
The coordinator can archive telemetry to ClickHouse in addition to (or alongside) the file writer. Add a clickhouse entry to writers.targets and the top-level clickhouse: block for schema management. The ClickHouse password may be supplied out of the config file via the YAGPCC_CH_PASSWORD environment variable. See Historical stats flow for a full example and the schema layout.
The binary exposes schema-management subcommands (they exit after running, and are intended for operator scripts/CI):
| Flag | Effect |
|---|---|
--dump-schema |
Print the cumulative ClickHouse DDL to stdout and exit (no connection required). Add --replicated for the clustered ReplicatedReplacingMergeTree + ON CLUSTER + Distributed variant. |
--dump-migration --from N --to M |
Print the SQL to migrate the schema between versions and exit (no connection required). |
--migrate-only |
Load the config, connect to ClickHouse, apply pending migrations, and exit. |
--verify-schema |
Load the config, connect to ClickHouse, verify the schema version, and exit. |
Exit codes: 0 on success, 2 on failure. The --migrate-only/--verify-schema commands always render the standalone (non-clustered) DDL; the clustered variant is bootstrapped out of band.
The current schema version is 2. It adds the plan_json / analyze_json columns to
statements_part and segments_part (empty string when the extension sends no payload,
NULL only for rows written before the upgrade).
Upgrading to schema v2: run the migration before starting the new binary. The service start
path does not migrate, and --verify-schema reports an upgrade requirement until it is applied.
yagpcc --config-path /etc/yagpcc --migrate-only- Use a config file for the correct role (coordinator or segment) and save it as
yagpcc.yamlin the directory where you will run the binary. - From that directory, run:
./devbin/yagpccBy default, the binary looks for yagpcc.yaml in the current working directory. You can override this with --config-path <directory>:
./devbin/yagpcc --config-path /path/to/config