diff --git a/op-node/metrics/metrics.go b/op-node/metrics/metrics.go index bd4b0bf173e54..1c4e3e6a907e5 100644 --- a/op-node/metrics/metrics.go +++ b/op-node/metrics/metrics.go @@ -44,6 +44,8 @@ type Metrics struct { DerivationErrorsTotal prometheus.Counter Heads *prometheus.GaugeVec + TransactionsSequencedTotal prometheus.Counter + registry *prometheus.Registry } @@ -147,6 +149,12 @@ func NewMetrics(procName string) *Metrics { "type", }), + TransactionsSequencedTotal: promauto.With(registry).NewGauge(prometheus.GaugeOpts{ + Namespace: ns, + Name: "transactions_sequenced_total", + Help: "Count of total transactions sequenced", + }), + registry: registry, } } diff --git a/op-node/rollup/driver/state.go b/op-node/rollup/driver/state.go index 91733314d8b99..7ad59fa23fc36 100644 --- a/op-node/rollup/driver/state.go +++ b/op-node/rollup/driver/state.go @@ -244,6 +244,7 @@ func (s *state) createNewL2Block(ctx context.Context) error { s.l2Head = newUnsafeL2Head s.log.Info("Sequenced new l2 block", "l2Head", s.l2Head, "l1Origin", s.l2Head.L1Origin, "txs", len(payload.Transactions), "time", s.l2Head.Time) + s.metrics.TransactionsSequencedTotal.Add(float64(len(payload.Transactions))) if s.network != nil { if err := s.network.PublishL2Payload(ctx, payload); err != nil {