Description
Both AccountManagerCompleted and WalletManagerCompleted in the Prometheus metrics service incorrectly increment s.signerRequests instead of their respective counters.
Affected files
services/metrics/prometheus/accountmanager.go, line 52
services/metrics/prometheus/walletmanager.go, line 52
Impact
dirk_account_manager_process_requests_total is registered but never incremented.
dirk_wallet_manager_process_requests_total is registered but never incremented.
dirk_signer_process_requests_total is inflated with account manager requests (lock, unlock, generate) and wallet manager requests (lock, unlock) that don't belong to it
Proposed fix
services/metrics/prometheus/accountmanager.go
func (s *Service) AccountManagerCompleted(started time.Time, request string, result core.Result) {
s.accountManagerProcessTimer.WithLabelValues(request).Observe(time.Since(started).Seconds())
- s.signerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc()
+ s.accountManagerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc()
}
services/metrics/prometheus/walletmanager.go
func (s *Service) WalletManagerCompleted(started time.Time, request string, result core.Result) {
s.walletManagerProcessTimer.WithLabelValues(request).Observe(time.Since(started).Seconds())
- s.signerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc()
+ s.walletManagerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc()
}
Description
Both
AccountManagerCompletedandWalletManagerCompletedin the Prometheus metrics service incorrectly increments.signerRequestsinstead of their respective counters.Affected files
services/metrics/prometheus/accountmanager.go, line 52services/metrics/prometheus/walletmanager.go, line 52Impact
dirk_account_manager_process_requests_totalis registered but never incremented.dirk_wallet_manager_process_requests_totalis registered but never incremented.dirk_signer_process_requests_totalis inflated with account manager requests (lock,unlock,generate) and wallet manager requests (lock,unlock) that don't belong to itProposed fix
services/metrics/prometheus/accountmanager.go
func (s *Service) AccountManagerCompleted(started time.Time, request string, result core.Result) { s.accountManagerProcessTimer.WithLabelValues(request).Observe(time.Since(started).Seconds()) - s.signerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc() + s.accountManagerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc() }services/metrics/prometheus/walletmanager.go
func (s *Service) WalletManagerCompleted(started time.Time, request string, result core.Result) { s.walletManagerProcessTimer.WithLabelValues(request).Observe(time.Since(started).Seconds()) - s.signerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc() + s.walletManagerRequests.WithLabelValues(request, strings.ToLower(result.String())).Inc() }