|
|
@@ -80,6 +80,8 @@ func main() {
|
|
|
cb.Measure = func(state int, err error) {
|
|
|
m.CBState.WithLabelValues("nats").Set(float64(state))
|
|
|
}
|
|
|
+ // Initialize gauge to CLOSED (0) so Prometheus sees the metric before first transition.
|
|
|
+ m.CBState.WithLabelValues("nats").Set(0)
|
|
|
logger.Info("circuit breaker configured",
|
|
|
"failure_threshold", cfg.CircuitFailureThreshold,
|
|
|
"failure_window_sec", cfg.CircuitFailureWindowSecs,
|