Cluster sharding state across all the nodes

Using Akka cluster sharding 2.6.3 typed version. Is there any way to retrieve current state and info on nodes, shards and entities in each node?

I tried Akka http managment, it gives nodes and shards info, but it doesn’t provide the entity ids in each shard.

Came across following, which suggests to send ShardRegion.getShardRegionStateInstance to the shard region. I do not see how I can send this request for a typed shard region actor. Any sample code in Java would be helpful.

Is there any way we can retrieve this info across all the nodes, probably from store coordinator?

This would be helpful to monitor and test the cluster.


The sharding queries are not fully implemented in the new APIs yet. Some are, implemented, some are in progress (PR).

Thanks Patrik for the response. Can you let me know which older version has such support to query shar and entity ids and how would we do it?

Currently included in Akka 2.6.4 is akka.cluster.sharding.typed.GetShardRegionState.
Send GetShardRegionState message to the ClusterSharding(system).shardState. That will get the local regions state.

What is missing is the aggregated queries. Some work in progress in

As a workaround you should be able to use the queries with the classic ClusterSharding even though the actual entities are initialized with Typed ClusterSharding. Then it’s the messages described in Sending to the ActorRef retrieved with akka.cluster.sharding.ClusterSharding(system).shardRegion(typeName).