Monitoring

Monitoring is how you turn Raft from a library into an operable subsystem. MicroRaft exposes both pull-style and push-style surfaces for this.

Pull-based reporting

RaftNodeReport contains internal state such as role, term, leader, last log index, and commit index.

  • query reports via RaftNode.getReport()
  • export them into your existing monitoring system
  • use them for snapshots of current cluster health

Push-based reporting

RaftNodeReportListener is invoked when important state changes happen, such as leader change, term change, or snapshot installation.

  • capture state transitions as they happen
  • feed alerts and event streams promptly
  • react to topology and health changes without polling lag

Micrometer integration

MicroRaft offers a dedicated module for publishing metrics via Micrometer.

Gradle Kotlin DSL

implementation("io.microraft:microraft-metrics:0.9")

Maven

<dependency>
    <groupId>io.microraft</groupId>
    <artifactId>microraft-metrics</artifactId>
    <version>0.9</version>
</dependency>

What to alert on

  • unexpected leader changes
  • quorum loss or sustained follower isolation
  • replication lag and commit index drift
  • snapshot churn and recovery loops

Continue with the Production Checklist for rollout-level guidance.

Open checklist