@@ -59,15 +59,17 @@ type Metricer interface {
5959 // It should be called when clearing the ChannelManager state.
6060 ClearAllStateMetrics ()
6161
62- RecordBatchTxSubmitted ()
63- RecordBatchTxSuccess ()
64- RecordBatchTxFailed ()
62+ RecordBatchTxSubmitted (daType string )
63+ RecordBatchTxSuccess (daType string )
64+ RecordBatchTxFailed (daType string )
6565
6666 RecordBlobUsedBytes (num int )
6767
6868 Document () []opmetrics.DocumentedMetric
6969
7070 PendingDABytes () float64
71+
72+ RecordFailoverToEthDA ()
7173}
7274
7375type Metrics struct {
@@ -122,6 +124,8 @@ type Metrics struct {
122124 pidControllerIntegral prometheus.Gauge
123125 pidControllerDerivative prometheus.Gauge
124126 pidResponseTime prometheus.Histogram
127+
128+ eigenDAFailoverToEthDA prometheus.Counter
125129}
126130
127131var _ Metricer = (* Metrics )(nil )
@@ -235,7 +239,7 @@ func NewMetrics(procName string) *Metrics {
235239 Buckets : prometheus .LinearBuckets (0.0 , eth .MaxBlobDataSize / 13 , 14 ),
236240 }),
237241
238- batcherTxEvs : opmetrics .NewEventVec (factory , ns , "" , "batcher_tx" , "BatcherTx" , []string {"stage" }),
242+ batcherTxEvs : opmetrics .NewEventVec (factory , ns , "" , "batcher_tx" , "BatcherTx" , []string {"stage" , "datype" }),
239243
240244 throttleIntensity : * factory .NewGaugeVec (prometheus.GaugeOpts {
241245 Namespace : ns ,
@@ -298,6 +302,11 @@ func NewMetrics(procName string) *Metrics {
298302 Name : "unsafe_da_bytes" ,
299303 Help : "The estimated number of unsafe DA bytes" ,
300304 }),
305+ eigenDAFailoverToEthDA : factory .NewCounter (prometheus.CounterOpts {
306+ Namespace : ns ,
307+ Name : "eigenda_failover_total" ,
308+ Help : "Total number of failovers to EthDA" ,
309+ }),
301310 }
302311 m .pendingDABytesGaugeFunc = factory .NewGaugeFunc (prometheus.GaugeOpts {
303312 Namespace : ns ,
@@ -428,16 +437,16 @@ func (m *Metrics) RecordChannelTimedOut(id derive.ChannelID) {
428437 m .channelEvs .Record (StageTimedOut )
429438}
430439
431- func (m * Metrics ) RecordBatchTxSubmitted () {
432- m .batcherTxEvs .Record (TxStageSubmitted )
440+ func (m * Metrics ) RecordBatchTxSubmitted (daType string ) {
441+ m .batcherTxEvs .Record (TxStageSubmitted , daType )
433442}
434443
435- func (m * Metrics ) RecordBatchTxSuccess () {
436- m .batcherTxEvs .Record (TxStageSuccess )
444+ func (m * Metrics ) RecordBatchTxSuccess (daType string ) {
445+ m .batcherTxEvs .Record (TxStageSuccess , daType )
437446}
438447
439- func (m * Metrics ) RecordBatchTxFailed () {
440- m .batcherTxEvs .Record (TxStageFailed )
448+ func (m * Metrics ) RecordBatchTxFailed (daType string ) {
449+ m .batcherTxEvs .Record (TxStageFailed , daType )
441450}
442451
443452func (m * Metrics ) RecordBlobUsedBytes (num int ) {
@@ -511,3 +520,8 @@ func (m *Metrics) RecordThrottleControllerState(error, integral, derivative floa
511520func (m * Metrics ) RecordThrottleResponseTime (duration time.Duration ) {
512521 m .pidResponseTime .Observe (duration .Seconds ())
513522}
523+
524+ // RecordFailoverToEthDA records when the system fails over to EthDA
525+ func (m * Metrics ) RecordFailoverToEthDA () {
526+ m .eigenDAFailoverToEthDA .Inc ()
527+ }
0 commit comments