cluster_health::Monitor is a cluster controller background task that periodically evaluates a fixed set of health factors and emits a ClusterHealthMetric trace event.
The monitor is controlled by these server knobs:
| Knob | Default | Meaning |
|---|---|---|
CLUSTER_HEALTH_METRIC_ENABLE |
false |
Enables the cluster controller monitor. When disabled, the monitor exits immediately and does not emit ClusterHealthMetric. Simulation buggification can set this to true. |
CLUSTER_HEALTH_METRIC_POLL_INTERVAL |
5.0 seconds |
Time between monitor evaluations after the first evaluation. |
CLUSTER_HEALTH_METRIC_STORAGE_INTERVENTION_THRESHOLD |
0.20 |
Storage server free-space warning threshold. This is a ratio, not a percentage: 0.20 means 20% free space. |
CLUSTER_HEALTH_METRIC_STORAGE_CRITICAL_THRESHOLD |
0.10 |
Storage server free-space critical threshold. This should be less than or equal to the storage intervention threshold. |
CLUSTER_HEALTH_METRIC_TLOG_INTERVENTION_THRESHOLD |
0.20 |
TLog queue-disk free-space warning threshold. This is a ratio, not a percentage: 0.20 means 20% free space. |
CLUSTER_HEALTH_METRIC_TLOG_CRITICAL_THRESHOLD |
0.10 |
TLog queue-disk free-space critical threshold. This should be less than or equal to the TLog intervention threshold. |
CLUSTER_HEALTH_METRIC_RK_CRITICAL_RELEASED_TPS_RATIO_THRESHOLD |
1.2 |
Ratekeeper critical throttling threshold for TPSLimit / ReleasedTPS. With the default, ratekeeper is critical when the current TPS limit is less than 120% of recently released TPS. |
Threshold comparisons are strict: a value equal to a threshold does not trigger that threshold's health level.
Each factor uses the following levels:
HEALTHY: No issue is currently indicated by the factor.SELF_HEALING: The cluster is degraded, but automatic recovery or repair is already in progress.INTERVENTION_REQUIRED: The cluster is still functioning, but an operator likely needs to act to restore full health.CRITICAL_INTERVENTION_REQUIRED: The cluster is functioning, but in a severe state that likely requires immediate operator action.OUTAGE: The factor indicates loss of availability or loss of a required safety property.METRICS_MISSING: The factor could not evaluate because the required trace-event data was unavailable or malformed.
For aggregation, the implementation assigns an internal score to each level and keeps the lowest-scoring factor as the aggregate result:
HEALTHY= 100SELF_HEALING= 80INTERVENTION_REQUIRED= 60CRITICAL_INTERVENTION_REQUIRED= 40METRICS_MISSING= 20OUTAGE= 0
These numeric values provide a scalar metric that can be emitted, and leave room for additional intermediate values to be added in the future.
The monitor currently evaluates these factors:
Source event:
"<StorageServerInterface.id()>/StorageMetrics"
Fields used:
KvstoreBytesAvailableKvstoreBytesTotal
Behavior:
- Computes the minimum
KvstoreBytesAvailable / KvstoreBytesTotalratio across storage servers. - Returns
CRITICAL_INTERVENTION_REQUIREDwhen the ratio is belowCLUSTER_HEALTH_METRIC_STORAGE_CRITICAL_THRESHOLD. - Returns
INTERVENTION_REQUIREDwhen the ratio is belowCLUSTER_HEALTH_METRIC_STORAGE_INTERVENTION_THRESHOLDand at or aboveCLUSTER_HEALTH_METRIC_STORAGE_CRITICAL_THRESHOLD. - Returns
HEALTHYotherwise.
Source event:
"<TLogInterface.id()>/TLogMetrics"
Fields used:
QueueDiskBytesAvailableQueueDiskBytesTotal
Behavior:
- Computes the minimum
QueueDiskBytesAvailable / QueueDiskBytesTotalratio across tlogs. - Returns
CRITICAL_INTERVENTION_REQUIREDwhen the ratio is belowCLUSTER_HEALTH_METRIC_TLOG_CRITICAL_THRESHOLD. - Returns
INTERVENTION_REQUIREDwhen the ratio is belowCLUSTER_HEALTH_METRIC_TLOG_INTERVENTION_THRESHOLDand at or aboveCLUSTER_HEALTH_METRIC_TLOG_CRITICAL_THRESHOLD. - Returns
HEALTHYotherwise.
Source event:
MovingData
Fields used:
InQueueInFlightPriorityTeamUnhealthyPriorityTeam2LeftPriorityTeam1LeftPriorityTeam0Left
Behavior:
- Returns
OUTAGEif anyPriorityTeam0Left > 0. - Returns
CRITICAL_INTERVENTION_REQUIREDif anyPriorityTeam1Left > 0and the configured storage team size is 3. - Returns
SELF_HEALINGif data movement is queued or in flight to restore replication. - Returns
HEALTHYotherwise.
Source:
ServerDBInfo::recoveryStatefrom the cluster controller
Fields used:
- none; this factor reads the cluster controller's in-memory
RecoveryState
Behavior:
- Returns
OUTAGEif recovery state is belowRecoveryState::ACCEPTING_COMMITS. - Returns
SELF_HEALINGif recovery is at or aboveACCEPTING_COMMITSbut belowFULLY_RECOVERED. - Returns
HEALTHYatFULLY_RECOVERED.
Source:
GetLeaderRequestsent directly to each coordinator configured in the cluster connection string
Fields used:
- none; this factor checks whether each coordinator replies before the probe timeout
Behavior:
- Returns
INTERVENTION_REQUIREDif any configured coordinator is missing or unreachable. - Returns
HEALTHYif every configured coordinator replies. - Returns
METRICS_MISSINGif no coordinator list is available.
Source event:
- latest worker error event, fetched with
EventLogRequest()
Fields used:
- none are parsed directly; the factor only checks whether a non-empty latest-error trace event exists.
Behavior:
- Returns
CRITICAL_INTERVENTION_REQUIREDif any worker reports a non-empty latest error. - Returns
HEALTHYif all non-failed latest-error records are empty and at least one latest-error request succeeded. - Returns
METRICS_MISSINGonly if every latest-error request fails.
Source event:
RkUpdate
Fields used:
ReleasedTPS: Ratekeeper's smoothed rate of transactions that GRV proxies have recently released from their start-transaction queues. A released transaction has been allowed to get a read version and begin; this is not commit throughput.TPSLimit: Ratekeeper's current transaction-per-second limit for normal transaction starts, computed from cluster pressure signals and sent back to GRV proxies to pace future releases. A value of0means ratekeeper is not allowing normal transaction starts.
Behavior:
- Returns
OUTAGEif anyTPSLimit == 0. - Computes the minimum
TPSLimit / ReleasedTPSratio across samples with nonzeroReleasedTPS. - Ignores samples with
ReleasedTPS == 0for the ratio calculation to avoid dividing by zero. - Returns
CRITICAL_INTERVENTION_REQUIREDwhen the minimum ratio is belowCLUSTER_HEALTH_METRIC_RK_CRITICAL_RELEASED_TPS_RATIO_THRESHOLD. - Returns
HEALTHYotherwise, including the case where every non-outage sample hasReleasedTPS == 0.
For CLUSTER_HEALTH_METRIC_RK_CRITICAL_RELEASED_TPS_RATIO_THRESHOLD, lower ratios are worse:
TPSLimit / ReleasedTPS == 2.0means ratekeeper is allowing twice the recently released transaction rate, so this factor is healthy with the default threshold.TPSLimit / ReleasedTPS == 1.0means ratekeeper's current limit is equal to the recently released transaction rate, so this factor is critical with the default threshold of1.2.TPSLimit / ReleasedTPS < 1.0means ratekeeper's current limit is below the recently released transaction rate, which is also critical.
Most factors treat missing or malformed inputs as METRICS_MISSING.
This can happen when:
- the underlying latest-event RPC fails
- no relevant worker emitted the requested trace event
- the trace event exists but does not contain the required fields
- a field cannot be parsed to the expected type
The implementation filters out empty TraceEventFields before interpreting a factor, so workers that never emit a role-specific event do not automatically degrade the whole metric.
The monitor emits a periodic trace event named ClusterHealthMetric.
Fields:
FactorStorageSpace: string enum, one ofOutage,CriticalInterventionRequired,InterventionRequired,SelfHealing,MetricsMissing,HealthyFactorTLogSpace: same enumFactorStorageReplication: same enumFactorRecoveryState: same enumFactorCoordinatorReachability: same enumFactorProcessErrors: same enumFactorRkThrottling: same enumAggregate: same enum, computed from the most limiting factorAggregateValue: numeric aggregate score, currently one of0,20,40,60,80, or100LimitingFactor: factor name string, present when not healthy
The aggregate is determined by taking the lowest-scoring level across all factors.