Skip to content

Commit 10dcdbf

Browse files
fix: correct metrics label in requestPreVote handler (hashicorp#665)
The requestPreVote handler reuses the metrics key "requestVote" from copy-paste in hashicorp#530. This causes pre-vote RPC latency to be mixed into the raft.rpc.requestVote metric. Fix: change to "requestPreVote" to match the pattern used by all other RPC handlers. Co-authored-by: Qian-Cheng-nju <Qian-Cheng-nju@users.noreply.github.com>
1 parent 9071aaf commit 10dcdbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

raft.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ func (r *Raft) requestVote(rpc RPC, req *RequestVoteRequest) {
17351735

17361736
// requestPreVote is invoked when we get a request Pre-Vote RPC call.
17371737
func (r *Raft) requestPreVote(rpc RPC, req *RequestPreVoteRequest) {
1738-
defer metrics.MeasureSince([]string{"raft", "rpc", "requestVote"}, time.Now())
1738+
defer metrics.MeasureSince([]string{"raft", "rpc", "requestPreVote"}, time.Now())
17391739
r.observe(*req)
17401740

17411741
// Setup a response

0 commit comments

Comments
 (0)