Skip to content

Expose shard count via cluster status API #204

@kriszyp

Description

@kriszyp

Request

When managing a sharded cluster across multiple environments, there is no easy programmatic way to determine how many shards are configured in a replica set. The shard count should be exposed through the cluster status API.

Current state

clusterStatus exposes a shard field per-node (the shard index for that node), and internally knownNodes.ts builds a server.shards Map with all shard→node mappings. However, aggregate shard count is not surfaced in any API response.

Proposed

Add shardCount (or numberOfShards) to the cluster/replication status response so consumers can easily determine topology without counting individual node shard fields themselves.

🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clusteringClustering, sharding, replication topologyenhancementNew feature or requestfrom-jiraMigrated or originated from a Jira ticket

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions