Skip to content

Commit e7ca86a

Browse files
committed
Fix GetAppClusteringInfo counter accounting
GetAppClusteringInfo() called IncrementRequestCounter() on both the error and success paths. IncrementRequestCounter only bumps totalRequests, not errors or successfulRequests, so every clustering probe silently widened the gap between ovn_requests_total and ovn_successful_requests_total + ovn_failed_requests_total. Any dashboard computing a success ratio as ovn_successful_requests_total / ovn_requests_total therefore saw an artificial ceiling below 100% even when nothing was actually failing. Use IncrementErrorCounter on the failure path and IncrementSuccessCounter on the success path so the three request counters stay consistent (total = successful + failed). Signed-off-by: Michele Palazzi <sysdadmin@m1k.cloud>
1 parent df20bd4 commit e7ca86a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/ovn_exporter/ovn_exporter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ func (e *Exporter) GatherMetrics() {
10971097
"system_id", e.Client.System.ID,
10981098
"error", err.Error(),
10991099
)
1100-
e.IncrementRequestCounter()
1100+
e.IncrementErrorCounter()
11011101
e.metrics = append(e.metrics, prometheus.MustNewConstMetric(
11021102
clusterEnabled,
11031103
prometheus.GaugeValue,
@@ -1106,7 +1106,7 @@ func (e *Exporter) GatherMetrics() {
11061106
component,
11071107
))
11081108
} else {
1109-
e.IncrementRequestCounter()
1109+
e.IncrementSuccessCounter()
11101110
isClusterEnabled = true
11111111
switch component {
11121112
case "ovsdb-server-southbound":

0 commit comments

Comments
 (0)