diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt index ca50e8f8d5..b097d45dc5 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt @@ -14,6 +14,7 @@ import io.atomix.copycat.client.ConnectionStrategies import io.atomix.copycat.client.CopycatClient import io.atomix.copycat.client.RecoveryStrategies import io.atomix.copycat.server.CopycatServer +import io.atomix.copycat.server.cluster.Member import io.atomix.copycat.server.storage.Storage import io.atomix.copycat.server.storage.StorageLevel import net.corda.core.contracts.StateRef @@ -185,6 +186,14 @@ class RaftUniquenessProvider(private val transportConfiguration: NodeSSLConfigur metrics.register("RaftCluster.Members", Gauge> { server.cluster().members().map { it.address().toString() } }) + + metrics.register("RaftCluster.AvailableMembers", Gauge> { + server.cluster().members().filter { it.status() == Member.Status.AVAILABLE }.map { it.address().toString() } + }) + + metrics.register("RaftCluster.AvailableMembersCount", Gauge { + server.cluster().members().filter { it.status() == Member.Status.AVAILABLE }.size + }) }