feat(relay): publish the cell-row lock guard's presence counters

The guard ships warn-only so we can observe it firing nowhere before trusting
it, but a field in orca_relay_runtime_metrics is not a Cloud Monitoring metric
until it is listed here. Left unlisted, the denominator that makes that
observation mean anything would itself be log-only -- which is exactly how
cellInventoryHold* shipped unalertable from #18521 until #21067, and a chunk of
why the lock went so long unattributed.

checked is the denominator: zero violations says nothing unless the guard ran.
stoodDown is a bug report, since standing down is indistinguishable from a clean
run without it.
This commit is contained in:
Jinwoo-H
2026-09-16 17:04:48 -04:00
parent 20461e8e1f
commit 9741c75740
@@ -98,6 +98,12 @@ locals {
cell_inventory_holds = { field = "cellInventoryHolds", description = "Cell-inventory locks acquired in the interval; the percentiles above summarise these." }
cell_inventory_lock_unavailable = { field = "cellInventoryLockUnavailable", description = "Fail-fast cell-inventory acquisitions that found the lock held. Includes background sweeps, which step aside by design, so this is contention pressure rather than user-visible failure." }
cell_inventory_lock_timeouts = { field = "cellInventoryLockTimeouts", description = "Bounded cell-inventory waits that expired, counted per attempt rather than per request. This is the user-visible lane." }
cell_row_lock_scopes_checked = { field = "cellRowLockScopesChecked", description = "Transactions in which the cell-row lock guard evaluated at least one relay_cells statement. The denominator: zero violations means nothing unless this is non-zero." }
cell_row_lock_scopes_stood_down = { field = "cellRowLockScopesStoodDown", description = "Transactions in which the guard stood down because it could not read a locked row's cell_id. Non-zero is a bug report, not a clean run." }
cell_row_lock_scope_violations = { field = "cellRowLockScopeViolations", description = "Cell-row lock order violations observed in the interval. Warn-only in production; throws in tests." }
cell_row_lock_scopes_checked = { field = "cellRowLockScopesChecked", description = "Transactions in which the cell-row lock guard evaluated at least one relay_cells write. This is the denominator: zero violations only means something while this is above zero." }
cell_row_lock_scopes_stood_down = { field = "cellRowLockScopesStoodDown", description = "Transactions in which the cell-row lock guard could not read a locked relay_cells statement and stopped checking. Any value above zero is a guard bug, not a clean run." }
cell_row_lock_scope_violations = { field = "cellRowLockScopeViolations", description = "relay_cells row locks taken out of ascending cell_id order, or writes naming no cell. Warn-only in production; the per-cell locking conversion is gated on this staying zero against live traffic." }
}
# Regions the director can hint or select. Pinned to relay-contract's RELAY_REGIONS by