Skip to content

Commit

Permalink
fix: only increase error counter once when catching roundTripper errors
Browse files Browse the repository at this point in the history
Signed-off-by: Clément Nussbaumer <clement.nussbaumer@postfinance.ch>
  • Loading branch information
clementnuss committed Jun 3, 2024
1 parent b403ddd commit 740b8d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/servicecheck/httptrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ func withHttptrace(registry *prometheus.Registry, next http.RoundTripper, durHis
}
} else {
eventType := "round_trip_error"
errorCounter.WithLabelValues(eventType, kubenurseRequestType).Inc()
// errorCounter.WithLabelValues(eventType, kubenurseRequestType).Inc()
// normally, errors are already accounted for in the ClientTrace section.
// we still log the error, so in the future we can compare the log entries and see if somehow
// an error isn't catched in the ClientTrace section
slog.Error("request failure in httptrace",
"event_type", eventType,
"request_type", kubenurseRequestType, "err", err)
Expand Down

0 comments on commit 740b8d4

Please sign in to comment.