Skip to content

Commit fdeab6b

Browse files
patelarjavmeta-codesync[bot]
authored andcommitted
Add metrics for skipped commits
Summary: Will be useful for monitoring and alerts. Differential Revision: D86218489 fbshipit-source-id: 8e473d3bb2185b6e8d92cad6a1d00516a625f8cc
1 parent b15632b commit fdeab6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wa_raft_server.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,9 +2758,11 @@ commit_pending(#raft_state{log_view = View, pending_high = PendingHigh, pending_
27582758
skipped ->
27592759
% Since the append failed, we do not advance to the new label.
27602760
% We cancel all pending commits that are less than or equal to the current priority.
2761+
?RAFT_COUNTV({'raft.commit.skipped', Priority}, length(Entries)),
27612762
?SERVER_LOG_WARNING(leader, Data, "skipped pre-heartbeat sync for ~0p log entr(ies).", [length(Entries)]),
27622763
cancel_pending({error, commit_stalled}, Data);
27632764
{error, Error} ->
2765+
?RAFT_COUNTV({'raft.commit.error', Priority}, length(Entries)),
27642766
?SERVER_LOG_ERROR(leader, Data, "sync failed due to ~0P.", [Error, 20]),
27652767
error(Error)
27662768
end;

0 commit comments

Comments
 (0)