Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregate prometheus partial errors by beaconID #1232

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net"
"net/http"
"runtime"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -259,7 +258,7 @@ var (
ErrorSendingPartialCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "error_sending_partial",
Help: "Number of errors sending partial beacons to nodes. A good proxy for whether nodes are up or down",
}, []string{"beaconID", "round", "address"})
}, []string{"beaconID"})

metricsBound sync.Once
)
Expand Down Expand Up @@ -526,6 +525,6 @@ func ReshareStateChange(s ReshareState, beaconID string, leader bool) {
reshareLeader.WithLabelValues(beaconID).Set(value)
}

func ErrorSendingPartial(beaconID string, round uint64, address string) {
ErrorSendingPartialCounter.WithLabelValues(beaconID, strconv.Itoa(int(round)), address).Inc()
func ErrorSendingPartial(beaconID string) {
ErrorSendingPartialCounter.WithLabelValues(beaconID).Add(1)
}
2 changes: 1 addition & 1 deletion metrics/threshold_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (t *ThresholdMonitor) ReportFailure(beaconID string, round uint64, addr str
t.lock.Lock()
t.failedConnections[addr] = true
t.lock.Unlock()
ErrorSendingPartial(beaconID, round, addr)
ErrorSendingPartial(beaconID)
}

func (t *ThresholdMonitor) UpdateThreshold(newThreshold int) {
Expand Down
Loading