Skip to content

Commit

Permalink
add transaction suspended metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Feb 8, 2024
1 parent 6e3b2a1 commit a28cfc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/relayer/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ var (
Name: "blocks_processed_ops_total",
Help: "The total number of processed blocks",
})
TransactionsSuspended = promauto.NewCounter(prometheus.CounterOpts{
Name: "transactions_suspended_ops_total",
Help: "The total number of suspended transactions",
})
BlocksScanned = promauto.NewCounter(prometheus.CounterOpts{
Name: "blocks_scanned_ops_total",
Help: "The total number of scanned blocks. Acts as heartbeat metric.",
Expand Down
2 changes: 2 additions & 0 deletions packages/relayer/watchdog/watchdog.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ func (w *Watchdog) checkMessage(ctx context.Context, msg queue.Message) error {

slog.Info("Mined tx", "txHash", hex.EncodeToString(tx.Hash().Bytes()))

relayer.TransactionsSuspended.Inc()

if _, err := w.suspendedTxRepo.Save(ctx,
relayer.SuspendTransactionOpts{
MessageID: int(msgBody.Event.Message.Id.Int64()),
Expand Down

0 comments on commit a28cfc0

Please sign in to comment.