Skip to content

[BUG] AccountManagerCompleted and WalletManagerCompleted increment signerRequests counter instead of their own #95

Description

@yohamta0

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

  1. dirk_account_manager_process_requests_total is registered but never incremented.
  2. dirk_wallet_manager_process_requests_total is registered but never incremented.
  3. 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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions