Add actions to list nodes and retrieve node metrics - #418
Merged
Conversation
CGodiksen
requested review from
skejserjensen
and
a lite review from Copilot
and removed request for
Copilot
August 12, 2026 12:23
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extends the ModelarDB Arrow Flight protocol and server/client implementations to support node-oriented operations, specifically listing cluster nodes and retrieving per-node resource/storage-engine metrics.
Changes:
- Added protobuf messages and Rust helpers for encoding/decoding cluster node metadata.
- Implemented new Arrow Flight actions
ListNodesandNodeMetricson the server (and added integration tests). - Extended
modelardb_embedded::Clientwith node-related APIs (configuration, flush/kill, list nodes, node metrics), plus supporting error handling.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/modelardb_types/src/flight/protocol.proto | Adds NodeMetadata, ClusterNodes, and NodeMetrics protobuf messages. |
| crates/modelardb_types/src/flight/mod.rs | Adds cluster-node encode/decode helpers and a unit test. |
| crates/modelardb_server/tests/integration_test.rs | Adds integration tests for ListNodes/NodeMetrics and updates action-list expectations. |
| crates/modelardb_server/src/storage/types.rs | Makes remaining_ingested_memory_in_bytes available outside tests. |
| crates/modelardb_server/src/storage/mod.rs | Exposes remaining-memory getters on StorageEngine for metrics reporting. |
| crates/modelardb_server/src/remote/mod.rs | Implements ListNodes and NodeMetrics actions and updates ClusterMode usage. |
| crates/modelardb_server/src/main.rs | Removes local ClusterMode definition and uses cluster::ClusterMode. |
| crates/modelardb_server/src/data_folders.rs | Stores the single-node’s Node metadata inside ClusterMode::SingleNode. |
| crates/modelardb_server/src/context.rs | Implements metric collection via sysinfo and disk-space identification logic. |
| crates/modelardb_server/src/configuration.rs | Updates imports/construction to use the new cluster::ClusterMode. |
| crates/modelardb_server/src/cluster.rs | Defines ClusterMode and adds nodes() helpers for single-node vs cluster. |
| crates/modelardb_server/Cargo.toml | Adds sysinfo dependency for metrics collection. |
| crates/modelardb_embedded/src/operations/client.rs | Adds node-related Client methods and refactors action sending/receiving. |
| crates/modelardb_embedded/src/error.rs | Adds a dedicated Prost decode error variant. |
| crates/modelardb_embedded/Cargo.toml | Adds prost dependency needed for decoding response protobufs. |
| Cargo.lock | Updates lockfile for new dependencies (sysinfo, prost). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
skejserjensen
requested changes
Aug 13, 2026
skejserjensen
approved these changes
Aug 14, 2026
chrthomsen
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for two new actions,
ListNodesandNodeMetrics.ListNodeslists all the nodes in the cluster, or the node itself if it is a single node deployment.NodeMetricsreturns a collection of metrics that show general system metrics such as CPU, disk, and memory usage, and ModelarDB specific metrics such as storage engine memory usage.Methods have also been added to
Clientinmodelardb_embeddedto support node related operations on the client. Note that the client still implements theOperationstrait for functionality that is shared betweenDataFolderandClientso these new methods are only extra functionality that only aClientsupports such asFlushNode. Someone using the Rust API forClientnow has access to all Apache Arrow Flight server functionality through a single API, instead of having to useClientfor some things and a manual Apache Arrow Flight client for other things.After the new
Clientwas implemented, it was considered if it could be used elsewhere in the system since it now supports all the Apache Arrow Flight functionality. An issue (#417) has been created to explore this further.