From ace3667dfe4a2e6a3de013321c49d28e684223cc Mon Sep 17 00:00:00 2001 From: David Date: Sun, 5 Jan 2025 16:30:12 +0800 Subject: [PATCH 1/2] chore(taiko-client): add more metrics for `TxBuilderWithFallback` --- packages/taiko-client/internal/metrics/metrics.go | 2 ++ packages/taiko-client/proposer/transaction_builder/fallback.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index 0b2fdced5a..b00a4f0898 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -32,6 +32,8 @@ var ( ProposerPoolContentFetchTime = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_pool_content_fetch_time"}) ProposerEstimatedCostCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_calldata"}) ProposerEstimatedCostBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_blob"}) + ProposerProposeByCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_propose_by_calldata"}) + ProposerProposeByBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_propose_by_blob"}) // Prover ProverLatestVerifiedIDGauge = factory.NewGauge(prometheus.GaugeOpts{Name: "prover_latestVerified_id"}) diff --git a/packages/taiko-client/proposer/transaction_builder/fallback.go b/packages/taiko-client/proposer/transaction_builder/fallback.go index ff4a32adf2..467e8dbec6 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback.go @@ -132,10 +132,12 @@ func (b *TxBuilderWithFallback) BuildOntake( if costCalldata.Cmp(costBlob) < 0 { log.Info("Building a type-2 transaction", "costCalldata", costCalldata, "costBlob", costBlob) + metrics.ProposerProposeByCalldata.Inc() return txWithCalldata, nil } log.Info("Building a type-3 transaction", "costCalldata", costCalldata, "costBlob", costBlob) + metrics.ProposerProposeByBlob.Inc() return txWithBlob, nil } From a7d7e19598f160d977202515d21c35b980aa2a9f Mon Sep 17 00:00:00 2001 From: David Date: Sun, 5 Jan 2025 16:30:58 +0800 Subject: [PATCH 2/2] chore(taiko-client): add more metrics for `TxBuilderWithFallback` --- packages/taiko-client/internal/metrics/metrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index b00a4f0898..99e13a1848 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -32,8 +32,8 @@ var ( ProposerPoolContentFetchTime = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_pool_content_fetch_time"}) ProposerEstimatedCostCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_calldata"}) ProposerEstimatedCostBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_blob"}) - ProposerProposeByCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_propose_by_calldata"}) - ProposerProposeByBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_propose_by_blob"}) + ProposerProposeByCalldata = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_calldata"}) + ProposerProposeByBlob = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_blob"}) // Prover ProverLatestVerifiedIDGauge = factory.NewGauge(prometheus.GaugeOpts{Name: "prover_latestVerified_id"})