Skip to content

Commit

Permalink
chore(solver/app): event counter metric
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed Dec 10, 2024
1 parent 3ad64d1 commit c811542
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions solver/app/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ var (
Name: "status_offset",
Help: "Last inbox offset processed by chain and status",
}, []string{"chain", "status"})

processedEvents = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "solver",
Subsystem: "processor",
Name: "processed_events_total",
Help: "Total number of events processed by chain and status",
}, []string{"chain", "status"})
)
2 changes: 2 additions & 0 deletions solver/app/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func newEventProcessor(deps procDeps, chainID uint64) xchain.EventLogsCallback {
default:
return errors.New("unknown status [BUG]")
}

processedEvents.WithLabelValues(deps.ChainName(chainID), statusString(event.Status)).Inc()
}

return deps.SetCursor(ctx, chainID, height)
Expand Down

0 comments on commit c811542

Please sign in to comment.