Skip to content

Commit

Permalink
chore(solver/app): event counter metric (#2669)
Browse files Browse the repository at this point in the history
Add event processed counter to solver. The aim is to simply track the
number of events processed by status.

issue: none
  • Loading branch information
corverroos authored Dec 10, 2024
1 parent 3ad64d1 commit d97191e
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 d97191e

Please sign in to comment.