Skip to content

Commit 07fb3bc

Browse files
committed
refactor: metrics names and descriptions
1 parent a027bd2 commit 07fb3bc

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

core/chainio/avs_writer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ func (w *AvsWriter) checkRespondToTaskFeeLimit(tx *types.Transaction, txOpts bin
135135
if respondToTaskFeeLimit.Cmp(simulatedCost) < 0 {
136136
aggregatorDifferenceToPay := new(big.Int).Sub(simulatedCost, respondToTaskFeeLimit)
137137
aggregatorDifferenceToPayInEth, _ := utils.WeiToEth(aggregatorDifferenceToPay).Float64()
138-
w.metrics.AddAccumulatedGasPayedAggregator(aggregatorDifferenceToPayInEth)
139-
w.metrics.IncAggregatorAccumResponse()
138+
w.metrics.AddAggregatorGasPaidForBatcher(aggregatorDifferenceToPayInEth)
139+
w.metrics.IncAggregatorPaidForBatcher()
140140
w.logger.Warn("cost of transaction is higher than Batch.RespondToTaskFeeLimit, aggregator will pay the for the difference, aprox: %v", aggregatorDifferenceToPay)
141141
}
142142

metrics/metrics.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
)
1414

1515
type Metrics struct {
16-
ipPortAddress string
17-
logger logging.Logger
18-
numAggregatedResponses prometheus.Counter
19-
numAggregatorReceivedTasks prometheus.Counter
20-
numOperatorTaskResponses prometheus.Counter
21-
accumulatedGasPriceSpent prometheus.Gauge
22-
numAccumulatedGasPriceSpent prometheus.Counter
16+
ipPortAddress string
17+
logger logging.Logger
18+
numAggregatedResponses prometheus.Counter
19+
numAggregatorReceivedTasks prometheus.Counter
20+
numOperatorTaskResponses prometheus.Counter
21+
aggregatorGasCostPaidForBatcherTotal prometheus.Gauge
22+
aggregatorNumTimesPaidForBatcher prometheus.Counter
2323
}
2424

2525
const alignedNamespace = "aligned"
@@ -43,15 +43,15 @@ func NewMetrics(ipPortAddress string, reg prometheus.Registerer, logger logging.
4343
Name: "aggregator_received_tasks",
4444
Help: "Number of tasks received by the Service Manager",
4545
}),
46-
accumulatedGasPriceSpent: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
46+
aggregatorGasCostPaidForBatcherTotal: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
4747
Namespace: alignedNamespace,
48-
Name: "aggregator_accumulated_gas_price_payed",
49-
Help: "Number of tasks received by the Service Manager",
48+
Name: "aggregator_gas_cost_paid_for_batcher",
49+
Help: "Accumulated gas cost the aggregator paid for the batcher when the tx cost was higher than the respondToTaskFeeLimit",
5050
}),
51-
numAccumulatedGasPriceSpent: promauto.With(reg).NewCounter(prometheus.CounterOpts{
51+
aggregatorNumTimesPaidForBatcher: promauto.With(reg).NewCounter(prometheus.CounterOpts{
5252
Namespace: alignedNamespace,
53-
Name: "aggregator_number_accumulated_gas_price_payed",
54-
Help: "Number of tasks received by the Service Manager",
53+
Name: "aggregator_num_times_paid_for_batcher",
54+
Help: "Number of times the aggregator paid for the batcher when the tx cost was higher than the respondToTaskFeeLimit",
5555
}),
5656
}
5757
}
@@ -99,10 +99,10 @@ func (m *Metrics) IncOperatorTaskResponses() {
9999
m.numOperatorTaskResponses.Inc()
100100
}
101101

102-
func (m *Metrics) IncAggregatorAccumResponse() {
103-
m.numAccumulatedGasPriceSpent.Inc()
102+
func (m *Metrics) IncAggregatorPaidForBatcher() {
103+
m.aggregatorGasCostPaidForBatcherTotal.Inc()
104104
}
105105

106-
func (m *Metrics) AddAccumulatedGasPayedAggregator(value float64) {
107-
m.accumulatedGasPriceSpent.Add(value)
106+
func (m *Metrics) AddAggregatorGasPaidForBatcher(value float64) {
107+
m.aggregatorNumTimesPaidForBatcher.Add(value)
108108
}

operator/pkg/register.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func RegisterOperator(
1717
configuration *config.OperatorConfig,
1818
operatorToAvsRegistrationSigSalt [32]byte,
1919
) error {
20-
writer, err := chainio.NewAvsWriterFromConfig(configuration.BaseConfig, configuration.EcdsaConfig)
20+
writer, err := chainio.NewAvsWriterFromConfig(configuration.BaseConfig, configuration.EcdsaConfig, nil)
2121
if err != nil {
2222
configuration.BaseConfig.Logger.Error("Failed to create AVS writer", "err", err)
2323
return err

0 commit comments

Comments
 (0)